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

Commit 98afe2e9 by frlinw Committed by Sushant

feat(sequelize): getDatabaseName (#9937)

1 parent b37985d5
...@@ -277,6 +277,15 @@ class Sequelize { ...@@ -277,6 +277,15 @@ class Sequelize {
} }
/** /**
* Returns the database name.
*
* @returns {string} The database name.
*/
getDatabaseName() {
return this.config.database;
}
/**
* Returns an instance of QueryInterface. * Returns an instance of QueryInterface.
* *
* @returns {QueryInterface} An instance (singleton) of QueryInterface. * @returns {QueryInterface} An instance (singleton) of QueryInterface.
......
...@@ -202,6 +202,12 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => { ...@@ -202,6 +202,12 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
}); });
}); });
describe('getDatabaseName', () => {
it('returns the database name', function() {
expect(this.sequelize.getDatabaseName()).to.equal(this.sequelize.config.database);
});
});
describe('isDefined', () => { describe('isDefined', () => {
it('returns false if the dao wasn\'t defined before', function() { it('returns false if the dao wasn\'t defined before', function() {
expect(this.sequelize.isDefined('Project')).to.be.false; expect(this.sequelize.isDefined('Project')).to.be.false;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!