Live data from Hacker News

PostgresJs: PostgreSQL client for Node.js and Deno

github.com

131–140 of 148 posts

Re: PostgresJs: PostgreSQL client for Node.js and Deno

#131
post #125

Have to say, if you like to do bare metal SQL, using the nice features of Postgres, working with this lib is a total Joy! No “fancy” and bleeding abstractions like something like Prisma, not convoluted type annotations like other TS libs, no, just plain SQL statements in the best JavaScript way of doing it. I discovered learning to do Postgres a couple years ago, after getting sick of trying to hack Prisma, tried out…

Was never fond of layers above SQL either. One would have to pry SQL from my cold dead fingers

I love layers above sql because it can make a lot of domain logic nice to model. But dropping down when it it makes sense and finding a rock solid foundation is nice too.

It would be great if postgresjs could underpin Knex and MikroOrm.

Re: PostgresJs: PostgreSQL client for Node.js and Deno

#132

Have to say, if you like to do bare metal SQL, using the nice features of Postgres, working with this lib is a total Joy! No “fancy” and bleeding abstractions like something like Prisma, not convoluted type annotations like other TS libs, no, just plain SQL statements in the best JavaScript way of doing it. I discovered learning to do Postgres a couple years ago, after getting sick of trying to hack Prisma, tried out…

What made you dislike Prismas raw query feature?

Re: PostgresJs: PostgreSQL client for Node.js and Deno

#135

Earlier quoted context omitted.

the list would merit its own dedicated blog post but to highlight a few nice parts, ecto lets me write sql code in elixir. it does not try to wrap it all into objects but I do get schemas. so for instance I can create a schema `Player` which maps to a table "players" I can then get them via ``` from(p in Player) |> where([p], p.id in ^player_ids) |> select([p], p) |> Repo.all() ``` need to join with an association? `…

This is probably great to use, but it also highlights in comparison the beautiful simplicity of SQL. Doing something simple is hard, and SQL is so simple that I think most people find little value to abstractions built on it.

There are different valid ways to produce these queries, some of which might be less composable but simpler: https://hexdocs.pm/ecto/Ecto.Query.html

Re: PostgresJs: PostgreSQL client for Node.js and Deno

#136

Have to say, if you like to do bare metal SQL, using the nice features of Postgres, working with this lib is a total Joy! No “fancy” and bleeding abstractions like something like Prisma, not convoluted type annotations like other TS libs, no, just plain SQL statements in the best JavaScript way of doing it. I discovered learning to do Postgres a couple years ago, after getting sick of trying to hack Prisma, tried out…

Yea, it is a totally fan to work with this code after a responsible developer leaves a company. No types, no annotations, no abstractions, no migrations, just plain SQL.

Re: PostgresJs: PostgreSQL client for Node.js and Deno

#137

B very careful with json and postgressjs, there are strange bugs. Also there are various gotchas on the edges with typescript. AFAIK the code uses a lot of regex and that breaks json in particular.

I've been using postgresjs in production for a while now with jsonb etc... and haven't run into any issues.

What have you seen that's been a problem?

Re: PostgresJs: PostgreSQL client for Node.js and Deno

#138

Have to say, if you like to do bare metal SQL, using the nice features of Postgres, working with this lib is a total Joy! No “fancy” and bleeding abstractions like something like Prisma, not convoluted type annotations like other TS libs, no, just plain SQL statements in the best JavaScript way of doing it. I discovered learning to do Postgres a couple years ago, after getting sick of trying to hack Prisma, tried out…

Yea, it is a totally fan to work with this code after a responsible developer leaves a company. No types, no annotations, no abstractions, no migrations, just plain SQL.

I can't read if you're being snarky or if you are being earnest.

If snarky, is this based on something that actually happened to you? If so, I would love to hear how that actually went about, and what it is you are unable to grasp when things aren't bogged down by complexity?

If earnest, I'm glad more people prefer code that isn't littered with premature abstractions, redundant types, and useless comments expressing what can be more clearly read in the actual code.

Re: PostgresJs: PostgreSQL client for Node.js and Deno

#140
post #104
post #57

Earlier quoted context omitted.

Prisma is great for schema management, but it's migration stuff broke for us and their updateMany implementation is just plain dumb. We just use db push because prisma migrate fucked up in some unknown way that is impossible to recover from. The process in the docs for re-baselining doesn't work, and we're not about to reset our database. The problem with ORMs is always that if something goes wrong you need to unders…

> but it's migration stuff broke for us What do you use for up/down migration if you don't mind sharing?

We use prisma's db push to change schemas. Anything higher level we do with our own patch functions. I think this is how it works in ruby too, or how one place or another did it.

The db push deals with constraints, indexes, types, etc. we do everything else.

Post reply on HN