Skip to content

Conversation

@stephencelis
Copy link
Member

Currently, query fragments are modeled as strings with ?s denoting bindings, and an array of bindings. Instead we should model things as a single array of segments that can be concatenated with whatever form of binding identifier we need. For example, Postgres can use $1, $2, etc.

This remodel also has the positive effect of safer debug descriptions for queries.

Currently, query fragments are modeled as strings with `?`s denoting
bindings, and an array of bindings. Instead we should model things as a
single array of segments that can be concatenated with whatever form of
binding identifier we need. For example, Postgres can use `$1`, `$2`,
etc.

This remodel also has the positive effect of safer debug descriptions of
our queries.
@stephencelis stephencelis requested a review from mbrandonw June 16, 2025 15:24
@stephencelis stephencelis marked this pull request as ready for review June 16, 2025 19:18
@stephencelis stephencelis merged commit 5608aaf into main Jun 16, 2025
3 checks passed
@stephencelis stephencelis deleted the query-fragment-segments branch June 16, 2025 20:30
coenttb pushed a commit to coenttb/swift-structured-queries-postgres that referenced this pull request Oct 14, 2025
* Begin to decouple query fragments from SQLite

Currently, query fragments are modeled as strings with `?`s denoting
bindings, and an array of bindings. Instead we should model things as a
single array of segments that can be concatenated with whatever form of
binding identifier we need. For example, Postgres can use `$1`, `$2`,
etc.

This remodel also has the positive effect of safer debug descriptions of
our queries.

* wip

* wip

* wip
coenttb pushed a commit to coenttb/swift-structured-queries-postgres that referenced this pull request Oct 15, 2025
* Begin to decouple query fragments from SQLite

Currently, query fragments are modeled as strings with `?`s denoting
bindings, and an array of bindings. Instead we should model things as a
single array of segments that can be concatenated with whatever form of
binding identifier we need. For example, Postgres can use `$1`, `$2`,
etc.

This remodel also has the positive effect of safer debug descriptions of
our queries.

* wip

* wip

* wip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants