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

refactor(query-generation): cleanup template usage #10047

Merged
merged 1 commit into from Oct 20, 2018

Conversation

SimonSchick
Copy link
Contributor

@SimonSchick SimonSchick commented Oct 19, 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

Waiting for integration tests to run in CI

  • Trying to cleanup lodash template usage and replacing it with faster template strings, also minor caching of some calls!
    • I skipped one particulary hard _.template call as the logic was too convoluted for me to touch.
  • Replaced constant regex matches with string matches.
  • Fixed some linting
  • Fixes some inconsitent query generation padding

@SimonSchick
Copy link
Contributor Author

Hey @sushantdhiman I changed the sqlite path resolve logic and now things aren't exactly working correctly, at least not in a unix environment... any suggestions?

});
const quotedTable = this.quoteTable(tableName);
return 'SELECT name FROM sys.default_constraints ' +
// REVIEW: Already quoted?
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it is safe to remove ' if table is already quoted

lib/sequelize.js Outdated
@@ -390,12 +390,12 @@ class Sequelize {
*/
import(path) {
Copy link
Contributor

Choose a reason for hiding this comment

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

call this importPath may be, path and path = require('path') are conflicting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something something type checking.

@codecov
Copy link

codecov bot commented Oct 20, 2018

Codecov Report

Merging #10047 into master will decrease coverage by <.01%.
The diff coverage is 98.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10047      +/-   ##
==========================================
- Coverage    96.3%    96.3%   -0.01%     
==========================================
  Files          63       63              
  Lines        9414     9412       -2     
==========================================
- Hits         9066     9064       -2     
  Misses        348      348
Impacted Files Coverage Δ
lib/dialects/mssql/query-generator.js 95.78% <100%> (-0.07%) ⬇️
lib/sequelize.js 96.62% <100%> (ø) ⬆️
lib/dialects/mysql/query-generator.js 97.89% <100%> (+0.04%) ⬆️
lib/dialects/sqlite/query.js 98.72% <100%> (-0.01%) ⬇️
lib/dialects/sqlite/query-generator.js 96.44% <100%> (ø) ⬆️
lib/dialects/abstract/query-generator.js 97.64% <100%> (-0.01%) ⬇️
lib/dialects/postgres/query-generator.js 94.03% <94.87%> (+0.04%) ⬆️

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 d345136...0771823. Read the comment docs.

@SimonSchick
Copy link
Contributor Author

Everything seems to be in order now, the one failing test looks like a race-condition or transient failure.

@sushantdhiman sushantdhiman merged commit be958ac into sequelize:master Oct 20, 2018
@sushantdhiman
Copy link
Contributor

Thanks @SimonSchick

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.

None yet

2 participants