I tried 8 different Postgres ORMs

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

ความคิดเห็น • 748

  • @cjgj
    @cjgj ปีที่แล้ว +1665

    The real ORM is the friends we made along the way -- Our Real Mates

    • @NexusGamingRadical
      @NexusGamingRadical ปีที่แล้ว +32

      Nice sql comment at the end there. Very explanatory.

    • @peterszarvas94
      @peterszarvas94 ปีที่แล้ว +20

      It's about the vulnerabilities we made along the way

    • @VikashXman
      @VikashXman ปีที่แล้ว +3

      eval(node run test)

    • @Y2Kvids
      @Y2Kvids ปีที่แล้ว +4

      And Tables We Dropped

    • @ZM-dm3jg
      @ZM-dm3jg ปีที่แล้ว +1

      I made friends with ChatGPT along the way

  • @hanifali3396
    @hanifali3396 ปีที่แล้ว +842

    0:20 (S-Q-L), 0:31 (Squeal), 0:52 (Sequel) He pronounced SQL all three different ways so everyone is happy 😂

  • @dbreen12
    @dbreen12 ปีที่แล้ว +303

    The timing of this video is impeccable. Been spending the last few days looking into these ORMs

    • @Showmatic
      @Showmatic ปีที่แล้ว +7

      same, and I'm learning towards drizzle

    • @pomberorajy
      @pomberorajy ปีที่แล้ว

      same x2

    • @cristinel1
      @cristinel1 ปีที่แล้ว

      Same x3

    • @er3n_
      @er3n_ ปีที่แล้ว +5

      just write SQL

    • @LuisSierra42
      @LuisSierra42 ปีที่แล้ว

      Been using sequelize and typeorm recently

  • @tyu3456
    @tyu3456 ปีที่แล้ว +397

    MikroORM should be on this list. Has all the benefits of an ORM, but lets you easily fall back to a Knex-like query builder when needed. And crucially, it's much better maintained than Sequelize or TypeORM

    • @tronikel1434
      @tronikel1434 ปีที่แล้ว +29

      yep, really a shame that mikro orm is not well known, its superb

    • @nifalconi
      @nifalconi ปีที่แล้ว +29

      It’s amazing. Like the best thing ever. The only sad thing is that there’s like one maintainer/creator. The guy is amazing ❤

    • @EulerJr_
      @EulerJr_ ปีที่แล้ว +5

      I agree! And MikroORM works great with MongoDB too.

    • @bedirhancelayir3295
      @bedirhancelayir3295 ปีที่แล้ว +1

      Definetely agree

    • @alexnezhynsky9707
      @alexnezhynsky9707 ปีที่แล้ว +4

      Yes, B4nan is a superhero

  • @CosmeValera
    @CosmeValera 4 หลายเดือนก่อน +12

    1. 1:30 pg
    2. 3:24 postgres.js
    3. 4:11 knex
    4. 5:20 kysely
    5. 6:13 sequelize
    6. 7:11 typeorm
    7. 7:55 prisma
    8. 8:51 drizzle-orm

  • @MateHomolya
    @MateHomolya ปีที่แล้ว +20

    This video is so well timed, I was literally transitioning from Firestore to Postgres database with a project just now.

    • @moyin1038
      @moyin1038 ปีที่แล้ว

      Bro same 😂

    • @tadiwapfachi
      @tadiwapfachi 3 หลายเดือนก่อน +1

      what if i tell you that he has all our search data. its not by coincidence

  • @petrsehnal7990
    @petrsehnal7990 ปีที่แล้ว +44

    Breaking world record for most useful information per second of video each time you post someting. Respect, Sir!

  • @elitalpa
    @elitalpa 11 หลายเดือนก่อน +58

    I watched this video again to remember the differences between certain libraries and ORMs so I made a list:
    1. 1:30 pg
    2. 3:24 postgres.js
    3. 4:11 knex
    4. 5:20 kysely
    5. 6:13 sequelize
    6. 7:11 typeorm
    7. 7:55 prisma
    8. 8:51 drizzle-orm
    May this be helpful to someone else as well.

    • @heegj
      @heegj 10 หลายเดือนก่อน +3

      +1, need those youtube chapters

    • @eved.a
      @eved.a 5 หลายเดือนก่อน +1

      exactly what I was looking for, thx

    • @MelroyvandenBerg
      @MelroyvandenBerg 3 หลายเดือนก่อน +1

      pg-native should be faster in theory.

  • @Mixesha001
    @Mixesha001 ปีที่แล้ว +26

    MikroORM is awesome and deserve more love. It does what all these ORM do and is battle tested, fast, and well maintained.

    • @nicky-hajal
      @nicky-hajal ปีที่แล้ว +1

      I have been looking into MikroORM and confused why it doesn't get much attention and review by the community.

  • @ileies
    @ileies ปีที่แล้ว +5

    Hours of research without real outcome and then one video and I know what to choose.
    You're my favorite TH-camr for a reason. 😋

  • @ruaidhrilumsden
    @ruaidhrilumsden ปีที่แล้ว +63

    I can understand the Web dev community generally straying away from writing raw SQL, but as an analyst moving to Javascript from having written primarily SQL for the past 6yrs it can be a bit frustrating that the whole ecosystem is based on trying not to do what I'm most comfortable doing - it feels like my mad SQL skills are being somewhat nullified!
    Great vid Jeff, I haven't seen postgres js before - I will defo be using it.

    • @ahmad-murery
      @ahmad-murery ปีที่แล้ว +18

      I'm not an analyst but I used to do a lot of raw sql and still find it easier to me than using ORMs especially for complex queries where (sub-queries, CTE, aggregation with OVER clause and maybe make use of sql variables, procedures, functions and temp tables) is needed.
      Simply I'm more comfortable with SQL and it's easier for my to translate my ideas directly into what the Database can understand natively.
      I feel you

    • @igalklebanov921
      @igalklebanov921 ปีที่แล้ว +7

      You should give Kysely a try. We focus on 1:1* and have CTEs, window functions, etc. But also type-safety and autocompletion.

    • @ahmad-murery
      @ahmad-murery ปีที่แล้ว +1

      @@igalklebanov921 Looks nice and intuitive for one with average sql background,
      I'll give it a try once I have a chance.
      Thanks

    • @matthewrutter8343
      @matthewrutter8343 ปีที่แล้ว +12

      Programmers hate being embarrassed. That's why they go to orms. It allows them to ignore the holes in their skill set while being able to goldplate over things for no reason to feel important. 100% ego.

    • @ahmad-murery
      @ahmad-murery ปีที่แล้ว +6

      @@matthewrutter8343 Maybe you have a point regarding the skill holes, but maybe it's the other way around as I myself find it very hard to memorize ORM methods, in the same time I can easily do what I want using raw SQL,
      this caused me some embarrassment in a project I was a member of, so to the others this was a hole in my skills.
      I'm a programmer with bad memory😎

  • @clingyking2774
    @clingyking2774 ปีที่แล้ว +13

    This guy has the most useful content, without wasting any time.

  • @bugs389
    @bugs389 ปีที่แล้ว +3

    Great video. I'd enjoy an overview of ORMs in other languages too, such as SqlAlchemy, Entity Framework, etc.

  • @tenthlegionstudios1343
    @tenthlegionstudios1343 ปีที่แล้ว +6

    Snuck in a video in response to the codedam issues with Prisma. Like your approach here - mentioning all pros and cons, going over each option. Great work!

  • @chrisalexthomas
    @chrisalexthomas ปีที่แล้ว +2

    lol, the ending was perfect :D well done Mr Fireship

    • @shoopddawhooped
      @shoopddawhooped 7 หลายเดือนก่อน

      drumroll to commercials, well played mastery.

  • @angmathew4377
    @angmathew4377 ปีที่แล้ว

    I was less inclined to watch this earlier but, hey man, you rocks. Lots of clear and concise stuff in the video.

  • @Kingromstar
    @Kingromstar ปีที่แล้ว +87

    The two reasons to use an ORM such as Prisma and TypeORM is so you get types for your code and so you don't have to update every single query when you update a column to a table.

    • @furycorp
      @furycorp ปีที่แล้ว +25

      In my experience with anything beyond a todo list both of those fall apart and have a lot of oversights that are a pain in the ass.

    • @Slashx92
      @Slashx92 ปีที่แล้ว +5

      @@furycorp I agree. It's more of a "pick your poison" issue with orms vs querybuilders vs sql clients
      although I would argue the last one is the less scaleable by far

    • @ooogabooga5111
      @ooogabooga5111 ปีที่แล้ว +11

      prisma is okey for hobby simple projects but will fall out of hands when it gets complex with logic. Also there is no native joins.

    • @ooogabooga5111
      @ooogabooga5111 ปีที่แล้ว +4

      prisma won't scale up

    • @clingyking2774
      @clingyking2774 ปีที่แล้ว +4

      TypeORM is the only ORM that actually makes sense because Java uses a similar pattern and Java is Holy.

  • @alex_chugaev
    @alex_chugaev 3 หลายเดือนก่อน

    I’m Angular+NestJS developer. For me TypeORM works perfectly. It allows me to model a pretty complex schema, run migrations and provides me with 3 levels of abstraction: high-level Repository pattern, mid-level QueryBuilder and low level raw SQL query. Does the job perfectly so far.

  • @agammore
    @agammore ปีที่แล้ว

    Awesome video! And amazing that you're giving a free consultation, people should flock for that!

  •  ปีที่แล้ว +4

    I'm currently using pg + postrgrator for migrations + sql-ts to generate types from DB. Works like charm. Type checking of sql is done by my IDE (intellij) anyway.

  • @fr1tzw4lt3r
    @fr1tzw4lt3r ปีที่แล้ว +2

    For Postgres PgTyped is an awesome project. You write bare SQL and it typeschecks agains the databse and generates query methods that are comletely typesafe, even with complex joins or recursive queries.

    • @simonboddy7415
      @simonboddy7415 ปีที่แล้ว +1

      This is how god intended us to use databases. Its so simple, so powerful, such superior performance. It's just amazing how long this approach took to surface, and how little known it is.

    • @EDemircivi
      @EDemircivi ปีที่แล้ว

      damn. I just learned about PgTyped, thanks to this comment. it is a gods gift.

  • @jntaca
    @jntaca ปีที่แล้ว +2

    Have a lot of projects in production. Some of our codebase accesses MySql, PG and SQLite, so Knex is our definitive tool. Also it handles transactions like a charm.

  • @TechDiffuse
    @TechDiffuse ปีที่แล้ว

    Awesome job Jeff. Thanks for creating such a concise and entertaining video.

  • @MAC0071234
    @MAC0071234 ปีที่แล้ว +14

    I was gonna try typeORM a year ago, but found many articles warning not to use it because it wasn't maintained and had lot of issues. I have tried sequelize, it's great but it needs a lot of setup and it doesn't fully support typescript. I was gonna try Prisma recently, but then someone said that it had issues too with the Rust engine and that there being too much "overhead" and that it was bad for joins. Not to mention that your code would be third party dependant, as Jeff stated.
    Would really like a video about the underlying structure and flow in ORMs and their tradeoffs, not just about syntax. Appreciate your work :)

    • @WolfrostWasTaken
      @WolfrostWasTaken ปีที่แล้ว +2

      Prisma only gives issues with the Rust backend if you plan on deploying it on a lambda function or using serverless in general. And you can still solve all of these issues, it just requires more work and it's not "out of the box".

    • @buzz1ebee
      @buzz1ebee ปีที่แล้ว

      Typeorm is actively maintained at the moment. There was a year or so where things were stable, but since v0.3 it's been fairly regularly updated.

    • @h3nry_t122
      @h3nry_t122 ปีที่แล้ว +3

      the only issue with Prisma is when using server less. thats the only problem. if you're not using server less then you're perfectly fine.

    • @MelroyvandenBerg
      @MelroyvandenBerg 3 หลายเดือนก่อน

      I'm back to just SQL..

  • @alejandrombc
    @alejandrombc ปีที่แล้ว +7

    A video about correct ways to hande migrations for multiple teams would be very handy!

    • @rajeevkl6966
      @rajeevkl6966 ปีที่แล้ว +3

      use rails/laravel/django
      everyone can do their own migrations & it rarely conflicts

  • @cesarayalavargas3623
    @cesarayalavargas3623 ปีที่แล้ว +1

    If you need advanced postgresql like views, materialized views, PostGIS
    I would recommend to use pg, choosing the right ORM depends on your project requirements so you must study first what features you will need and do research for the best of your needs

  • @stevenhe3462
    @stevenhe3462 ปีที่แล้ว +25

    Rails, Django, Laravel, and Phoenix developers:
    Yay!! We don't have to deal with this JavaScript madness.

    • @sushantjain3360
      @sushantjain3360 8 หลายเดือนก่อน +2

      then they face problems in scaling

    • @akayogeshsirsat
      @akayogeshsirsat 7 หลายเดือนก่อน

      @@sushantjain3360 not every project is going to be instagram

    • @inf008shorts
      @inf008shorts 4 หลายเดือนก่อน +1

      ​@@sushantjain3360 Not something for Phoenix (Elixir). Scalability in the blood of language.

    • @hachi-R
      @hachi-R 3 หลายเดือนก่อน

      @@sushantjain3360
      if you can't scale with phoenix, you won't scale with anything else

  • @rushtothemax76
    @rushtothemax76 ปีที่แล้ว +12

    in my opinion they are all good options and I would just look at what saves me the most time and works good with typescript.
    So I usually go with prisma :)
    Having said that if you are just a beginner you might wanna go with the orm's that you have to use raw SQL so you know how everything works.

    • @ooogabooga5111
      @ooogabooga5111 ปีที่แล้ว

      prisma won't scale up

    • @breakinggood-r2v
      @breakinggood-r2v ปีที่แล้ว

      @@ooogabooga5111 hey what about drizzle

    • @IDOLIKIofficial
      @IDOLIKIofficial ปีที่แล้ว +2

      @@ooogabooga5111 How is that so? I use prisma on applications with 3M MAU. Loads pretty fast for everyone

  • @FalioV
    @FalioV ปีที่แล้ว

    The first 20 seconds are the most accurate stuff ever. I start with MSSQL and then switched to MongoDB and I was like "Yeah this is the best, I will never go back to sql" yeah but ... years later I'm now working only with MySql and I like it way more then mongo ... Currently using sequelize and the work is so easy to do.

  • @jordanebelanger3918
    @jordanebelanger3918 ปีที่แล้ว +2

    When using pg, run your migrations and then use schemats to dynamically generate typescript types from the db itself for great type safety.

  • @mileselam641
    @mileselam641 ปีที่แล้ว +24

    Best ORM is either no ORM or one that auto-generates the access layer based on the structure and types you've already defined in the database. Anything in between is just excess heat and trauma.

  • @AtiqSamtia
    @AtiqSamtia ปีที่แล้ว +4

    Nice to have Eloquent ORM baked right in the Laravel Framework providing all of these and more features out of the box.

  • @eliya.c
    @eliya.c ปีที่แล้ว +9

    The issues that you've mentioned using raw SQL queries can be solved by using SafeQL. Zero abstractions, zero runtime code.

    • @RasmusSchultz
      @RasmusSchultz ปีที่แล้ว +2

      Yes, please. The best ORM is no ORM 🙂👍

    • @MelroyvandenBerg
      @MelroyvandenBerg 3 หลายเดือนก่อน

      @@RasmusSchultz Agreed

    • @MelroyvandenBerg
      @MelroyvandenBerg 3 หลายเดือนก่อน

      No SafeQL for MariaDB? bleh

  • @tj_mora
    @tj_mora ปีที่แล้ว +6

    I'm developing a webapp and used MongoDB Atlas for it and Mongoose makes my life easier. But then I realized I'm better off with a relational database because there's a lot of relational data on my backend. I chose Postgres and studied Sequalize and I like how Sequalize is very similar to Mongoose. However, I also came to the conclusion that Supabase will make my project easier to maintain. So I signed for Supabase only to notice that there's no ORM for it. Everything is interfaced through the Supabase API. To manipulate data before they get stored in the database, you would need to write database functions, edge functions and triggers. Creating schemas, constraints, indexes, and RLS policies need to be written in SQL (though some of these can be done through the UI). Supabase was supposed to simplify a lot of stuff, but I'm finding it time-consuming to set up a lot of things. Why can't it be as easy a Sequalize?

    • @foreach1
      @foreach1 ปีที่แล้ว +3

      Supabase is a normal Postgress db. You can use any orm you want with it

    • @tj_mora
      @tj_mora ปีที่แล้ว +1

      @@foreach1 You can only use these ORMs if you have a server-side middle layer between the client and supabase. But obviously if you do that, then why not just use a self-hosted Postgres cluster? We use Supabase for the ability to remove the server-side middle layer. So it's just Supabase and client-side. And you can't really use any ORM for any of these sides. I actually like that approach and I can see it being easier to maintain in the long run. But damn the set up is hard. Migration is hard. Supabase docs are garbage. And Supabase tutorials on TH-cam doesn't really cover the very specific database needs/designs that I have. Though I'm pretty sure if I study this more for several more days I can finally get the hang of it.

  • @isaiahkahler5429
    @isaiahkahler5429 ปีที่แล้ว +7

    I also like what Supabase did with their new CLI, although not exactly an ORM. It generates typescript types for you based on the tables that you make inside of the dashboard, which you use with the SDK to make safe queries. One of the easiest ways to get a great DX with SQL in my opinion.

  • @rounaksen1683
    @rounaksen1683 ปีที่แล้ว +2

    Man That Ending !!! Super

  • @tdug1991
    @tdug1991 ปีที่แล้ว +3

    Out of every ORM I've ever used, my favorite experience was using Ecto [Elixir programming language]. Note that this language, and also ORM, have a pretty steep learning curve, so it can seem obtuse at first. Other ORMs I've used include Django, SQL Alchemy, ActiveRecord, and a couple JavaScript ones.

    • @c0ldfury
      @c0ldfury ปีที่แล้ว

      Quarkus reactive is pretty sweet. But for sheer performance Go and Elixir libraries seem unbeatable.

    • @nested9301
      @nested9301 7 หลายเดือนก่อน

      ok nerd we know that u use 'elixir'

  • @jugurtha292
    @jugurtha292 ปีที่แล้ว +110

    I prefer writing raw sql queries. Orm tend to make simple things simpler and hard things harder

    • @igalklebanov921
      @igalklebanov921 ปีที่แล้ว +1

      You should try Kysely. Its all about trying to be 1:1* to compiled SQL (WYSIWYG design principle) and aims at supporting advanced functionality ORMs just don't bother going into or can't.

    • @lechi_2002
      @lechi_2002 ปีที่แล้ว +17

      I agree with you. Also debugging raw queries is much easier as you copy the sql string and execute it manually.

    • @MinibossMakaque
      @MinibossMakaque ปีที่แล้ว +23

      Absolutely. Plain SQL with prepared statements all the way. ORMs solve one problem while making a giant headache of everything else, other than maybe migrations. I don't know why the most widely adopted approach to a vulnerability was to abstract away the entire language.

    • @ba8e
      @ba8e ปีที่แล้ว +8

      @@MinibossMakaque I will never fucking understand the insanity of ORM. Literally makes everything worse, a useless abstraction.

    • @LuisSierra42
      @LuisSierra42 ปีที่แล้ว

      Except when you have tons and tons of complex queries and that sometimes occupy and entire file

  • @Nyasha_Nziboi
    @Nyasha_Nziboi ปีที่แล้ว +1

    Thank you so much for this was struggling to choose an ORM to use till now

  • @john_smith281
    @john_smith281 ปีที่แล้ว +12

    Using intellij sql intellisense in the code is way better than every orm can ever been.

  • @changwufei5
    @changwufei5 ปีที่แล้ว

    sequelize has been my go to for small project for about 5 years.

  • @vorandrew
    @vorandrew ปีที่แล้ว +1

    Absolutely love intro!!!!

  • @yash1152
    @yash1152 ปีที่แล้ว

    0:38 using libraries & ORMs to access SQL to:
    * get IDE language server completions
    * migrations
    * connect to db
    * handle security
    * madelling relationships in data

  • @VGDGF
    @VGDGF ปีที่แล้ว +24

    After experience with most of orms, Objection has the best developer experience with great performance

    • @igalklebanov921
      @igalklebanov921 ปีที่แล้ว +3

      Have you tried Kysely? koskimas is the author behind both of them. :)

  •  ปีที่แล้ว +2

    Love the ending :)

  • @randsonalves5978
    @randsonalves5978 ปีที่แล้ว

    this is gonna be very useful for my typescript api, living and leaning...

  • @letstalkdev
    @letstalkdev ปีที่แล้ว

    First 20 seconds of this video, the story of my life! :D
    Great job making these videos fun, so we can all have a bit of a laugh and not take ourselves too seriously, especially when it comes to the technology stack used.
    I've also made a video on this topic on my channel recently.

  • @blambillotte
    @blambillotte ปีที่แล้ว +1

    “joist-ts” is an awesome option for graphql + Postgres - has dataloader built in so any graph queries are N+1 safe. Reminds me a lot of ActiveRecord for Rails

  • @KevinVandyTech
    @KevinVandyTech ปีที่แล้ว +1

    Joist is also interesting. It really focusses on great Typescript and lazy loading support while also automatically solving n+1 problems.

  • @carlotadias9335
    @carlotadias9335 5 หลายเดือนก่อน

    Love the memes you put in the beginning ! 😂😂😂😂

  • @BellCube
    @BellCube ปีที่แล้ว +1

    Alright, now just to figure out how to shove a frickin' matress into my backend so my project won't fail. Thanks for the advice!

  • @destroyer-tz2mk
    @destroyer-tz2mk ปีที่แล้ว +47

    Hey there fireship, sequelize doesn't support typescript but there's a new sequelize-typescript that does, it would've been nice if you did that.

    • @Ke5o
      @Ke5o ปีที่แล้ว +9

      Sequelize does actually support Typescript if you look through the docs, but it's annoying to set up and mostly scuffed in my experience. It's not an easy drop in.

    • @daleryanaldover6545
      @daleryanaldover6545 ปีที่แล้ว +8

      @@Ke5o it was so scuffed that they need to re-write most of the features when releasing v7

  • @asimami
    @asimami ปีที่แล้ว

    I love the "Data Suppository". :D

  • @TheSimslash
    @TheSimslash 3 หลายเดือนก่อน

    Thank you for the video, it's very helpful

  • @EnriqueDominguezProfile
    @EnriqueDominguezProfile ปีที่แล้ว +1

    0:30 he said it properly. Squeal. ❤

  • @unknownChungus
    @unknownChungus ปีที่แล้ว +7

    Typeorm doesn't give full type safety. Even when you pass selective columns in select option for find method, the return type will still be array of entity and not array of those selective columns.

  • @cm3462
    @cm3462 ปีที่แล้ว

    Thank you man. This is really helpful.

  • @demolazer
    @demolazer หลายเดือนก่อน

    One of my favourite articles is the one where the guy compares ORMs to war crimes in Vietnam

  • @miko999x
    @miko999x ปีที่แล้ว

    that clifhanger man, still waiting for the final result :D :D lol

  • @dexterantonio3070
    @dexterantonio3070 ปีที่แล้ว +3

    I worked at a company that did everything with raw sql. We had a about 100 tables and it worked great. This is not a typical apparently.

    • @igalklebanov921
      @igalklebanov921 ปีที่แล้ว +1

      Until you need to do some things dynamically, conditionally or repetitively, and end up maintaining your own query builder. Just use a query builder. :)

    • @dexterantonio3070
      @dexterantonio3070 ปีที่แล้ว +1

      @@igalklebanov921 I agree with that. I had some code that involved string concatenations to form an and string for an internal data science application. I began using a query builder right before I left to replace that annoying and unsafe code.

    • @aurelianspodarec2629
      @aurelianspodarec2629 ปีที่แล้ว

      @@igalklebanov921 NextJS 13 exists

  • @megaxlrful
    @megaxlrful ปีที่แล้ว

    At my dayjob the application teams write raw SQL queries because they can't replace the ancient ORM that came with the framework. Some developer wrote an abstraction library over the database connector that is actually quite nice. You construct a Query object. For example new GetUserById(id); And then do $q->result($db); which yields you the User object you were looking for. Or null.

  • @sarmadrafique426
    @sarmadrafique426 ปีที่แล้ว +8

    Drizzle for the next Project.

  • @ekoprasetyo3999
    @ekoprasetyo3999 ปีที่แล้ว

    Been using sequelize, and typeorm and typeorm is the most comfortable to me

  • @iambor1393
    @iambor1393 ปีที่แล้ว +4

    Trust me, you don't want to bother with sequelize if you're using typescript. It just causes so many weird bugs, is not documented as well as it looks at first glance (many options objects are not specified in the api documentation, at least when i last used it), and forget it if you want to write a complicated query.

    • @tristan7668
      @tristan7668 ปีที่แล้ว

      But TypeORM has a lot of bugs, Prisma is not a good choice for complex app, now we have only MikroORM (which some programmers recommend as a great choice), but I don't see large companies in real life using this ORM. And finally, we have query builders like knex or database drivers to write raw SQL queries.

    • @igalklebanov921
      @igalklebanov921 ปีที่แล้ว

      @@tristan7668 You should try Kysely. It's inspired by Knex, but is type-safe first, immutable, predictable, extensible, and probably more expressive at this point.

  • @Bobobratwurscht
    @Bobobratwurscht ปีที่แล้ว +1

    I personally love supabase‘s approach best - you have a GUI to create and update tables or columns

  • @mrgalaxy396
    @mrgalaxy396 ปีที่แล้ว

    That snoop dogg line was absolute gold.

  • @DavidThorpe
    @DavidThorpe ปีที่แล้ว

    I can just tell you are a boyscast listener by some of your phrases and I love it.

  • @hi_im_julian_kirsch
    @hi_im_julian_kirsch ปีที่แล้ว +2

    Well, with Rust and SQLx' Macros you'll get that sweet love from the IDE as well.
    This amazing library allows your IDE to tell you at edit-time, that your SQL either doesn't match the DB schema or your DTO don't match what you're requesting (i.e. type wise).
    And I think that's beautiful

    • @jofla
      @jofla ปีที่แล้ว

      I don't see how is it different than kysely. also check zio-sql

  • @omomer3506
    @omomer3506 ปีที่แล้ว

    Lool man really knows his audience... also was that knex huge security problem patched

  • @mieszkogulinski168
    @mieszkogulinski168 10 หลายเดือนก่อน

    Prisma internally has large overhead because of all these abstraction layers, a regular SELECT query took over 100 ms while an identical query in TypeORM took 10 ms or so

  • @abidsuhail3236
    @abidsuhail3236 4 หลายเดือนก่อน +1

    I found typeorm best, as its provides class based type safety insertion also it has query builder options

  • @henninghoefer
    @henninghoefer ปีที่แล้ว +20

    After 15 years of backend development (on the JVM though), I'll take a query builder over an ORM every time.
    Also: Migrations "down" are usually not worth your time (how to roll back a dropped column or table anyway?)

    • @F38U
      @F38U ปีที่แล้ว

      Eloquent is not that bad tbf

    • @IvanRandomDude
      @IvanRandomDude ปีที่แล้ว +3

      Same. I used Spring Data JPA back in the day until I discovered jOOq.

  • @fallout__boy1130
    @fallout__boy1130 ปีที่แล้ว +14

    Prisma has a very good documentation and developer experience. I recommend it over the others. It is very easy to setup and to use.

    • @LuisSierra42
      @LuisSierra42 ปีที่แล้ว

      It looks pretty interesting

    • @md.redwanhossain6288
      @md.redwanhossain6288 ปีที่แล้ว

      It has no sql joins. Horrible

    • @fallout__boy1130
      @fallout__boy1130 ปีที่แล้ว

      @@md.redwanhossain6288 of course it has support for joins. Rtfm.

    • @chess4964
      @chess4964 ปีที่แล้ว +1

      prisma so slow

  • @carloss3028
    @carloss3028 ปีที่แล้ว +3

    Long live typesafe query builders (aka Kysley and Drizzle ORM)

    • @SogMosee
      @SogMosee ปีที่แล้ว

      yassssssssss

  • @ReinPetersen
    @ReinPetersen ปีที่แล้ว +4

    Hi! I just wanted to add another perspective regarding ORMs. My experience is that they should be considered anti-pattern and I can outline the reasons why:
    1. they won't excuse developers from having to understand good database design and proper querying and, most often, introduce N+1 problem through that naivete
    2. they encourage direct table access with what amounts to adhoc SQL which ties the hands of database developers when the need arises to reorganize data for scale and performance
    3. most relational databases offer things like functions, stored-procs and prepared statements which parameterize queries to solve things like:
    a. combating sql injection
    b. providing an access layer tier above base tables which:
    i. provides API-like access and
    ii. grants the freedom to re-org base tables as needed
    iii. simplified access-level authorization
    Those are the main points (there are others). Whether an ORM is used or not, there is no escape from getting to know your serialization (storage) layer well. You should be using functions or stored-procs as access points to your database regardless. Which then begs the question, why do you even need an ORM?

  • @Danielo515
    @Danielo515 ปีที่แล้ว

    There is nothing nicer than having someone with your same mindset that has already made the homework in the topics you're interested at. Great

  • @razdingz
    @razdingz ปีที่แล้ว +2

    bests one mentioned at 9:45 ~ saved you some time !

  • @biplabsharma5344
    @biplabsharma5344 6 หลายเดือนก่อน

    1:31 First 🥇 PG, Which is
    OG,
    🔝 G
    &
    Dogg
    👑

  • @mahadevovnl
    @mahadevovnl ปีที่แล้ว +1

    I kinda prefer Knex because it gives me control and everything still looks and feels like SQL. Very transparent in its use. No need to figure out how joins work in an ORM or if it does expensive sub-queries. I'm responsible for optimizing it, and... ChatGPT is also familiar with it.

    • @igalklebanov921
      @igalklebanov921 ปีที่แล้ว

      You should try Kysely. It's inspired by Knex, but is type-safe first, immutable, predictable, extensible, and probably more expressive at this point.

  • @AbderrahmanFodili
    @AbderrahmanFodili ปีที่แล้ว +5

    being a laravel developer feels like a ghoast or a stranger when you watch these videos

  • @RaphaelFellowes
    @RaphaelFellowes ปีที่แล้ว +2

    Enjoying using Prisma along with Redwood JS at the moment, but the lack of support for PostGIS and spatial types is a bit of a drawback at the moment. Hopefully that support comes soon.

  • @mjdryden
    @mjdryden ปีที่แล้ว +8

    ORMs are one of those things that aren't worth the trouble in the long run.
    They can be nice in a quick prototype, but for an app that lives for at least a few years, you'll inevitably start bumping into performance issues or weird ORM behaviour that costs a lot of time to resolve.
    The first time I encountered an ORM I thought it was magic, but after 15+ years in the business, I no longer find them worth the trouble. Writing raw SQL isn't that hard and as long as you use parameterized statements, much less likely to bite you in the end.
    Save your future self the headache and start with a low level library.

  • @Marcos-zx6ey
    @Marcos-zx6ey ปีที่แล้ว

    When the nextjs 13 course is ready, please add it to udemy too

  • @IbrahimKwakuDuah
    @IbrahimKwakuDuah ปีที่แล้ว

    Entity framework + LINQ, saves you a ton

  • @AndreasBeder
    @AndreasBeder ปีที่แล้ว +3

    I am quite happy with Prisma. They did an amazing job.

    • @neutralitat2570
      @neutralitat2570 ปีที่แล้ว

      Prisma is awesome while you’re not using geometry types 😢 also migrations is still a bit vague

  • @saadabbasi2063
    @saadabbasi2063 ปีที่แล้ว

    Jeff And Ozzyman are my most favourite Australians ❤️

  • @abdulkaderjeelani
    @abdulkaderjeelani ปีที่แล้ว +2

    Prisma for migrations (ddl), Kyseley for interactions (dml)

  • @mhadi-dev
    @mhadi-dev ปีที่แล้ว

    I made a similar research a while ago, I ended up using Prisma, it's a grate tool, great CLI, Fantastic Types if the DB is structured well, but I think you lose some performance specially when you do joins. I was thinking of using Prisma only for TS and migrations. and for complex queries, I might using raw SQL.
    I also faced an issue learning the Prisma schema file, but I used another way to evade learning new markup language. so first I write my sql changes in the DB, run "prisma db pull" , then drop/delete db changes, then run "prisma migrate dev"

    • @KellenBricks
      @KellenBricks ปีที่แล้ว

      i use prisma for migrations only and write raw sql for all the queries. pgtyped helped me to type all the queries automatically. highly recommend using this setup.

  • @TheBadFred
    @TheBadFred ปีที่แล้ว

    Is the one and only .... that works for you best !

  • @kerodfresenbetgebremedhin1881
    @kerodfresenbetgebremedhin1881 ปีที่แล้ว +4

    slonik sees no love, I see how it is

    • @beyondfireship
      @beyondfireship  ปีที่แล้ว +1

      Trying it out now, disappointed i overlooked it

  • @Ontropy
    @Ontropy 7 หลายเดือนก่อน

    the first is point is too true, i learnt mysql in school, jumped ship to nosql dbs in college, realised yesterday sql was the solution all along, watching this vid today 🤣🤣

  • @talpcan
    @talpcan ปีที่แล้ว

    I have been using prisma since 1 year and I must say, I am very happy with it. I am using it with NestJS. The code completion and IntelliSense is just perfect. I always get the error before you run it. I highly recommend it.

  • @diegozarate8088
    @diegozarate8088 ปีที่แล้ว +5

    I don’t recommend using typeorm, as queries get complex doesn’t handle relations well and we have had some issues with the heap memory in production.

    • @lexNwimue
      @lexNwimue ปีที่แล้ว

      Which ones would you recommend and in what order?

  • @sibabratswain4557
    @sibabratswain4557 ปีที่แล้ว

    I worked extensively in one of the ORM that’s Eloquent which Laravel uses which is a PHP framework

  • @TheHTMLCode
    @TheHTMLCode ปีที่แล้ว

    I really wish you mentioned joist, it’s TS backed and has facebooks data loader baked in at its core, allowing you to bundle similar queries together each event loop tick to reduce amount of queries you make to the db!

  • @sylvance_theone
    @sylvance_theone ปีที่แล้ว +1

    kysely and drizzle are great.

  • @WolfPhoenix0
    @WolfPhoenix0 ปีที่แล้ว

    I'm convinced this is the kind of stuff Fireship does for fun when he's bored.

  • @android_paranoid
    @android_paranoid ปีที่แล้ว

    Now you owe us a dedicated MikroORM video.

  • @charlesbcraig
    @charlesbcraig ปีที่แล้ว +2

    Been playing with Prima and GORM (Go). The amount of time I’ve spent setting them up and tweaking them instead of just working on my MVP with the few CRUD statements I actually need is…not great. I guess I like the idea cause for some reason I think I need to be able to change my database on a whim.

  • @v1Broadcaster
    @v1Broadcaster ปีที่แล้ว +3

    “export default async function” sounds alot like “public static void” tbh 2:57