This Trick Makes My Favorite Database Tool Even Better

Поделиться
HTML-код
  • Опубликовано: 3 авг 2023
  • I discovered that you can actually write DrizzleORM queries much like Prisma if you declare relations. I find this super nice because it makes trying out another ORM that you might like very easy.
    My Next.js SaaS: splitter.gg
    My Discord: / discord
    My GitHub: github.com/joschan21
  • НаукаНаука

Комментарии • 88

  • @JEM_GG
    @JEM_GG Год назад

    So glad you showed this! Just happened to be writing a project in this stack ❤

  • @pablogtzgileta
    @pablogtzgileta Год назад +3

    Great content as always. It would be awesome if you could do a video creating a complete application using Drizzle for the database

  • @poocham
    @poocham 11 месяцев назад +3

    Hello Josh! I really love all your content revolving around Drizzle ORM! Do you have a video/walkthrough which utilizes Drizzle instead of Prisma, planned in the future? Keep up the great work 😊

  • @jonatthu
    @jonatthu Год назад

    What is funny is that I just started using drizzle and I discovered this before you mate! :p maybe I should start my own youtube channel haha.
    Keep up the good work, btw I used both prisma and drizzle and raw queries with drizzle where I have to optimize.
    I generate the drizzle schema out of the generated database from prisma, and it's relationships...
    Then I can use drizzle or prisma wherever I want or both.

  • @noext7001
    @noext7001 Год назад +41

    the issue with drizzle is many to many relation the syntax is pure garbage

    • @jjrise
      @jjrise Год назад +3

      This is exactly why I haven’t made the switch

    • @sahilaggarwal2004
      @sahilaggarwal2004 Год назад +3

      They will probably fix this too, they are just aiming to kill Prisma completely

    • @jjrise
      @jjrise Год назад +1

      For sure - fingers crossed. I think relations in general confuse me with Drizzle though, not just many to many.

    • @DevvOscar
      @DevvOscar Год назад +1

      I had this yesterday. I’m going to switch back. This is not some edge case but can occur many times. Even with left joins the returned data does not resemble what I expect.

    • @TehRoflizer
      @TehRoflizer 11 месяцев назад +4

      Do you mean having to explicitly handle junction tables? As the point of Drizzle is to be close to raw SQL but with type safety, that is not surprising IMO. Junction tables are a very fundamental concept of relational databases.

  • @Ga2-20
    @Ga2-20 Год назад

    Is it possible to create completely new table programatically using Drizzle?
    Is it possible to change already existing table column without loosing your current column data?

  • @HenryOsim
    @HenryOsim 11 месяцев назад

    How can I setup drizzle with next-auth, There doesn’t seem to be an adapter yet?

  • @sandrinjoy
    @sandrinjoy Год назад +1

    in the case of foriegn key issues, i usually create views in planetscale for my purposes. so i can query from that view which basically some joins on tables with keys .

  • @JEM_GG
    @JEM_GG Год назад

    Have you used server actions on production yet? I just started using them on a new project and its hard not to want to use them for everything 😂

  • @blueghost512
    @blueghost512 5 месяцев назад +1

    If the only winning factor for Drizzle over Prisma is performance, then it's a matter of time till Prisma catch-up. And Prisma actually did it.

  • @youssefbedhief2050
    @youssefbedhief2050 Год назад +3

    Josh please make next js, drizzle and TypeScript crash course please, otherwise you're doing a great work ,thank you for everything

  • @imnash21
    @imnash21 Год назад

    In Drizzle, I can't find how to seed data in MySQL, Postgres, etc.

  • @tentacle8148
    @tentacle8148 Год назад +1

    I see DrizzleORM as a hobby like ORM. It is way easier for me to use its paradigm and the dx feels better. Even though it is currently faster and lighter than prisma, the prisma labs work really hard on improving this aspect, they have the whole team and big sponsor support. One good point is that DrizzleORM supports planetscale's serverless adapter

  • @alvaroaquije2572
    @alvaroaquije2572 11 месяцев назад +3

    drizzle is getting truly amazing, hope it gets more attention/funding/help so that the creators or collaborators can continue working on it and fixing issues

  • @daniel_goncalves
    @daniel_goncalves Год назад

    Fatastic. Im wating for the Dashboard Project. Lets Go

  • @silknetstudio9104
    @silknetstudio9104 Год назад

    I tried to use drizzle but the unique constraint seemed to not be supported

  • @Mohammed-tx1ok
    @Mohammed-tx1ok Год назад

    Great video

  • @secretperson-desu5728
    @secretperson-desu5728 11 месяцев назад

    How to do transaction with drizzle? Seems like their example doesn't work

  • @anonanon7368
    @anonanon7368 11 месяцев назад +3

    The only big problem with drizzle right now is the docs. It's bad and missing many parts.

  • @kumarvishalben
    @kumarvishalben Год назад

    one thing still not clear, like
    if we do this way, where do we add the onDelete clauses ?

    • @JS_Jordan
      @JS_Jordan 11 месяцев назад

      Prisma emulates this behaviour without foreign keys. IIRC drizzle has opinions on cascading deletes so they probably won’t add it

  • @jeanpierrejeri6425
    @jeanpierrejeri6425 11 месяцев назад +1

    Can we already use drizzle with next-auth? i've been waiting for so long :(

    • @JS_Jordan
      @JS_Jordan 11 месяцев назад

      I am, I literally copied and pasted an adapter I found on gh and works great

  • @wfl-junior
    @wfl-junior 11 месяцев назад

    I have tried using drizzle two times now.
    The first time I had an issue that was preventing the creation of migrations, that got fixed eventually.
    And in the second time I found out it doesn't support pushing migrations with a postgres database.
    I think it still needs some maturing, but overall I was happy with the api and generating more efficient queries.

    • @andrewsherman4610
      @andrewsherman4610 11 месяцев назад

      You can apply migrations with all database dialects from day 1. If you want to push(which has nothing with migrations), postgres push was released a few weeks ago

  • @maverick456-33
    @maverick456-33 Год назад +67

    DrizzleORM looks cool but DrizzleORM has lack of features than Prisma has. and some part is more complex than Prisma.Prisma is much mature. The Next Prisma would be much faster than before. Even now, A JSON-based protocol improves Prisma’s performance since 5.0 ver. So you should think about Prisma 5 again. In the IT world, the dominance of users always wins in the end. This is why React/NextJS would be the ultimate winner in the web framework war. Others would be only for the hobbyists or only specific areas.

    • @nabinsaud4688
      @nabinsaud4688 Год назад

      +1

    • @lexsemenenko
      @lexsemenenko Год назад +6

      I tend to agree! I've been working on an large web app having a large number of polymorphic relationships. While Prisma doesn't handle these using the most efficient methods for Postgres, it manages to accomplish the task. Afraid to learn Drizzle only to discover that certain functions aren't possible. Maybe Drizzle may excel in some areas. I'd prefer to see more widespread acceptance in the industry before incorporating it into my projects.
      On the topic of query optimizations, I'm considering writing raw SQL queries wherever I find the need. This could provide a higher
      level of control and flexibility. Plus being future proof as Prisma is winning as of now.

    • @MerthanMerter
      @MerthanMerter Год назад

      most easy to use tool wins. sad bad true.

    • @nvcodes
      @nvcodes 11 месяцев назад +3

      so there is no room for innovation and new players? Every great tool has its time and every great tool has a "hobbyist" phase. Saying hobbyist is so cringe I know production apps making great money and serving there users with tools like drizzle. There is no ultimate winner lmao just use the tool that makes you the most productive and solves your problems. Its not a competition. I feel too often devs get defensive when someone isnt using the exact same tools as they are.

    • @MerthanMerter
      @MerthanMerter 11 месяцев назад

      @@nvcodes there is no competition? lols.

  • @realcontentfun
    @realcontentfun Год назад +2

    Josh please make next js and also typescript crash course

  • @wagyumedia
    @wagyumedia Месяц назад

    It's becoming Django and that's good!

  • @vickoalan
    @vickoalan Год назад

    Please more videos about drizzle

  • @dwisetyoaji5007
    @dwisetyoaji5007 Год назад

    Hi guys I am newbie, so prisma used for RDBMS right? is it good to store image inside posgresql?

    • @commentdebloquer
      @commentdebloquer Год назад

      no

    • @satindar31
      @satindar31 Год назад +4

      You really should NEVER store images inside a database like postgress, mongodob, sqlite, etc. They just aren't meant for this, rather, use S3 or something similar to store images then save the link of the image in the database.

  • @pirog-alex
    @pirog-alex Год назад

    I was hoping to try drizzle. But this 'relations' thing is a pain.

  • @BenMargolius
    @BenMargolius Год назад

    What are these tweets you speak of? I only know of X’s

    • @Dev-Siri
      @Dev-Siri 11 месяцев назад

      x xucks

  • @cunningham.s_law
    @cunningham.s_law 11 месяцев назад

    I don't want to use typescript tho

  • @IgoR.R.
    @IgoR.R. Год назад

    More I learn about drizzle, more it feels like python's sql alchemy

  • @soheilweb
    @soheilweb Год назад

    عالی داداش❤

  • @tezismith8795
    @tezismith8795 10 месяцев назад +1

    "if you were on twitter you could write 1000 tweets" not if the dude running the show has anything to say about it lmao

  • @theether5993
    @theether5993 11 месяцев назад

    I agree drizzle is good for querying db but i still prefer to use prisma for creating db but not for queries.

  • @developerpranav
    @developerpranav 11 месяцев назад

    Prisma is beginner friendly and helps you avoid making mistakes. But drizzle runs on the edge, and gives you 4/5 the experience of prisma :)

  • @anasouardini
    @anasouardini 11 месяцев назад

    "driiizleee" LOL

  • @Tajdev
    @Tajdev Месяц назад

    sql server support still doesn't exist in drizzle

  • @manmaaze
    @manmaaze 11 месяцев назад

    Brrrr

  • @elormtsx
    @elormtsx Год назад +1

    josch! make a video about firebase 😅

  • @walkingin6375
    @walkingin6375 Год назад

    So, where's the drizzle project tutorial?

  • @nabinsaud4688
    @nabinsaud4688 Год назад

    Drizzle sucks in migration no predefined auto migration table to db and in relationship issues

  • @chrishabgood8900
    @chrishabgood8900 11 месяцев назад

    Planetscale does not allow a basic db function, fk constraints? Ugghhh

    • @redeemr
      @redeemr 7 месяцев назад

      they do now

  • @Matt-lj2rx
    @Matt-lj2rx 11 месяцев назад +2

    The relations are straightup awful compared to Prisma

  • @traevelliath
    @traevelliath Год назад +3

    How is this simple?
    It's super unintuitive, especially when you keep in mind how eloquently prisma manages relationships and many-many more.

  • @surafelkebede299
    @surafelkebede299 Год назад

    First!

  • @PurpleDaemon_
    @PurpleDaemon_ 11 месяцев назад

    I'd rather see a comparison of the generated SQL queries instead of just saying "it's more efficient".

  • @kejaa955
    @kejaa955 4 месяца назад

    still prisma😢

  • @sburke0708
    @sburke0708 Год назад

    I prefer Prisma

  • @CoIdestMoments
    @CoIdestMoments Год назад

    looks way more complicated than prisma and less efficient

  • @onrightside
    @onrightside 6 месяцев назад +1

    Inserting with Drizzle is just HORRIBLE! Try inserting a many to many record, It's should not be called ORM

  • @solomonogu1393
    @solomonogu1393 11 месяцев назад

    😂why not use prisma and have peace of mind

  • @HenriqueNewsted
    @HenriqueNewsted Год назад +4

    Ok, now switch to Linux from Windows. Or even Mac, at least.
    Seeing a dev using Windows is depressing.