I have a project with a MySql server which contains multiple databases with the same schema. Typescript classes created by Sequelize-auto are working with one of the databases, but I am unable to use the generated classes with more than one database at the same time because Sequelize uses static properties on the class to hold the Sequelize instance.
It looks like I need to use Sequelize.define instead (see "Usage of sequelize.define" section: https://sequelize.org/master/manual/typescript.html), to create independent model objects which are tied to different Sequelize instances. So, the es5 output from sequelize-auto would be great, but it doesn't come with Typescript definitions, which I'd really like to have. I believe that this scenario would require a non-trivial addition of Typescript output using Sequelize.define but maybe (hopefully) I'm mistaken?
I have a project with a MySql server which contains multiple databases with the same schema. Typescript classes created by Sequelize-auto are working with one of the databases, but I am unable to use the generated classes with more than one database at the same time because Sequelize uses static properties on the class to hold the Sequelize instance.
It looks like I need to use
Sequelize.define
instead (see "Usage of sequelize.define" section: https://sequelize.org/master/manual/typescript.html), to create independent model objects which are tied to different Sequelize instances. So, the es5 output from sequelize-auto would be great, but it doesn't come with Typescript definitions, which I'd really like to have. I believe that this scenario would require a non-trivial addition of Typescript output usingSequelize.define
but maybe (hopefully) I'm mistaken?