Replies: 1 comment 4 replies
-
|
I am really interested in seeing where this goes. I’ll highly appreciate a Posgres-compatible swift-structured-queries where I can use in my server applications. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
PostgresNIO Integration for StructuredQueries
Hi everybody,
I've spend some time on a PostgresNIO integration with StructuredQueries:
swift-structured-queries-postgres.What's Working
✅ Full core functionality (SELECT, INSERT, UPDATE, DELETE)
✅ PostgreSQL-specific aggregates:
string_agg,array_agg,json_agg,stddev,variance✅ Test-suite passing (1 disabled test = crashing).
Some questions:
1. Boolean Handling: Following PointFree's' SQLite approach, I use
INTEGER CHECK (col IN (0,1))instead of nativeBOOLEAN. Is this the right call? More general: should it strictly follow SQLite patterns even when PostgreSQL has native features?2. Parameter Conversion: Currently using regex to convert
?→$1. Works but feels hacky. Better approach? Necessary for Postgres' Booleans dialect.3. Dependencies + Async: Struggling with clean async database initialization in
DependencyKey.liveValue. Currently using semaphores. Ideas? Perhaps defer toprepareDependencies? But then how to make it ergonomic in tests?Known Issues
swift buildorswift test. Xcode build and tests work just fine. Seems to be a StructuredQueries issue?@Selectioncauses runtime crashes (see 'liveJoin' (disabled) test). Not sure how to solve this particular one.Thanks PointFree for the elegant StructuredQueries! Would love your feedback on this project. And please do let me know if you're interested in making this an official integration.
Try It
Beta Was this translation helpful? Give feedback.
All reactions