Also what do the error messages look like?
Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
11–20 of 87 posts
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#12Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#13``` const users = await sql` select name, age from users where age > ${ age } ` ``` Do template literals like this in JS work differently than just straight up string interpolation? As a rails dev this set off alarm bells.
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://github.com/porsager/postgres#await-sql---result
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#14Looks good from what I see. How does this compare with slonik? Also what do the error messages look like?
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#15``` const users = await sql` select name, age from users where age > ${ age } ` ``` Do template literals like this in JS work differently than just straight up string interpolation? As a rails dev this set off alarm bells.
Yeah, when a function is called as a "tagged template literal"[1] the function takes control over how the parameters are handled. Postgres.js uses this to replace the value with $1, $2, etc and send over the value as parameters to the database, thereby preventing any chance of SQL injection[2]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://github.com/porsager/postgres#await-sql---res…
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#16Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#17Is raw using binary protocol? (for ex: send\receive UInt8Array Buffer without converting to hex string for bytea column)
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#18Would you consider this production ready ? I rarely if ever use relational databases for my personal projects, but this could be a great fit at work.
Also , anyway to add an orm layer. I use Firebase right now, so I'm use to that vs writing queries.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#19Very cool! Would you consider this production ready ? I rarely if ever use relational databases for my personal projects, but this could be a great fit at work. Also , anyway to add an orm layer. I use Firebase right now, so I'm use to that vs writing queries.
About the ORM layer I wouldn't know, since I much prefer to avoid that at any cost.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#20Hi everyone. A bit more than two years ago I released the first version of Postgres.js. A fully featured PostgreSQL driver for Node.js written as a learning experience out of curiosity and annoyance with the current options. It greatly outperformed the alternatives[1] using pipelining and prepared statements, while providing a much better development experience safe from SQL injections. Since then I've been busy buil…