Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(query-interface): bring back quoteIdentifier(s) to queryInterface (…
…#13810) * fix(query-generator): update documentation of quoteIdentifier(s) * fix(query-interface): bring back quoteIdentifier(s) to queryInterface * fix(formatting): fix linting of class-to-invokable
- Loading branch information
Showing
6 changed files
with
84 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { expect } from 'chai'; | ||
import Support from '../../support'; | ||
|
||
const { sequelize } = Support as any; | ||
|
||
describe('QueryInterface', () => { | ||
describe('quoteIdentifier', () => { | ||
// regression test which covers https://github.com/sequelize/sequelize/issues/12627 | ||
it('should quote the identifier', () => { | ||
const identifier = 'identifier'; | ||
const quotedIdentifier = sequelize | ||
.getQueryInterface() | ||
.quoteIdentifier(identifier); | ||
const expectedQuotedIdentifier = sequelize | ||
.getQueryInterface() | ||
.queryGenerator.quoteIdentifier(identifier); | ||
|
||
expect(quotedIdentifier).not.to.be.undefined; | ||
expect(expectedQuotedIdentifier).not.to.be.undefined; | ||
expect(quotedIdentifier).to.equal(expectedQuotedIdentifier); | ||
}); | ||
}); | ||
|
||
describe('quoteIdentifiers', () => { | ||
// regression test which covers https://github.com/sequelize/sequelize/issues/12627 | ||
it('should quote the identifiers', () => { | ||
const identifier = 'table.identifier'; | ||
const quotedIdentifiers = sequelize | ||
.getQueryInterface() | ||
.quoteIdentifiers(identifier); | ||
const expectedQuotedIdentifiers = sequelize | ||
.getQueryInterface() | ||
.queryGenerator.quoteIdentifiers(identifier); | ||
|
||
expect(quotedIdentifiers).not.to.be.undefined; | ||
expect(expectedQuotedIdentifiers).not.to.be.undefined; | ||
expect(quotedIdentifiers).to.equal(expectedQuotedIdentifiers); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters