-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
slonik support @neondatabase/serverless (postgres over HTTP / websockets) - pg compatible #642
Comments
This would belong in community packages. I will leave this issue open in case anyone wants to contribute a bridge. I will add it to Slonik's README. |
@gajus what about support for https://github.com/electric-sql/pglite ? |
@gajus is there a repo for community packages or a contribution doc / process? Like if I or another dev were to implement something where would we PR / where would you add it (e.g. like a Or did you mean that if I build something to publish it independently vs. contribute to something under the slonik banner? I searched down the README for "community" and "contribut..." and didn't find anything. A I looked at the code for https://github.com/gajus/slonik/blob/main/packages/pg-driver/src/factories/createPgDriverFactory.ts and at least on the surface it looks do-able. To use the custom driver I assume I would use the |
Just that. |
OK I wrote a package to support When I find some more time I will review it, make it public, and publish it to npm. As far as I can tell from searching GitHub it might be the first public independent driver factory for slonik created using I'm not sure the ideal way to test it. Both |
Desired Behavior
Slonik project offers official guidance in docs and/or a bridge/adapter to
@neondatabase/serverless
which, like slonik, is based onpg
and intended to serve as a drop-in replacement.This would enable use of slonik in serverless/edge environments to connect to postgres over HTTP or websockets and take advantage over various performance and scalability benefits in this deployment context.
Motivation
Honestly I think it seems like a good fit and future forward step for Slonik -- it opens the door to more applications, larger community, broader and more varied ecosystem with wider range of expertise.
I wonder if you reach out to the right people at Neon they may even sponsor this :)
Serverless/edge type environments aren't going anywhere. New breed devs are brought up on CloudFlare, Vercel, Netlify and others, plus AWS is going to be a rock for the foreseeable future not to mention Azure + Google. Neon is frequently suggested as the way to go for serverless/edge + postgres.
Neon is an innovator (e.g. branching) and a lot of their developments are open source so they will only influence more in the foreseeable future.
Other popular database libraries for Node / TypeScript already have official adapters for Neon serverless including Drizzle.
If you haven't tried Neon I'd suggest trying their generous free tier.
Implementation
Slonik already has a bridge/adapter for postgres.js which has way more differences and nuances than something based on pg and intended to be drop-in.
The text was updated successfully, but these errors were encountered: