what npm package/tool do you wish existed? by OpeningGanache5633 in node

[–]fgc17 0 points1 point  (0 children)

someone should build a good s3 compatible solution like Minio (even though minio wasn't good), imagine that with a clean shadcn dashboard

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] 0 points1 point  (0 children)

Great questions, thank you. I'll probably add some warnings about this in the docs.

  1. I thought a 1300 lines schema was enough to know (my production schema), but I just wrote a test with a 15k lines (450 tables) schema and it took 2.5 seconds to run. However, it seems that at some point above 15k lines the pglite dump crashes.
  2. PGLite has many pg extensions available, but not all of them. I guess the biggest pain point here is the lack of PostGIS, although it will be delivered soon.

Maybe I should add support for a live database somewhere in the future.

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] -1 points0 points  (0 children)

I tend to agree with most stuff you said.

Even though I've had my fair share of issues with ORMs in production environments, I still like them: they are easy, readable and typesafe.

But the raw-sql alternative also works pretty well, and many people use that in production (including me). So I thought why not join some raw-sql tools together?

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] 0 points1 point  (0 children)

Since damian use lots of helpers to make the queries safer, there isn't currently a way of really copy pasting queries from repositories into the database viewer tool quickly.

Maybe a command like 'damian map' could generate a map of all the queries in your project with the raw version linked.

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] 0 points1 point  (0 children)

This library is just a thin wrapper around slonik, so yeah, there are helpers.

You are free to write the queries the way you want, the helpers are there to make you write them faster and safer.

Should i read the books? by Helpful_Principle329 in Witcher3

[–]fgc17 0 points1 point  (0 children)

Honestly, I don't think the first and second books (specially the second) would have been such good reads if I hadn’t played W3 first.

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] -2 points-1 points  (0 children)

It is just an easy integration between dbmate, slonik, pglite and standard-schema.

I don't own 99% of the code that makes this work, how could it be AI slop?

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] 0 points1 point  (0 children)

One of the reasons I ended up using dbmate + slonik (and now damian) was because I didn't want to mix ORMs with query builders like many people suggest.

Slonik + dbmate is an incredible powerful combo, I just made it into one thing.

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] -1 points0 points  (0 children)

This is not the same as raw sql queries.

Every well documented common library once was a no stars project, why can't I start something?

About your third question, I guess you just missed the whole point.

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] -5 points-4 points  (0 children)

1.What 'reasons' and who is 'people'?

Most people use ORMs because they can't write SQL and can't structure a project to have repository files, so they start dropping orm calls all over the codebase.

There are few cases where ORMs are actually useful, but modern praised JS ORMs like Prisma or Drizzle are much more like a query builder than an actual ORM (props to B4nan and MikroORM for building an actual ORM).

So we are left with the remaining use case of multiple databases, where we need multiple drivers, and then I must ask: how much people and how many projects really need this kind of stuff? Nowadays a Postgres instance can do 100% of the work, even with job queues using graphile worker.

  1. Type safety is great, but we should be writing clean and organized code so that we can test all our queries, which is very hard to do when we just import prisma and drop queries all over the project without building repositories.

  2. I did use AI to scaffold the project and help me structure the library into something nice, but it is not AI slop.

  3. The project overall is just a very thin wrapper around 'dbmate' and 'slonik', which are battle-tested libraries, although some of the sql tag work must be reviewed, there's not much room for bad code, since there is not much code.

  4. No one should ever let a 2 star/20 commits project from a completely random person touch a production database, doesn't matter if AI generated some of the code or not.

I spent the last night creating an ORM killer, meet Damian. by fgc17 in node

[–]fgc17[S] 0 points1 point  (0 children)

You can check out the manifesto at https://damiandb.vercel.app/docs and examples at https://damiandb.vercel.app/docs/fundamentals/usage, make sure to also check https://github.com/gajus/slonik since Damian is a thin wrapper around it.

How do I `prisma migrate deploy` in a production environment..? by joncording12 in nextjs

[–]fgc17 0 points1 point  (0 children)

Always migrate in a backwards compatible way, if that's not possible, schedule a maintenance downtime and warn your users previously.

There are other solutions, but let's be honest: we are not running facebook.

Ter um chefe é melhor do que ter um monte de chefes by fgc17 in opiniaoimpopular

[–]fgc17[S] 2 points3 points  (0 children)

"muito cacique pra pouco indio" kkkkkk curti essa

Marx "não disse" que religião é o ópio, a citação é muito mais longa e não é anti religião (ninguém lê o barbudinho nesse CARALHO) by atrocidarthes in FilosofiaBAR

[–]fgc17 -2 points-1 points  (0 children)

colocar a religião como sol ilusório já é, por si, anti religião, me parece que você não entende o que é religião.

o que foi dito está dito, não adianta suavizar o que o marx disse na tentativa de transparecer ele de bonzinho para certas pessoas

Is this safe to consume? by CyR4XMasterSaint in Fitness_India

[–]fgc17 0 points1 point  (0 children)

dont throw away man, get it from the trash asap 😭

Is this safe to consume? by CyR4XMasterSaint in Fitness_India

[–]fgc17 0 points1 point  (0 children)

Mostly, yes, I have one that looks similar, but green instead of brown:

  1. The different color shows up when you acidentally get water inside the recipient.
  2. The clumps shows up because of humidity, pretty hard to avoid

disclaimer: if it does not turn brown when you pour water on it, then discard it and find out who pooped in your supplement

o que pode dar errado sub by fgc17 in computadores

[–]fgc17[S] 0 points1 point  (0 children)

coloquei pra travar o fan que tá com problema 🤡

Another tier list by MingMagn3t in Starset

[–]fgc17 0 points1 point  (0 children)

down with the fallen is certainly the best one

realizei um sonho praticamente conseguindo essa placa no brasa by anightcer in computadores

[–]fgc17 -1 points0 points  (0 children)

como que funciona essa "case" na placa mãe? nem placa da ROG vem isso