drizzle-orm is another good JS sql query builder

I'm able to write raw sql queries with the `sql` template literal function

https://orm.drizzle.team/docs/sql

there's also https://kysely.dev/

but personally i handwrite my queries with https://github.com/porsager/postgres for flexibility and performance

most orms use node-pg lib which has shit performance.