-
Notifications
You must be signed in to change notification settings - Fork 11
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
switch to Postgres.js? #309
Comments
Is the public domain license an issue? |
oooooh, I think we might even want to look at https://github.com/electric-sql/pglite 👀 (once parametrised queries are supported) |
I think these are parallel activities though, as you wouldn’t necessarily use pglite in production |
While it is possible to provide support for multiple drivers. It comes with quite some maintenance overhead. Especially for Postgres as it does not support some required scenarios on its network protocol. For The main feature to consider is streaming. As for the current implementation there is bi-direction streaming (in, out). These two implementations both hijack the underlying tcp connection and cannot be beaten by any other implementation. Unless they implement a more efficient tcp implementation then nodejs currently provides. Especially when looking at the performance the current implementation can reach vs using the driver alone. const dataset = new Array(1 << 8).fill('').map((_, i) => [i, i + ''])
// 256rows (231.8066999912262ms)
await cds.tx(async tx => {
await tx.run(`INSERT INTO ${Books.name.replace(/\./g, '_')} (ID, title) values ($1,$2)`, dataset)
})
const entries = dataset.map(r => ({ ID: r[0], title: r[1] }))
// 256rows (24.753600001335144ms)
await INSERT(entries).into(Books) |
Postgres.js claims to be the fastest postgres client. See benchmarks.
Should we switch?
The text was updated successfully, but these errors were encountered: