Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement createDatabase and dropDatabase on QueryInterface #10027

Merged
merged 13 commits into from Oct 15, 2018

Conversation

@ALiangLiang
Copy link
Contributor

@ALiangLiang ALiangLiang commented Oct 14, 2018

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.

Copy link
Contributor Author

@ALiangLiang ALiangLiang left a comment

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

--

force to edit the commit message

@ALiangLiang
Copy link
Contributor Author

@ALiangLiang ALiangLiang commented Oct 14, 2018

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.

@ALiangLiang ALiangLiang force-pushed the ALiangLiang:db-create-drop branch from ee92768 to 55b0125 Oct 14, 2018
@codecov
Copy link

@codecov codecov bot commented Oct 14, 2018

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.

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

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

lib/dialects/abstract/query-generator.js Outdated Show resolved Hide resolved
lib/query-interface.js Outdated Show resolved Hide resolved
lib/dialects/mysql/query-generator.js Outdated Show resolved Hide resolved
@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Oct 15, 2018

@ALiangLiang Please add support for MSSQL if possible, it should be similar to other dialects https://docs.microsoft.com/en-us/sql/t-sql/statements/create-database-transact-sql?view=sql-server-2017

@ALiangLiang
Copy link
Contributor Author

@ALiangLiang ALiangLiang commented Oct 15, 2018

@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
Contributor Author

@ALiangLiang ALiangLiang commented Oct 15, 2018

BTW. Should I add support on SQLite?

@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Oct 15, 2018

BTW. Should I add support on SQLite?

No

@ALiangLiang
Copy link
Contributor Author

@ALiangLiang ALiangLiang commented Oct 15, 2018

@ALiangLiang Please add support for MSSQL if possible, it should be similar to other dialects https://docs.microsoft.com/en-us/sql/t-sql/statements/create-database-transact-sql?view=sql-server-2017

done

@sushantdhiman sushantdhiman merged commit a7fa316 into sequelize:master Oct 15, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Oct 15, 2018

Thanks @ALiangLiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants