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

fix: fix type of methods in query-interface #11582

Merged

Conversation

@2kindsofcs
Copy link
Contributor

2kindsofcs commented Oct 19, 2019

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)?
    (npm run test-typings, actaully)
  • 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 update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

as described in #11027, many of the QueryInterface methods accept something like string | { tableName: string, schema: string } as the first argument. however, they are accepting tableName with string type only. So I added interface and type so that they could get arguments other than string.

@papb

This comment has been minimized.

Copy link
Member

papb commented Oct 19, 2019

Hi, thanks for the PR, can you please add more tests?

@@ -120,6 +120,15 @@ export interface QueryInterfaceDropAllTablesOptions extends QueryInterfaceOption
skip?: string[];
}

export interface TablenameWithSchema {

This comment has been minimized.

Copy link
@SimonSchick

SimonSchick Oct 19, 2019

Member

Should probably be TableName.

This comment has been minimized.

Copy link
@2kindsofcs

2kindsofcs Oct 20, 2019

Author Contributor

Do you mean it should be TableName or TableNameWithSchema?

This comment has been minimized.

Copy link
@papb

papb Oct 21, 2019

Member

He probably means TableNameWithSchema

@codecov

This comment has been minimized.

Copy link

codecov bot commented Oct 20, 2019

Codecov Report

Merging #11582 into master will decrease coverage by 3.79%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #11582     +/-   ##
=========================================
- Coverage   96.26%   92.47%   -3.8%     
=========================================
  Files          94       91      -3     
  Lines        9190     8903    -287     
=========================================
- Hits         8847     8233    -614     
- Misses        343      670    +327
Impacted Files Coverage Δ
lib/dialects/sqlite/query-generator.js 2.91% <0%> (-93.69%) ⬇️
lib/dialects/sqlite/query-interface.js 15.62% <0%> (-84.38%) ⬇️
lib/dialects/sqlite/data-types.js 35.89% <0%> (-64.11%) ⬇️
lib/errors/database/timeout-error.js 40% <0%> (-60%) ⬇️
lib/query-interface.js 88.78% <0%> (-3.42%) ⬇️
lib/transaction.js 97.33% <0%> (-2.67%) ⬇️
lib/sequelize.js 94.68% <0%> (-1.25%) ⬇️
lib/dialects/abstract/query.js 91.02% <0%> (-0.97%) ⬇️
lib/dialects/abstract/query-generator.js 96.5% <0%> (-0.52%) ⬇️
lib/data-types.js 91% <0%> (-0.35%) ⬇️
... and 3 more

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 edac3e9...22d6a62. Read the comment docs.

@2kindsofcs 2kindsofcs force-pushed the 2kindsofcs:fix_type_of_query_interface branch from 5e3c533 to e72dc36 Oct 20, 2019
@2kindsofcs

This comment has been minimized.

Copy link
Contributor Author

2kindsofcs commented Oct 20, 2019

@papb hi. I added some tests. I was wondering if you think there should be more tests.

as?: string;
name?: string;
}
export type Tablename = string | TablenameWithSchema;

This comment has been minimized.

Copy link
@papb

papb Oct 21, 2019

Member
Suggested change
export type Tablename = string | TablenameWithSchema;
export type TableName = string | TableNameWithSchema;
@papb

This comment has been minimized.

Copy link
Member

papb commented Oct 21, 2019

@2kindsofcs Thanks, I think those tests are enough now.

@papb
papb approved these changes Oct 22, 2019
@sushantdhiman sushantdhiman merged commit c77c553 into sequelize:master Oct 24, 2019
3 of 4 checks passed
3 of 4 checks passed
codecov/project 92.47% (-3.8%) compared to edac3e9
Details
codecov/patch Coverage not affected when comparing edac3e9...22d6a62
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.