Skip to content

feat(query-generator): add startsWith, endsWith and substring (#9935) - #9999

Merged
sushantdhiman merged 2 commits into
sequelize:masterfrom
ferfabricio:master
Oct 9, 2018
Merged

feat(query-generator): add startsWith, endsWith and substring (#9935)#9999
sushantdhiman merged 2 commits into
sequelize:masterfrom
ferfabricio:master

Conversation

@ferfabricio

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

Implements startsWith, endsWith and substring query operatos like in django ORM like described in the issue.

Closes #9935

@ferfabricio

Copy link
Copy Markdown
Contributor Author

I think this test is instable. I run many times on a docker and get different results on executions.

image

@codecov

codecov Bot commented Oct 9, 2018

Copy link
Copy Markdown

Codecov Report

Merging #9999 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9999      +/-   ##
==========================================
+ Coverage   96.39%   96.39%   +<.01%     
==========================================
  Files          63       63              
  Lines        9400     9406       +6     
==========================================
+ Hits         9061     9067       +6     
  Misses        339      339
Impacted Files Coverage Δ
lib/operators.js 100% <ø> (ø) ⬆️
lib/dialects/abstract/query-generator/operators.js 90.9% <ø> (ø) ⬆️
lib/dialects/abstract/query-generator.js 97.65% <100%> (+0.01%) ⬆️

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 9f58b82...bb8751c. Read the comment docs.

@sushantdhiman

Copy link
Copy Markdown
Contributor

I think this test is instable. I run many times on a docker and get different results on executions.

I'll look into this

@sushantdhiman
sushantdhiman merged commit 8a8366b into sequelize:master Oct 9, 2018
@sushantdhiman

Copy link
Copy Markdown
Contributor

Thanks @ferfabricio

@abettke

abettke commented Oct 9, 2018

Copy link
Copy Markdown

Legend. Thanks for the PR @ferfabricio

@gabegorelick

Copy link
Copy Markdown
Contributor

It seems like startsWith and endsWith are reversed from what they should be, or am I missing something?

See #10743

@madmoizo

Copy link
Copy Markdown
Contributor

And based on javascript String, includes would have been more relevant than substring

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.

Feature Request: startsWith, endsWith, substring operators

5 participants