Skip to content

Conversation

@stephencelis
Copy link
Member

This PR improves upon a few deficiencies of #151:

  1. It forces the definition of QueryBindable.init?(queryBinding:). This is a breaking change for folks that define their own types conforming to `QueryRepresentable, but we are in the 0.x stage still, and custom query representations should be relatively uncommon. Still, we have a new migration guide to help.
  2. It introduces an as: parameter to @DatabaseFunction for defining functions that work with custom query representations, like JSON.

We need to explicitly define more initializers. This does make me think
`QueryBindable` needs to track the intermediate representation better so
we could generate these.
@stephencelis stephencelis merged commit 14f79c6 into main Sep 2, 2025
3 checks passed
@stephencelis stephencelis deleted the database-function-fixes branch September 2, 2025 17:28
coenttb pushed a commit to coenttb/swift-structured-queries-postgres that referenced this pull request Oct 14, 2025
* Fix database function binding overflows

We need to explicitly define more initializers. This does make me think
`QueryBindable` needs to track the intermediate representation better so
we could generate these.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update MigratingTo0.16.md

* wip
coenttb pushed a commit to coenttb/swift-structured-queries-postgres that referenced this pull request Oct 15, 2025
* Fix database function binding overflows

We need to explicitly define more initializers. This does make me think
`QueryBindable` needs to track the intermediate representation better so
we could generate these.

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update MigratingTo0.16.md

* 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