Closed vladfrangu closed 1 year ago
I'm just (very slightly) confused about the prepared statements management - can we have a Record<statementName, Statement | null> for them?
Same here, I was also a bit confused by that, but saw that it was done this way before... I'd argue we don't even need to go through the prepared statements for every single query, it makes sense only for those that will be repeated very often. Either way, this deserves some abstraction so we don't need to handle it again and again for every single query.
- And (on a very similar note), how about wrapping
this._updateOrderNo.run({...})
inthis.updateOrderNo({...})
, which would basically be the_initUpdateOrderNo
andthis._updateOrderNo.run({...})
together? It might make the logic a bit clear (and we could ditch the preemptive calls to_initUpdateOrderNo
in every method).
Good point, will change
Just checked the tests, and they seem fine to me :)
Some tiny nits:
Record<statementName, Statement | null>
for them?this._updateOrderNo.run({...})
inthis.updateOrderNo({...})
, which would basically be the_initUpdateOrderNo
andthis._updateOrderNo.run({...})
together? It might make the logic a bit clear (and we could ditch the preemptive calls to_initUpdateOrderNo
in every method).