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
Member

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

@SimonSchick SimonSchick commented Oct 19, 2018

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?

@SimonSchick SimonSchick force-pushed the SimonSchick:chore/template-cleanup branch from ea3d68a to 37e5b92 Oct 19, 2018
});
const quotedTable = this.quoteTable(tableName);
return 'SELECT name FROM sys.default_constraints ' +
// REVIEW: Already quoted?

This comment has been minimized.

@sushantdhiman

sushantdhiman Oct 20, 2018
Contributor

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

@@ -390,12 +390,12 @@ class Sequelize {
*/
import(path) {

This comment has been minimized.

@sushantdhiman

sushantdhiman Oct 20, 2018
Contributor

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

This comment has been minimized.

@SimonSchick

SimonSchick Oct 20, 2018
Author Member

Something something type checking.

@codecov
Copy link

@codecov 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 SimonSchick force-pushed the SimonSchick:chore/template-cleanup branch from dd6fdee to 0771823 Oct 20, 2018
@SimonSchick
Copy link
Member Author

@SimonSchick SimonSchick commented Oct 20, 2018

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
4 checks passed
4 checks passed
codecov/patch 98.47% of diff hit (target 96.3%)
Details
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +2.16% compared to d345136
Details
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 20, 2018

Thanks @SimonSchick

@SimonSchick SimonSchick deleted the SimonSchick:chore/template-cleanup branch Mar 9, 2019
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.

None yet

2 participants