Skip to content
Discussion options

You must be logged in to vote

Why SeaQuery does “string + values” every time

  • String building is cheap: Constructing the SQL string is not the bottleneck. Database drivers already have prepared statement caches internally. So even if SeaQuery hands over a fresh (string, values) each time, the driver can reuse the prepared plan under the hood. You don’t pay the full parse cost every time.

  • AST structural difference: SeaQuery builds queries dynamically. The AST can differ between calls depending on conditions (e.g. optional filters, dynamic joins, conditional WHERE clauses). That makes it tricky to pre‑prepare a single statement and just swap values - because the shape of the query itself may change. Example from readme:

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nu11ptr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants