This Trick Makes My Favorite Database Tool Even Better

  Рет қаралды 23,787

Josh tried coding

Josh tried coding

9 ай бұрын

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

Пікірлер: 85
@poocham
@poocham 9 ай бұрын
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 😊
@JEM_GG
@JEM_GG 9 ай бұрын
So glad you showed this! Just happened to be writing a project in this stack ❤
@pablogtzgileta
@pablogtzgileta 9 ай бұрын
Great content as always. It would be awesome if you could do a video creating a complete application using Drizzle for the database
@jonatthu
@jonatthu 9 ай бұрын
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.
@sandrinjoy
@sandrinjoy 9 ай бұрын
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 .
@alvaroaquije2572
@alvaroaquije2572 9 ай бұрын
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
@tentacle8148
@tentacle8148 9 ай бұрын
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
@blueghost512
@blueghost512 2 ай бұрын
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.
@JEM_GG
@JEM_GG 9 ай бұрын
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 😂
@youssefbedhief2050
@youssefbedhief2050 9 ай бұрын
Josh please make next js, drizzle and TypeScript crash course please, otherwise you're doing a great work ,thank you for everything
@noext7001
@noext7001 9 ай бұрын
the issue with drizzle is many to many relation the syntax is pure garbage
@jjrise
@jjrise 9 ай бұрын
This is exactly why I haven’t made the switch
@sahilaggarwal2004
@sahilaggarwal2004 9 ай бұрын
They will probably fix this too, they are just aiming to kill Prisma completely
@jjrise
@jjrise 9 ай бұрын
For sure - fingers crossed. I think relations in general confuse me with Drizzle though, not just many to many.
@DevvOscar
@DevvOscar 9 ай бұрын
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 9 ай бұрын
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 9 ай бұрын
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?
@daniel_goncalves
@daniel_goncalves 9 ай бұрын
Fatastic. Im wating for the Dashboard Project. Lets Go
@wfl-junior
@wfl-junior 9 ай бұрын
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 9 ай бұрын
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
@HenryOsim
@HenryOsim 9 ай бұрын
How can I setup drizzle with next-auth, There doesn’t seem to be an adapter yet?
@imnash21
@imnash21 9 ай бұрын
In Drizzle, I can't find how to seed data in MySQL, Postgres, etc.
@realcontentfun
@realcontentfun 9 ай бұрын
Josh please make next js and also typescript crash course
@maverick456-33
@maverick456-33 9 ай бұрын
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 9 ай бұрын
+1
@lexsemenenko7044
@lexsemenenko7044 9 ай бұрын
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 9 ай бұрын
most easy to use tool wins. sad bad true.
@nvcodes
@nvcodes 9 ай бұрын
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 9 ай бұрын
@@nvcodes there is no competition? lols.
@silknetstudio9104
@silknetstudio9104 9 ай бұрын
I tried to use drizzle but the unique constraint seemed to not be supported
@manoku9421
@manoku9421 9 ай бұрын
It is now
@kumarvishalben
@kumarvishalben 9 ай бұрын
one thing still not clear, like if we do this way, where do we add the onDelete clauses ?
@JS_Jordan
@JS_Jordan 9 ай бұрын
Prisma emulates this behaviour without foreign keys. IIRC drizzle has opinions on cascading deletes so they probably won’t add it
@Mohammed-tx1ok
@Mohammed-tx1ok 9 ай бұрын
Great video
@developerpranav
@developerpranav 9 ай бұрын
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 :)
@theether5993
@theether5993 9 ай бұрын
I agree drizzle is good for querying db but i still prefer to use prisma for creating db but not for queries.
@jeanpierrejeri6425
@jeanpierrejeri6425 9 ай бұрын
Can we already use drizzle with next-auth? i've been waiting for so long :(
@JS_Jordan
@JS_Jordan 9 ай бұрын
I am, I literally copied and pasted an adapter I found on gh and works great
@vickoalan
@vickoalan 9 ай бұрын
Please more videos about drizzle
@secretperson-desu5728
@secretperson-desu5728 9 ай бұрын
How to do transaction with drizzle? Seems like their example doesn't work
@pirog-alex
@pirog-alex 9 ай бұрын
I was hoping to try drizzle. But this 'relations' thing is a pain.
@IgoR.R.
@IgoR.R. 9 ай бұрын
More I learn about drizzle, more it feels like python's sql alchemy
@anonanon7368
@anonanon7368 9 ай бұрын
The only big problem with drizzle right now is the docs. It's bad and missing many parts.
@BenMargolius
@BenMargolius 9 ай бұрын
What are these tweets you speak of? I only know of X’s
@Dev-Siri
@Dev-Siri 9 ай бұрын
x xucks
@anasouardini
@anasouardini 9 ай бұрын
"driiizleee" LOL
@tezismith8795
@tezismith8795 8 ай бұрын
"if you were on twitter you could write 1000 tweets" not if the dude running the show has anything to say about it lmao
@soheilweb
@soheilweb 9 ай бұрын
عالی داداش❤
@cunningham.s_law
@cunningham.s_law 8 ай бұрын
I don't want to use typescript tho
@dwisetyoaji5007
@dwisetyoaji5007 9 ай бұрын
Hi guys I am newbie, so prisma used for RDBMS right? is it good to store image inside posgresql?
@commentdebloquer
@commentdebloquer 9 ай бұрын
no
@satindar31
@satindar31 9 ай бұрын
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.
@akarikev
@akarikev 9 ай бұрын
josch! make a video about firebase 😅
@Luka_brx
@Luka_brx 9 ай бұрын
Lol
@walkingin6375
@walkingin6375 9 ай бұрын
So, where's the drizzle project tutorial?
@manmaaze
@manmaaze 9 ай бұрын
Brrrr
@PurpleDaemon_
@PurpleDaemon_ 9 ай бұрын
I'd rather see a comparison of the generated SQL queries instead of just saying "it's more efficient".
@chrishabgood8900
@chrishabgood8900 9 ай бұрын
Planetscale does not allow a basic db function, fk constraints? Ugghhh
@redeemr
@redeemr 5 ай бұрын
they do now
@nabinsaud4688
@nabinsaud4688 9 ай бұрын
Drizzle sucks in migration no predefined auto migration table to db and in relationship issues
@sburke0708
@sburke0708 9 ай бұрын
I prefer Prisma
@kejaa955
@kejaa955 2 ай бұрын
still prisma😢
@Matt-lj2rx
@Matt-lj2rx 9 ай бұрын
The relations are straightup awful compared to Prisma
@traevelliath
@traevelliath 9 ай бұрын
How is this simple? It's super unintuitive, especially when you keep in mind how eloquently prisma manages relationships and many-many more.
@CoIdestMoments
@CoIdestMoments 9 ай бұрын
looks way more complicated than prisma and less efficient
@surafelkebede299
@surafelkebede299 9 ай бұрын
First!
@solomonogu1393
@solomonogu1393 9 ай бұрын
😂why not use prisma and have peace of mind
@onrightside
@onrightside 3 ай бұрын
Inserting with Drizzle is just HORRIBLE! Try inserting a many to many record, It's should not be called ORM
@HenriqueNewsted
@HenriqueNewsted 9 ай бұрын
Ok, now switch to Linux from Windows. Or even Mac, at least. Seeing a dev using Windows is depressing.
How Did I Not Know This TypeScript Trick Earlier??!
9:11
Josh tried coding
Рет қаралды 200 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 379 М.
it takes two to tango 💃🏻🕺🏻
00:18
Zach King
Рет қаралды 20 МЛН
Последний Закат Кота Макса...
00:21
Глеб Рандалайнен
Рет қаралды 4,4 МЛН
DONT USE AN ORM | Prime Reacts
25:46
ThePrimeTime
Рет қаралды 193 М.
I Hate Next.js 13 Caching Even More Now
7:00
Josh tried coding
Рет қаралды 30 М.
How to ACTUALLY Secure Your API (5 Steps)
7:42
Josh tried coding
Рет қаралды 54 М.
Prisma 5: Faster By Default | Prime Reacts
19:01
ThePrimeTime
Рет қаралды 38 М.
Oh, Auth Doesn't Have to Suck?
7:16
Josh tried coding
Рет қаралды 50 М.
I earn $1,753/day with this SIMPLE tech stack
6:59
Marc Lou
Рет қаралды 305 М.
I loaded 100,000,000 rows into MySQL (fast)
18:27
PlanetScale
Рет қаралды 175 М.
The Problem With UUIDs
6:36
Josh tried coding
Рет қаралды 66 М.
IPad Pro fix screen
1:01
Tamar DB (mt)
Рет қаралды 3,3 МЛН
Carregando telefone com carregador cortado
1:01
Andcarli
Рет қаралды 1,3 МЛН
The power button can never be pressed!!
0:57
Maker Y
Рет қаралды 47 МЛН
Edit My Photo change back coloured with Bast Tech
0:45
BST TECH
Рет қаралды 335 М.
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Рет қаралды 1,4 МЛН