3 ms·
Which language is this? let points = 0; const usrs = await sql`select * from usr where country = 'JP'`; for (const usr of usrs) { points += usr.point
by pmontra 3y ago
Which language is this?
let points = 0;
const usrs = await sql`select * from usr where country = 'JP'`;
for (const usr of usrs) {
points += usr.points;
}
I like the approach of not having an ORM to learn.
- surprisetalk 3y agoIt's JS with the wonderful Postgres.js package! [1] https://github.com/porsager/postgres https://github.com/porsager/postgres Here's an example where it really shines: const users = [ { name: 'Murray', age: 68 }, { name: 'Walter', age: 80 }, ]; await sql`insert into users ${ sql(users) }`;
- pmontra 3y agoThanks. This is best ORM I ever saw. Just write SQL. I'd like to have this in Rails and Django and unlearn almost 20 years of their ORMs.