-
Notifications
You must be signed in to change notification settings - Fork 540
Support SqlDelight modules to implement PostgreSql extensions #5677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 @griffio This is great! Are there any plans to move this out of a draft state and merge it for use in snapshot builds? We're using SQLDelight now with Postgres and were hoping to leverage pgvector. |
30b4fe7
to
fb1d1fd
Compare
OK have set for review - I implemented several interesting extensions to see what problems and work-arounds are needed. Keep in mind SqlDelight is really for basic Sql operations - |
Thank you! And, of course. Our PostgreSQL use cases are straightforward (no need for Triggers, etc.). Your change here unblocks pgvector and AI Vector embedding models, which is really what we're (and I'm sure others!) are excited about. |
fb1d1fd
to
09e56d6
Compare
Make the PostgreSqlType public so it can be accessed in third party modules
open PostgreSqlTypeResolver for extension and polymorphic calls booleanBinaryExprTypes is a new protected method to allow subclasses to add types
09e56d6
to
7a817c1
Compare
Any update on snapshots? |
love seeing stuff being built as extensions <3 |
☢️ Experimental
🐙 Use the SqlDelight module service loader (see sqlite json-module )to implement Postgresql 3rd party extensions - rather than add in the PostgreSql grammar or having to create a new sub dialect.
🧪 Example extension modules using these changes:
bm25 - text search - https://github.com/griffio/sqldelight-bm25-module-app
pgvector - vector embeddings - https://github.com/griffio/sqldelight-pgvector-module-app
postgis - ever popular - https://github.com/griffio/sqldelight-postgis-module-app
PostgreSqlTypeResolver
for inheritance to allow calling into subclasses - delegation is not enoughPostgreSqlType
for modules to access existing PostgreSql typesbooleanBinaryExprTypes
as modules can add boolean binary operator types