Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 98afe2e9
authored
Sep 19, 2018
by
frlinw
Committed by
Sushant
Sep 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(sequelize): getDatabaseName (#9937)
1 parent
b37985d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
lib/sequelize.js
test/integration/sequelize.test.js
lib/sequelize.js
View file @
98afe2e
...
@@ -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.
...
...
test/integration/sequelize.test.js
View file @
98afe2e
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment