sequelize / sequelize-typescript

Decorators and some other features for sequelize
MIT License
2.79k stars 282 forks source link

Can I use an existing instance of Sequelize for creating an instance of Sequelize Typescript class? #795

Open denizoguz opened 4 years ago

denizoguz commented 4 years ago

Hi, I'm using Atlassian Connect Framework, which internally uses Sequelize and creates an instance of Sequelize using configuration information from a json file. I want to use Sequelize-typescript. I don't want to create a new Sequelize and directly use the Sequelize instance created by ACE framework. I'm new to TypeScript and Sequelize, and I could not figure out how to do it.

MagicLegend commented 4 years ago

The only solution I've found is the other way around, pass the Sequelize instance from ST to your legacy (or in this case Atlassian Connect). See my example project on how this could be done: https://github.com/MagicLegend/ts-testing-project

I'm not sure if the other way around is possible.