Learn Sequelize - A NodeJS ORM | The Best Way to Write Database Queries

  Рет қаралды 87,903

Kritika & Pranav | Programmer Couple

Kritika & Pranav | Programmer Couple

Күн бұрын

Пікірлер: 173
@programmercouple
@programmercouple 3 жыл бұрын
If you're a read/write learner, don't worry we got you covered as well, with our articles/newsletters www.theimmigrantprogrammers.com/p/can-you-communicate-with-databases
@zirace3934
@zirace3934 3 жыл бұрын
Honestly! I have been roaming around net, searching for sequelize solutions. Unfortunately I found none. Here I am, landed in your channel. I have no more words but appreciation for unconditional distribution of your knowledge. Thanks a lot. You have earn my subscription
@programmercouple
@programmercouple 3 жыл бұрын
Glad I could help! Thanks a lot for your kind words!:)
@rudradityajalan2188
@rudradityajalan2188 3 жыл бұрын
Finally a short and nice guide on sequelize, thanks a lot for it!!
@programmercouple
@programmercouple 3 жыл бұрын
Thanks for your comment! We're happy to help!:)
@Android-17
@Android-17 2 жыл бұрын
This is the best introductory tutorial on Sequelize. PERIOD.
@programmercouple
@programmercouple 2 жыл бұрын
Thanks so much! Appreciate the comment!:)
@techexec
@techexec 2 жыл бұрын
I learnt about sequelize for the first time today, then came across your tutorial this evening, and I must say, 22mins here have replaced hours I spent earlier understanding the concepts. Thank you.
@programmercouple
@programmercouple 2 жыл бұрын
Thanks a lot for your kind words, comments like these encourage us to keep creating more videos
@blueshadesable
@blueshadesable 2 жыл бұрын
Fantastic tutorial. You explain everything so clearly before you take actions and begin to code. You give the viewers enough time to follow. Too many times in tutorials on You Tube, content creators will quickly click on other screens, making it hard to follow if we are either taking notes or coding along with you. This video was very well-paced. Thanks so much for sharing this. This vid made me subscribe to the channel :)
@programmercouple
@programmercouple 2 жыл бұрын
Glad it was helpful! Your wonderful comment made my day :)
@alwayslernin6033
@alwayslernin6033 3 жыл бұрын
I'm not sure if I have ever given feedback on a video before. But, everything about your style of teaching is just so good and so refreshing, that I had to comment! You are so easy to listen to and you do such a good job of explaining why you do at each step, often tying it back to the documentation rather than jus trying to fly through a bunch of high level stuff. I can't say it enough - You are really good at this and so helpful! Thank you and keep it up!
@programmercouple
@programmercouple 3 жыл бұрын
Wow, this comment made my day!
@deepakchawla1105
@deepakchawla1105 3 жыл бұрын
thanks , really helped me , i wish you had a complete series of sequelize
@programmercouple
@programmercouple 3 жыл бұрын
One day
@ianvieira283
@ianvieira283 3 жыл бұрын
In love with your teaching skills, subscribed.
@programmercouple
@programmercouple 3 жыл бұрын
Awesome, thank you!:)
@ocoocososococosooooosoococoso
@ocoocososococosooooosoococoso 3 жыл бұрын
this is the best tutorial I've seen about sequelize ever.
@programmercouple
@programmercouple 3 жыл бұрын
That's so kind! Thanks, we're very happy to help!:)
@rakeshg9057
@rakeshg9057 2 жыл бұрын
This is the best ever video on sequelize. All examples on sequelize on net are usually integrated with express server, it was difficult to differentiate sequelize code with server code bcoz they are messed up. Now this video resolved all my doubts. Thanks a lot. Love you couple.
@programmercouple
@programmercouple 2 жыл бұрын
Glad it helped! Thanks for your comment Rakesh 😀
@ampagetech2624
@ampagetech2624 Жыл бұрын
Great tutorial , the screen was very clear and readable - an easy to follow tutorials , keep it up and thanks
@programmercouple
@programmercouple Жыл бұрын
Glad it helped!
@MilaValentine
@MilaValentine 3 жыл бұрын
Thank you for the help, I spent so much time trying to add data to the relationship tables, although it's not what you covered in the video, with the example you gave I was finally able to do it!
@programmercouple
@programmercouple 3 жыл бұрын
Glad it helped!
@BlackZero880
@BlackZero880 8 ай бұрын
I spent a day and came here with successfully creating tables❤ Thanks you very much! Subscribed you as well🎉
@programmercouple
@programmercouple 8 ай бұрын
Glad to hear this! Appreciate the feedback!:)
@Randomize-md3bt
@Randomize-md3bt 3 жыл бұрын
Thank you, I was struggling with Sequelize but I found your video and it helps me a lot
@programmercouple
@programmercouple 2 жыл бұрын
You're very welcome! Happy to help!:)
@adityasoni3218
@adityasoni3218 Жыл бұрын
Wow, what a fantastic tutorial! 🙌 I've been struggling to wrap my head around Sequelize with Node.js, but this video made it incredibly easy to understand. The explanations were clear, and the step-by-step guidance was just what I needed to get started. Thanks to this tutorial, I feel much more confident in using Sequelize in my projects. Keep up the great work, and I'll definitely be checking out more of your content!" 👏📚🚀
@programmercouple
@programmercouple Жыл бұрын
Appreciate the honest feedback! Cheers!
@superman1337H
@superman1337H Жыл бұрын
I am very grateful to you, because you explain it very well and easy to understand.
@programmercouple
@programmercouple Жыл бұрын
Glad to hear that
@codekicks2171
@codekicks2171 2 жыл бұрын
you have explained really well, please make videos on more topics, it really helps a lot
@programmercouple
@programmercouple 2 жыл бұрын
Thank you for saying that, it boosts our will to make more content
@swuh87
@swuh87 3 жыл бұрын
Thank you so much for the tutorial. You explain it so well. Was able to get through the part of my project I was stuck on for a couple of days. Thanks again
@programmercouple
@programmercouple 3 жыл бұрын
Thanks for your feedback! I’m glad it was helpful:)
@emanuelacosta2541
@emanuelacosta2541 3 жыл бұрын
Hello! I love your content and your way of explaining things! Keep up the good work!
@ibraheemhajjar91
@ibraheemhajjar91 2 жыл бұрын
thank you so much for simplicity and direct explanation, keep up the good work!
@programmercouple
@programmercouple 2 жыл бұрын
Glad to hear that! Thanks!
@mddawoodalam6283
@mddawoodalam6283 3 жыл бұрын
Thank you for this amazing tutorial. Loved it and your way of teaching/explaining is very exciting to watch the video till the end. Thanks
@programmercouple
@programmercouple 3 жыл бұрын
You're very welcome!
@qanol
@qanol 2 жыл бұрын
best Sequelize on youtube , crystal clear
@programmercouple
@programmercouple 2 жыл бұрын
Thank you 😃
@charlesfreitas2092
@charlesfreitas2092 2 жыл бұрын
Such a great tutorial, perfect. Thank you so much. Greetings from Brazil. ❤️
@namansingh8081
@namansingh8081 2 жыл бұрын
Thank you so much for this tutorial, it was really helpful for understanding the syntax and working of sequelize.
@programmercouple
@programmercouple 2 жыл бұрын
Great to hear!
@amityadav-or2ys
@amityadav-or2ys 3 жыл бұрын
really helpful, I would like to see more videos on sequelize.
@programmercouple
@programmercouple 3 жыл бұрын
More to come!
@viekva
@viekva 2 жыл бұрын
Best sequelize tutorial EVER
@programmercouple
@programmercouple 2 жыл бұрын
Thanks, glad it helped!:)
@cesarpintos8418
@cesarpintos8418 3 жыл бұрын
Great explanation! Thank you very much, please use async await in next videos, promise chaining looks awful
@programmercouple
@programmercouple 3 жыл бұрын
Thanks for your comment!:)
@akulateja9011
@akulateja9011 Жыл бұрын
super awesome explanation mam 😍😍😍😍🤩🤩🤩🤩
@programmercouple
@programmercouple Жыл бұрын
Glad it was helpful!:)
@rshekhar11
@rshekhar11 3 жыл бұрын
By the way force sync is not always used, it is used only when you are planning to recreate the tables. If you see in the console it clearly states the drop table command and created it again. There is no need to drop tables for adding new records
@programmercouple
@programmercouple 3 жыл бұрын
If only you'd watched the video a little more, I did explain all of that in the video, in addition, to explaining why I am going to keep on using it in the video for demo purposes, so that we start fresh every time I re-run my script! Nevermind, thanks for your comment! Keep learning:)
@EpicToEdge
@EpicToEdge Жыл бұрын
@@programmercouple with v6 force true does not work, instead we are now using alter
@reanibutani9555
@reanibutani9555 3 жыл бұрын
Easy to understand explaination, I subscribed... Please make more tutorials.
@programmercouple
@programmercouple 3 жыл бұрын
Thanks!!! Anything in particular that you would like to learn??
@sameera-dananjaya-wijerathna
@sameera-dananjaya-wijerathna 3 жыл бұрын
really helpful resource. from Sri lanka
@programmercouple
@programmercouple 3 жыл бұрын
Hello there, thanks for your comment! Happy to help!:)
@saimanish3385
@saimanish3385 3 жыл бұрын
Hi Madam.Thank you very much for sharing the knowledge with us.Please make a video on creating a model for already existing table structure which is managed by DBA people in production environment.
@programmercouple
@programmercouple 3 жыл бұрын
Noted
@SavageStar245
@SavageStar245 Жыл бұрын
Amazing Tutorial, it gave me a smile when u mentioned Chandler Bing 😁 #FriendsFan
@programmercouple
@programmercouple Жыл бұрын
😁
@parthokr
@parthokr 3 жыл бұрын
Wow so professional. Thank you.
@kirthisa8674
@kirthisa8674 3 жыл бұрын
Hi krithika Thanku for excellent explanation on sequelize, I'm a Beginner,I need to know Is hasmany works on Innerjoin concept,I need to Innerjoin two tables
@rahulk7348
@rahulk7348 3 жыл бұрын
For Production Ready application we have to use Transaction concept. Could you please cover in your future video.
@akshaybisht2660
@akshaybisht2660 2 жыл бұрын
What a lovely tutorial. Loved the content just did not understood how did you made foreign key by customer id on order table from customer id field? Explain me this and you have new subscriber as well. Appreciate your lovely content 💖
@programmercouple
@programmercouple 2 жыл бұрын
This might help you better understand the concept: sequelize.org/master/manual/assocs.html#special-methods-mixins-added-to-instances
@beautifularabic5886
@beautifularabic5886 3 жыл бұрын
Thank you for the amazing video! Amazing explanation! Excellent teaching skills.
@programmercouple
@programmercouple 3 жыл бұрын
Glad you liked it!
@surajgadage6004
@surajgadage6004 3 жыл бұрын
Great explanation Thank you ☺️
@programmercouple
@programmercouple 3 жыл бұрын
You’re welcome 😊
@mouri_p
@mouri_p 3 жыл бұрын
Nice and clean👏
@programmercouple
@programmercouple 3 жыл бұрын
Thank you! Cheers!
@chavvobimbo5474
@chavvobimbo5474 3 жыл бұрын
Hi, are you also able to retrieve the customer name & email with the order details, depending on the customerId foreign key?
@programmingwithnit5308
@programmingwithnit5308 2 жыл бұрын
Good for me
@programmercouple
@programmercouple 2 жыл бұрын
Glad it was helpful:)
@shravan.shandilya
@shravan.shandilya 3 жыл бұрын
The force sync is going to dump data on restart. It works for this particular case or just for developer environment. Please make video about how migrations can be done using sequelize.
@RahulGupta-pj1ux
@RahulGupta-pj1ux 3 жыл бұрын
How can I perform select and insert queries on manually created tables? Do I need to define model for them? Or is there a way I can reference already existing table in my database?
@programmercouple
@programmercouple 3 жыл бұрын
Great question! Yes, so in order to use Sequelize even with the manually created tables you need to define the structure of the model inside your code.
@RahulGupta-pj1ux
@RahulGupta-pj1ux 3 жыл бұрын
@@programmercouple Thank you. Can you also make a video about concepts like pooling and handling database connection error at production level using sequelize? It would be very helpful.
@programmercouple
@programmercouple 3 жыл бұрын
Noted
@mraja6654
@mraja6654 2 жыл бұрын
Hi, when i set force true it dropped every table. How to fix it and any idea about sequelize migration with typescript.
@programmercouple
@programmercouple 2 жыл бұрын
You can just unset the force field, mark it as false.
@mraja6654
@mraja6654 2 жыл бұрын
@@programmercouple Thanks for your reply, when i set force false it not add the new field in existing table.
@akchelsea6635
@akchelsea6635 3 жыл бұрын
Thank you so much, that helps a lot
@programmercouple
@programmercouple 3 жыл бұрын
Thanks, glad to hear that!:)
@chris_ea
@chris_ea 2 жыл бұрын
Instead of Orders.findAll can you do findAllOrders on the ParentObject Customer?
@mailercatch2424
@mailercatch2424 3 жыл бұрын
The final select query is querying by orderId and not customerId, where clause is wrong.
@programmercouple
@programmercouple 3 жыл бұрын
Oops, made a mistake there! Thanks for letting us know 🙂
@beautifularabic5886
@beautifularabic5886 3 жыл бұрын
@@programmercouple what can we do to correct that where clause? what should we write instead?
@programmercouple
@programmercouple 3 жыл бұрын
You could just say: Order.findAll( { where: { customerId } } )
@karankate4838
@karankate4838 2 жыл бұрын
Thanks you soo much for the tutorial its very helpful for me 🥰
@programmercouple
@programmercouple 2 жыл бұрын
Glad it helped 😊
@siddheshmhatre2389
@siddheshmhatre2389 3 жыл бұрын
best one💥
@programmercouple
@programmercouple 3 жыл бұрын
Thank-you, we really appreciate it!:)
@YishaiYT
@YishaiYT 2 жыл бұрын
so clear. thanks a lot !
@shihabudheen3
@shihabudheen3 2 жыл бұрын
Lovely tutorial😍
@raulgogna3420
@raulgogna3420 3 жыл бұрын
Good video and clear knowledge. Do you recommend this language to connect as a backend with Flutter Front-End for an App mobile?
@programmercouple
@programmercouple 3 жыл бұрын
Thanks! Any database can be used with Flutter. The real answer depends on the kind of application you're planning to build. That alone can decide if SQL or NoSQL is better for you.
@abukhalidrifat3994
@abukhalidrifat3994 11 ай бұрын
Is it okay if I write my relations inside the model that is after creating the schema. Will it work?
@toushikahmedpronoy667
@toushikahmedpronoy667 7 ай бұрын
thanks for making it so simple
@programmercouple
@programmercouple 7 ай бұрын
Happy to help
@abhisheksrivastava6659
@abhisheksrivastava6659 2 жыл бұрын
I need a help from your side ,,, I have one table which may be join with many table ,, so I can't use association.. with two field it join that table ,,, .. then how to implement join .. in this regard ...
@virenkamra5050
@virenkamra5050 10 ай бұрын
Just a suggestion in 15:20 this is not the right way to create an order and customer must be the one creating an order instead of tweaking the table directly via Order.create() when you return the customer promise with return Customer.create({ values }) on line number 12 you receive a customer sequelized value so in the next then block where youre adding the Order must be like customer.createOrder({ values if required }) where createOrder is a method developed by sequelize under the hood in relation to your second Tables named Order with preceding keyword create
@oussemaayari4838
@oussemaayari4838 3 жыл бұрын
you're awesome, keep going
@programmercouple
@programmercouple 2 жыл бұрын
Thanks, will do!
@janakiraman2482
@janakiraman2482 2 жыл бұрын
Good explanation. Thanks
@programmercouple
@programmercouple 2 жыл бұрын
Glad it helped:)
@akashaher1001
@akashaher1001 2 жыл бұрын
Hello mam... I liked your content... 💯 How can I use one sequelize model for creating multiple tables? Because I just want to store records year wise in separate table. all the fields are same. I want to use same model instance for that
@hablu
@hablu 2 жыл бұрын
Is there any option to query select data from tables of two different database
@newagene8276
@newagene8276 2 жыл бұрын
How can I define a model for already existing tables which have tons of data and which I cannot manupilate?
@venkateshe7506
@venkateshe7506 3 жыл бұрын
Simple and neat. Thank you
@programmercouple
@programmercouple 3 жыл бұрын
You’re welcome 😃
@bkcy18
@bkcy18 2 жыл бұрын
Any way to get the code from db itself? Like, I'm using vs as an ide and for .net applications there is an option to import the database as a model and we get c# classes for the tables. Is there a way to replicate that behavior with vscode (or any other ide) for sequelize
@WilcoGroothand
@WilcoGroothand 3 жыл бұрын
Perfect to start with. thx
@mustafaagha8834
@mustafaagha8834 3 жыл бұрын
Which is better from performance and security prospective - using ORMs or Knexjs (or a likes) or using raw queries. For large scale projects
@programmercouple
@programmercouple 3 жыл бұрын
Hi Mustafa, thanks for your question. So, performance-wise RAW SQL will always be better hands down! ORMs are mostly used for the (abstraction) convenience they provide. For security, although, query builders and ORMs do offer some basic security, IMO that's something you need to take care of as a developer in all cases, no matter what you choose(Raw SQL/Query Builders/ORMs). You need to restrict as well as validate user inputs to avoid SQL Injection. However, most ORMs offer in-built support for Input/Schema Validation. Hope that answers your question!
@mustafaagha8834
@mustafaagha8834 3 жыл бұрын
@@programmercouple thank you this was really helpful
@programmercouple
@programmercouple 3 жыл бұрын
We’re glad! Happy Programming:)
@pavanshinde
@pavanshinde 3 жыл бұрын
Great video... thanks
@javierrusso9576
@javierrusso9576 3 жыл бұрын
Thanks a lot 4 this.tutorial!
@devanshusharma9098
@devanshusharma9098 3 жыл бұрын
There is a query -select a.id, b.id ,b.name from a.products,b.users where a.id=1 and b.id = a.user_id(foreignkey). How can we write this in sequelize?
@programmercouple
@programmercouple 3 жыл бұрын
Please refer the docs :)
@muhammadomarazhar8320
@muhammadomarazhar8320 Ай бұрын
Amazing, thank you
@programmercouple
@programmercouple Ай бұрын
Glad you found it helpful!🙌🏻
@arihantjain8347
@arihantjain8347 2 жыл бұрын
Nice..🙌
@programmercouple
@programmercouple 2 жыл бұрын
Thanks ✌️
@beamer5404
@beamer5404 3 жыл бұрын
You need not use --save for saving in the dependency list, it's default now. For dev dependency, you need such explicit flag, like -D.
@programmercouple
@programmercouple 3 жыл бұрын
That's good to know. Thank you!
@cheeaunlee7530
@cheeaunlee7530 2 жыл бұрын
How to organize models using different schemas? Example: accounts.payments, sales.payments, same table name, different schema
@prabhasinigiri9011
@prabhasinigiri9011 3 жыл бұрын
Awesome video ..
@programmercouple
@programmercouple 3 жыл бұрын
Glad you enjoyed it
@mohamedyoussef8835
@mohamedyoussef8835 Жыл бұрын
Awesome video ++++++++++++++ 🙂
@programmercouple
@programmercouple Жыл бұрын
Thank you!:)
@sergeykiparenko1195
@sergeykiparenko1195 2 жыл бұрын
You are the best
@loribryant4999
@loribryant4999 Жыл бұрын
I thing id object is no need to add for the model
@Infinite1
@Infinite1 2 жыл бұрын
Im new to Sequelize and the Video helped me a lot but I come to one question. What if I have multiple orders? Say if the same Person has 2 Orders howto associate the second with the rest?
@kunalrajput4539
@kunalrajput4539 2 жыл бұрын
great video
@programmercouple
@programmercouple 2 жыл бұрын
Glad you enjoyed it!
@habitzenglish5986
@habitzenglish5986 3 жыл бұрын
please make new video about relational db
@programmercouple
@programmercouple 2 жыл бұрын
That's the plan
@abhisheksrivastava6659
@abhisheksrivastava6659 2 жыл бұрын
hmm .. can you please explain us how to sanitize data in standard form ... :( ...
@vishtigote2450
@vishtigote2450 3 жыл бұрын
Thanks you so much for this. but I have noticed one thing in the util file you have accidently keep you phone number as password if it is genuine then please clear that password.
@programmercouple
@programmercouple 3 жыл бұрын
Thanks, and the number’s fake 😊
@tamaldas3544
@tamaldas3544 3 жыл бұрын
need tutorial from scratch ....how you have built the project structure ?
@programmercouple
@programmercouple 3 жыл бұрын
You can google the best practices to create project structures in NodeJs. This is a really good article on this topic blog.logrocket.com/the-perfect-architecture-flow-for-your-next-node-js-project/
@dorbenmoyal7639
@dorbenmoyal7639 3 жыл бұрын
Thanks...!
@programmercouple
@programmercouple 3 жыл бұрын
Glad I could help!:)
@chris_ea
@chris_ea 2 жыл бұрын
Thanks!
@pinnumishra4563
@pinnumishra4563 2 жыл бұрын
Thanks 😊
@programmercouple
@programmercouple 2 жыл бұрын
You're welcome!
@programmingwithnit5308
@programmingwithnit5308 Жыл бұрын
Thank you
@programmercouple
@programmercouple Жыл бұрын
You're welcome!
@csstudios7429
@csstudios7429 Жыл бұрын
thanks a lot mam
@programmercouple
@programmercouple Жыл бұрын
Most welcome 😊
@sriram-ze5dq
@sriram-ze5dq 3 жыл бұрын
Its shows as sequelize.define is not a function error
@programmercouple
@programmercouple 3 жыл бұрын
Checkout this link - stackoverflow.com/questions/49470508/sequelize-define-is-not-a-function Also, check that you're not making any obvious mistakes.
@codemoor
@codemoor 3 жыл бұрын
How Can I Use Json
@fiendsgaming7589
@fiendsgaming7589 2 жыл бұрын
thnx
@s1nistr433
@s1nistr433 2 жыл бұрын
Good video but createOrder does not work at all
@sanjayism
@sanjayism 3 жыл бұрын
TypeError: Customer.hasMany is not a function at how get rid of this error
@hovhannisyanprod9024
@hovhannisyanprod9024 2 жыл бұрын
!
@balajic4684
@balajic4684 3 жыл бұрын
do upsert and then only this video will be true waste of time !
@akashrajawat3004
@akashrajawat3004 Жыл бұрын
customer.createOrder didn't worked for me, It's giving me type error saying customer.createOrder is not a function
@crypto.vip-class
@crypto.vip-class Жыл бұрын
TypeError: sequelize.define is not a constructor ?? some help ??
Sequelize ORM Tutorial (all in one video)
49:59
Classsed
Рет қаралды 166 М.
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
«Жат бауыр» телехикаясы І 30 - бөлім | Соңғы бөлім
52:59
Qazaqstan TV / Қазақстан Ұлттық Арнасы
Рет қаралды 340 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 447 М.
Better Java Streams with Gatherers - JEP Cafe #23
1:13:32
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 914 М.
Node and Express - Connect to MySQL Database with Sequelize
22:55
Writing My Own Database From Scratch
42:00
Tony Saro
Рет қаралды 268 М.
Prisma Vs. TypeORM Vs. Sequelize | Which is Better?
12:44
PedroTech
Рет қаралды 36 М.
Prisma Crash Course
36:41
Traversy Media
Рет қаралды 77 М.
NVIDIA CEO Jensen Huang's Vision for the Future
1:03:03
Cleo Abram
Рет қаралды 364 М.