You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently do not understand why Sequelize is exported in ./models/index.cs
db.Sequelize = Sequelize;
module.exports = db;
I do not see it used anywhere and from my current understanding, i do not know why it is exported here.
PS: I´m quite new to sequelize and i´m trying to understand the sample.
Thanks in advance
The text was updated successfully, but these errors were encountered:
You can get static methods like literal, and, fn etc which will be used when building queries, It also expose errors which can be accessed like db.Sequelize.UniqueConstraintError to catch errors
Ahh thank you, this makes sense.
So it is basically best-practice (if only one database is used) to export sequelize with it.
Is the statement above valid?
If you need those methods or errors you can get them from model.sequelize.Sequelize.fn etc but thats too long for some guys. So its just a way to easily access required methods / errors
Its all up to you how you want to access it, shorter simpler way is better I guess
I currently do not understand why Sequelize is exported in ./models/index.cs
I do not see it used anywhere and from my current understanding, i do not know why it is exported here.
PS: I´m quite new to sequelize and i´m trying to understand the sample.
Thanks in advance
The text was updated successfully, but these errors were encountered: