Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Supercharging Node.js Applications with Sequelize

You're reading from   Supercharging Node.js Applications with Sequelize Create high-quality Node.js apps effortlessly while interacting with your SQL database

Arrow left icon
Product type Paperback
Published in Oct 2022
Publisher Packt
ISBN-13 9781801811552
Length 266 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Daniel Durante Daniel Durante
Author Profile Icon Daniel Durante
Daniel Durante
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Part 1 – Installation, Configuration, and the Basics
2. Chapter 1: Introduction to Sequelize and ORM in Node.js FREE CHAPTER 3. Chapter 2: Defining and Using Sequelize Models 4. Part 2 – Validating, Customizing, and Associating Your Data
5. Chapter 3: Validating Models 6. Chapter 4: Associating Models 7. Chapter 5: Adding Hooks and Lifecycle Events to Your Models 8. Chapter 6: Implementing Transactions with Sequelize 9. Chapter 7: Handling Customized, JSON, and Blob Data Types 10. Part 3 – Advanced Queries, Using Adapters, and Logging Queries
11. Chapter 8: Logging and Monitoring Your Application 12. Chapter 9: Using and Creating Adapters 13. Chapter 10: Deploying a Sequelize Application 14. Index 15. Other Books You May Enjoy

Using advanced association options

Sequelize offers a variety of tricks to help communicate with your database’s relations properly. Some of these methods will help query associations in a more organized and ergonomic way. Other methods will offer us a way to compose the database’s schematics for more advanced relationship patterns. In this section, we will be going over examples of how to manage complex many-to-many relationships using the Super Many-to-Many pattern, define scoped associations, and query polymorphic associations.

Using scopes with associations

Scopes are a way to define a namespace with a default set of parameters, or parameters that override previously applied scopes to a query. Associations may have defined scopes to help with organization of the code base. A key difference between scopes for associations and models is that the association scope’s parameters are applicable for the WHERE clause. Model scopes can define the WHERE, LIMIT...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Supercharging Node.js Applications with Sequelize
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime
Modal Close icon
Modal Close icon