不要怂,就是干,撸起袖子干!

Commit 4d5be9a4 by Simon Schick Committed by Sushant

fix(types): add models property to sequelize class (#10736)

1 parent 88228d74
...@@ -697,6 +697,13 @@ export class Sequelize extends Hooks { ...@@ -697,6 +697,13 @@ export class Sequelize extends Hooks {
public readonly connectionManager: ConnectionManager; public readonly connectionManager: ConnectionManager;
/** /**
* Dictionary of all models linked with this instance.
*/
public readonly models: {
[key: string]: typeof Model;
};
/**
* Instantiate sequelize with name of database, username and password * Instantiate sequelize with name of database, username and password
* *
* #### Example usage * #### Example usage
......
import { Config, Sequelize } from 'sequelize'; import { Config, Sequelize, Model } from 'sequelize';
Sequelize.useCLS({ Sequelize.useCLS({
}); });
...@@ -45,3 +45,4 @@ Sequelize.afterConnect(() => { ...@@ -45,3 +45,4 @@ Sequelize.afterConnect(() => {
}); });
const myModel: typeof Model = sequelize.models.asd;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!