Skip to content

Implement createDatabase and dropDatabase on QueryInterface - #10027

Merged
sushantdhiman merged 13 commits into
sequelize:masterfrom
ALiangLiang:db-create-drop
Oct 15, 2018
Merged

sushantdhiman merged 13 commits into
sequelize:masterfrom
ALiangLiang:db-create-drop

Conversation

@ALiangLiang

@ALiangLiang ALiangLiang commented Oct 14, 2018 •

Copy link
Copy Markdown
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Resolved #8821

Added two API on QueryInterface - createDatabase and dropDatabase. I just want to used for sequelize/cli#590. But these two API doesn't have testing code yet. It's hard to implement create and drop database in docker. If somebody has interesting on that. Please help me to add testing code on that.

@ALiangLiang ALiangLiang left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong commit message. It's include mysql test code. Not only postgres. 😛

--

force to edit the commit message

@ALiangLiang

ALiangLiang commented Oct 14, 2018 •

Copy link
Copy Markdown
Contributor Author

I'm stuck on db testing. How can I create another testing database with db user 'sequelize_test'? I think it's not suitable to create and drop db 'sequelize_test'. If db testing failed(droped database). It would caused trouble on following table testing. And need to re-up the db docker container.

@codecov

codecov Bot commented Oct 14, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #10027 into master will decrease coverage by 0.05%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10027      +/-   ##
==========================================
- Coverage   96.36%    96.3%   -0.06%     
==========================================
  Files          63       63              
  Lines        9399     9421      +22     
==========================================
+ Hits         9057     9073      +16     
- Misses        342      348       +6
Impacted Files Coverage Δ
lib/query-interface.js 89.8% <0%> (-1.33%) ⬇️
lib/dialects/mssql/query-generator.js 95.88% <100%> (+0.06%) ⬆️
lib/dialects/mysql/query-generator.js 97.84% <100%> (+0.06%) ⬆️
lib/dialects/postgres/query-generator.js 93.98% <100%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf6c05e...67a06a2. Read the comment docs.

@sushantdhiman sushantdhiman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just unit tests are enough, Please take care of my other suggestions and this can be merged

Comment thread lib/query-interface.js Resolved
Comment thread lib/dialects/mysql/query-generator.js Resolved
@sushantdhiman

Copy link
Copy Markdown
Contributor

@ALiangLiang

Copy link
Copy Markdown
Contributor Author

@sushantdhiman I'm not familiar on MSSQL. So I can't validate the query string correctly. But I can add support and let you review the test code. Wait a moment.

@ALiangLiang

Copy link
Copy Markdown
Contributor Author

BTW. Should I add support on SQLite?

@sushantdhiman

Copy link
Copy Markdown
Contributor

BTW. Should I add support on SQLite?

No

@ALiangLiang

Copy link
Copy Markdown
Contributor Author

@sushantdhiman
sushantdhiman merged commit a7fa316 into sequelize:master Oct 15, 2018
@sushantdhiman

Copy link
Copy Markdown
Contributor

Thanks @ALiangLiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support create / drop database with query interface

2 participants