You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Boolean Handling: Following PointFree's' SQLite approach, I use INTEGER CHECK (col IN (0,1)) instead of native BOOLEAN. 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 to prepareDependencies? But then how to make it ergonomic in tests?
Known Issues
Compiler crashes when building or testing via Terminal swift build or swift test. Xcode build and tests work just fine. Seems to be a StructuredQueries issue?
JOIN with @Selection causes 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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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 build
orswift test
. Xcode build and tests work just fine. Seems to be a StructuredQueries issue?@Selection
causes 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