From the course: Databases for Node.js Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Implement an order service
From the course: Databases for Node.js Developers
Implement an order service
- [Instructor] We will now implement the service responsible for the order management in MySQL. For that open server, services, OrderService and there we already started implementing this class, but our order management, we will use transactions. Transactions are a feature of the most relational databases and they in a nutshell, make sure that either all commands on the database are executed or none. This means, if you create one record in one table and few other records in another table and something goes wrong along the way, no record will be created. So it's either everything or nothing if those instructions are performed in a transaction. To later being able to run, work in a transaction, I will now create a new function async in transaction. And this function, just expects one argument, this is work. And work as you will see later is actually a function. Now I will first start the transaction. So I add const t equals…
Contents
-
-
-
-
-
-
-
(Locked)
When to use relational databases59s
-
(Locked)
Set up MySQL3m 20s
-
(Locked)
Create a database schema4m 17s
-
(Locked)
Use Node.js with MySQL9m 58s
-
(Locked)
Introduction to Sequelize2m 4s
-
(Locked)
Add MySQL and Sequelize to your project6m 28s
-
(Locked)
Review the database design2m
-
(Locked)
Create sequelize models8m 51s
-
(Locked)
Review the auto-generated database structure2m 20s
-
(Locked)
Implement an order service8m 29s
-
(Locked)
Add order management7m 13s
-
(Locked)
-