课程: Databases for Node.js Developers (2021)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Introduction to Sequelize
- [Instructor] To use MySQL in our sample project, we will now use Sequelize. Sequelize is a popular database abstraction layer for Node.js, and it's not exclusive for MySQL. It supports MySQL, but also SQLite, PostgreSQL, and Microsoft SQL Server. Additionally to being a database abstraction layer, it's also an object relational mapper, an ORM, very similar to Mongoose, which is an object document mapper. So as we did it with Mongoose we could not do something like that. I could define a car and a property, make on it, and I can tell Sequelize that this should be a string. And then I call sequelize.sync in a special line different from Mongoose because this will synchronize the database model here with the database. So basically, it really creates the static table for us in MySQL. Then I call Car.create and pass in the make, and it's Ford in my case, and this, again, returns a promise and in the then block I can…
内容
-
-
-
-
-
-
-
(已锁定)
When to use relational databases59 秒
-
(已锁定)
Set up MySQL3 分钟 20 秒
-
(已锁定)
Create a database schema4 分钟 17 秒
-
(已锁定)
Use Node.js with MySQL9 分钟 58 秒
-
(已锁定)
Introduction to Sequelize2 分钟 4 秒
-
(已锁定)
Add MySQL and Sequelize to your project6 分钟 28 秒
-
(已锁定)
Review the database design2 分钟
-
(已锁定)
Create sequelize models8 分钟 51 秒
-
(已锁定)
Review the auto-generated database structure2 分钟 20 秒
-
(已锁定)
Implement an order service8 分钟 29 秒
-
(已锁定)
Add order management7 分钟 13 秒
-
(已锁定)
-