9:45 "You can see that its going to give an error" - How I always feel when I'm coding. Thanks for taking the time for this tutorial.
@vieiratn3 жыл бұрын
The difference between mysql and mysql2 is basically promises. The package mysql2 allows you to work with asynchronous JS. Thanks for the video bro.
@PedroTechnologies3 жыл бұрын
Thanks for sharing! I actually never realized this. This can be helpful cause ive been caught in callback 'hell' situations using mysql.
@lucylu1843 жыл бұрын
Your videos helped me get an internship. I'm really grateful.
@PedroTechnologies3 жыл бұрын
Wow thats amazingg! If you don't mind, where you going to work? This makes me very happy!
@markokafor74323 жыл бұрын
You didn’t need to install path and fs. They are built in node js modules
@PedroTechnologies3 жыл бұрын
Yes
@angelbythewings3 жыл бұрын
@@PedroTechnologies Also its not require, its request and response 😄
@PedroTechnologies3 жыл бұрын
@@angelbythewings yep, i explained that in the past hahaha i used to call it required and response because thats how i said (in order to understand) back when i was learning. I shouldn’t have used that in the video but when i made this video i was grtting like 3 views per video so i didnt think it would matter hahaha nowadays i say request in my new videos
@angelbythewings3 жыл бұрын
@@PedroTechnologies that's completely understandable. Sorry if you already knew, I shouldn't have pointed out. BTW it was a very nice tutorial
@PedroTechnologies3 жыл бұрын
@@angelbythewings nahhh its good hahahha i really appreciate it cause other people can see it! I sometimes don’t like my old videos cause im scared that i used to say dumb stuff like this lmao
@cooperathletics62783 жыл бұрын
Concise and straight to the point! Beats these 3 hour crash course vids. Thanks for the tutorial.
@PedroTechnologies3 жыл бұрын
Thank you! Really appreciate it!
@tekhaven3 жыл бұрын
@@PedroTechnologies Awesome tutorial and very straight to the point
@triptisingla4897 Жыл бұрын
bestest video in the whole worldd, i am saying you are the best, I have been searching everywhere but here my search got results, thankksssssss
@xbzq Жыл бұрын
When I saw that you npm installed fs and path I realized you have no idea what you're talking about. These modules aren't packages. They are internal modules provided by nodejs itself. Thinking you need to install these demonstrates a great lack of experience with the platform.
@parasarora58693 жыл бұрын
Amazing tutorial sir!!... you cleared my doubts regarding sequelize in one go 👍👍
@PedroTechnologies3 жыл бұрын
Glad to hear that
@CourageousCreatives3 жыл бұрын
Another really great run-down on a topic! Thanks!
@PedroTechnologies3 жыл бұрын
Glad you enjoyed it!
@uktech94324 ай бұрын
Honestly it was very well explained ❤.
@anonlegion9096 Жыл бұрын
11:50 req does not mean "require", it means "request", the req and res in (req, res) => {...} literally means request and response 13:55 that if(err) is redundant, the .catch() is called only if err is thrown... the only useful thing to do with conditionals inside the .catch() is handling different kinds of errors
@tekhaven3 жыл бұрын
Please can you do a tutorial on Table relationship? Really need that with sequelize
@PedroTechnologies3 жыл бұрын
Some people requested this, I plan on doing it!
@xxfrizzzerxx68903 жыл бұрын
Need it !
@waynefaustorilla3 жыл бұрын
Yes please
@MrChilo892 жыл бұрын
yes please
@unsolvedstories1016 Жыл бұрын
Beautiful and most required video 🙏
@aksaurooj8383 жыл бұрын
when i write sequelize init i get an error The term 'sequelize' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + sequelize init + ~~~~~~~~~ + CategoryInfo : ObjectNotFound: (sequelize:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PLEASE HELP
@fredrickemmanuel4793 ай бұрын
am also getting same error
@blakebard3 ай бұрын
npm install -g sequelize-cli
@alberto5056Ай бұрын
I have the same error, you have to use "npx sequelize-cli init"
@Spmdiamond2 жыл бұрын
Love you bro thanks a lot it is best way to learn for beginners
@Pareshbpatel Жыл бұрын
An excellent introduction to using Sequilize to perform CRUD Operations on a mySQL database. Thanks, Pedro {2023-06-05}
@СтепаСорокин-е2я11 ай бұрын
You can also use Postman to test different methods like post without frontend at all 14:40
@jabezraja93833 жыл бұрын
i really appreciate your effort... it was very usefull for me
@PedroTechnologies3 жыл бұрын
Glad it was helpful!
@danielkibby6601 Жыл бұрын
This is great, so I glad I found your video :D
@gokulkurup15844 жыл бұрын
Really Helpful. Thanks for the great tutorial !
@PedroTechnologies4 жыл бұрын
Glad it was helpful!
@MarsTheProgrammer4 жыл бұрын
Thanks for the videos, i have a question. Is there a library for autocompleting sequelize syntax? I tried a few but they don't seem to work.
@MarsTheProgrammer4 жыл бұрын
nvm, i found the solution, sequelize init imports it wrong for the models. It should be like this: const { Sequelize } = require("sequelize"); Not like this: const Sequelize = require("sequelize");
@PedroTechnologies4 жыл бұрын
Awesome! Yeah, they are exporting Sequelize as a separate variable so to get the autocomplete you have to put the brackets. Glad you fixed it!
@ianpropst-campbell6028 Жыл бұрын
Thank you for this helpful tutorial!
@Мертвыйотчим Жыл бұрын
thank you sir, useful and easy to understand
@fedeabj2 жыл бұрын
Hi Pedro, how are you? I have a question, is this way of doing queries safe? Is this the frontend interfacing with the db directly? Im not sure about those things. Thank you!
@austin96tig4 жыл бұрын
That was a really good explanation!
@PedroTechnologies4 жыл бұрын
Glad you liked it!
@Vir7uaLGameplays2 жыл бұрын
What about connection to multiple databases? What's the best approach? Btw if you could make an updated version of this video it would be great because sequelize is a bit implementation is a bit different now.
@hyphenbruh7376 Жыл бұрын
Hi, I’m new to the Sequelize ORM utilities, but I imagine you would need to instantiate another instance of Sequelize and pass it your other databases’ configuration settings (i.e. name, port, password, username, etc.) The Sequelize instance in ./models/index.js in the video only creates one database object with its corresponding tables. Not sure how you would implement it using DBMS other than MySQL though. ps. Not sure if this is the best approach for making multiple database connections, or if this is even right at all, so take it with a grain of salt.
@k303k Жыл бұрын
Thanks for the video Pedro!
@7gsReef Жыл бұрын
what is the application you use to see your database and know whats inside it?
@stonecomstock2 жыл бұрын
this was very helpful! thank you
@thesinged1962 жыл бұрын
sequelize: command not found help me pro plssssss!!!
@yonatanshalev9428 Жыл бұрын
Great tutorial, thanks! Any chance to get the GitHub repository to clone?
@earlgrey861111 ай бұрын
You export your model function from User.js which is an anonymous function that takes 2 params - sequelize, DataTypes. I don't understand how when you then import this function as db you don't have to pass an instance of sequelize and Datatypes to it? How can you simply say db.sequelize.define (....) -- shouldn't you have to say db(sequelize, DataTypes).define ( ... ) ??
@PanlasangMotour4 жыл бұрын
Thank you i learn a lot can you make it with front end an todo task application so that others can deep dive learn using with node js express pug integration
@PedroTechnologies4 жыл бұрын
I have a an example of how to make a todo list application on my 3 part series called: CRUD Tutorial ReactJS ! I don't use sequelize on that series, but transferring the normal mysql logic to sequelize is pretty straightforward!
@ibrahimacanada2 жыл бұрын
Always great thanks !!
@HHHanant9 ай бұрын
Hi great video, need your help in one question. I have two DBs in mysql. In DB1 we have person table and DB2 we have gender table. I have to do association between DB1.person and DB2.gender. can you help me with this.
@BrawlStars-kq9mt2 ай бұрын
I changed the .js files to ecma6, and it doesnt work. How can fix this issue?
@SmokyBigSmoke4 жыл бұрын
Thank You. Really helpful.
@PedroTechnologies4 жыл бұрын
Glad it was helpful!
@lg-254 ай бұрын
How to retrieve the data use sequelize mysql when we insert execl data in database of three tables
@Cynthia-cw6kd3 ай бұрын
Love this, thanks!
@davidanwar69964 жыл бұрын
what should i use, pure SQL or Sequelize?
@PedroTechnologies4 жыл бұрын
It depends on what is your application. However in a Job or an advanced project, usually you would use Sequelize. Its a lot more handy to use an ORM like Sequelize because then you don't need to write actual SQL. It is a way to convert SQL to normal JavaScript, so thats why almost every company uses it.
@davidanwar69964 жыл бұрын
@@PedroTechnologies thank's .
@josesoltero6057 Жыл бұрын
thanks so much for this video!!!
@maelstrom574 ай бұрын
Bro, path and fs are native NodeJS modules.
@premalatha51823 жыл бұрын
Hi very helpful video but i have an doubt could you pls help me to update the record using sequelize
@kishorep33762 жыл бұрын
Cannot read properties of undefined (reading 'findAll') what can I do!
@aadarshaacharya2674 жыл бұрын
Why do we have to pass sequelize & DataTypes ad parameter in Models. Can't we directly import from sequelize ? like const { DataTypes, Sequelize } = require('sequelize');
@PedroTechnologies4 жыл бұрын
You could do it both ways! Passing it as a parameter is a standard for the sequelize-cli, but if your not using it than you probably should just import it!
@reni209011 күн бұрын
great video! tysm
@DeveenRathnayake4 жыл бұрын
hello, I got an error when I coding with your video. const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes); ^ TypeError: Class constructor model cannot be invoked without 'new'
@PedroTechnologies4 жыл бұрын
Did you install 'path'? This error occurs in the file generated by the cli so that is weird hahaha I would try restarting the server!
@DeveenRathnayake4 жыл бұрын
Yes I installed it too. Now problem is okay. I figured it out
@mr.hassaan77853 жыл бұрын
please zoom the screen or increase font size. ur screen is too big, does not mean that others have the same... if i watch it on mobile, the font is too small. barely reading
@programmingwithnit5308 Жыл бұрын
Thank you brother
@navinwadhwa5959 ай бұрын
Why app. Get for inserting.. It should be app.post??
@aakarshanthapa8893 жыл бұрын
Hello Pedro, I wanted to use ES6 modules for importing, but can't figure out how to change the require imports to es6 inside models/index.js file
@govinda3992 жыл бұрын
use "type" : "module" in your script file
@sang40056 ай бұрын
I run into same error
@theverybestdev4 жыл бұрын
please upload about associations in sequelize
@PedroTechnologies4 жыл бұрын
This should be an interesting video idea! I will make one!
@theverybestdev4 жыл бұрын
@@PedroTechnologies awesome thanks
@tekhaven3 жыл бұрын
@@PedroTechnologies i really need the association because i am having problems with table relationships
@MrChilo892 жыл бұрын
i had to use this command on bash "powershell Set-ExecutionPolicy RemoteSigned" on VS to skip the problem "cannot be loaded because running scripts is disabled on this system."
@jtcheng18053 жыл бұрын
I failed at step: sequelize init, return "sequelize : unrecognizable. previous step: npm install... seems ok with npm warning server@1.0.0 no description. help please
@jtcheng18053 жыл бұрын
fix it with npx sequelize init help from previous comments,
@hichamamroussi9087 Жыл бұрын
thank you !@@jtcheng1805
@נתנאלנגוסה-ס3ס2 ай бұрын
thank you !!
@sridharkatta34613 жыл бұрын
i think path and fs are inbuilt packages in nodejs so we dont need to install them
@alexdev57349 ай бұрын
Why would you want to install fs when its built-in to nodejs
@sang40056 ай бұрын
I wonder too, both path and fs are built-in to nodejs
@tigranavagyan59222 жыл бұрын
Thank you a LOT!!!
@matthewclarke1926 Жыл бұрын
The ORM dream. Just write SQL.
@Jeancympoycoding2 ай бұрын
I like your videos
@TolaFoundationMw Жыл бұрын
🔥🔥🔥
@nathansantos41973 жыл бұрын
how can I read a database.sql file in node js? I need to read this in my React js project using node Anyone can help me?
@PedroTechnologies3 жыл бұрын
What do you mean? You want to use an existing database or create a new one?
@nathansantos41973 жыл бұрын
@@PedroTechnologies I want to use a existing database file. I need to read this database to get some data
@ibrahimmainge Жыл бұрын
You don't need to install fs and path.... It's core modules!
@kishore23982 жыл бұрын
How to update pls tell me brother
@instant-code4 жыл бұрын
where is next tutorial
@PedroTechnologies4 жыл бұрын
This was a long time ago, but I should probably create a new series! Sorry about that!
@saladin_advanced2 жыл бұрын
Thank you.
@note_to_you3 жыл бұрын
how to make SELECT * FROM posts join users on posts.UserId = users.id in sequelize.