Repository navigation
feat(postgres): add minifyAlias option in findOne, findAll, and findAndCountAll
#15394
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
Merged
ephys
merged 27 commits into
sequelize:main
from
frostzt:feat/minify-alias-opt-for-findone-findall-findandcountall
Mar 3, 2023
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8736907
feat: added minifyAlias option in findOne, findAll, and findAndCountAll
frostzt 913a54b
feat: implement minifyAlias option
frostzt 44014a6
Merge remote-tracking branch 'sequelize/main' into feat/minify-alias-…
frostzt a163e29
Merge remote-tracking branch 'sequelize/main' into feat/minify-alias-…
frostzt 96697df
Merge remote-tracking branch 'sequelize/main' into feat/minify-alias-…
frostzt 3577bb3
fix: typo on postgres query.js
frostzt d52f322
tests: added integration test for minification
frostzt 909bc75
Merge remote-tracking branch 'sequelize/main' into feat/minify-alias-…
frostzt 2d4f054
fix: removed logging from sequelize tests
frostzt d0d19c9
feat: replace aliases in mysql query runner
frostzt 19c1361
chore: revert back to previous
frostzt 4fa4f2d
chore: review changes
frostzt c7cb0f5
Merge remote-tracking branch 'sequelize/main' into feat/minify-alias-…
frostzt 7170f88
fix: use local options instead of global checks
frostzt c6a261b
fix: use local options instead of global checks for generateJoin
frostzt d47909e
fix: typo for minifyAliases
frostzt d0ba8bf
fix: add minifyAliases to escapeAttributes
frostzt 3ef4424
fix: updated and replaced typos
frostzt ba96d52
refactor: move alias minification over to queryInterface
frostzt 7bec4ba
chore: remove extra instance created
frostzt 3716c38
fix: use internal minifyAliases
frostzt ee7108e
fix: pass minifyAliases in subQuery
frostzt 7f366dd
Merge remote-tracking branch 'sequelize/main' into feat/minify-alias-…
frostzt 50eb1e7
chore: review changes
frostzt 57c51b3
Merge remote-tracking branch 'sequelize/main' into feat/minify-alias-…
frostzt fd338d3
chore: review changes
frostzt f51dc83
tests: added integration tests for qi.select
frostzt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
29 changes: 29 additions & 0 deletions
29
packages/core/test/integration/query-interface/select.test.ts
This file contains hidden or 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,29 @@ | ||
| import { expect } from 'chai'; | ||
| import { DataTypes } from '@sequelize/core'; | ||
| import { getTestDialect, createSequelizeInstance } from '../support'; | ||
|
|
||
| const dialect = getTestDialect(); | ||
|
|
||
| const supportedByDialect = ['postgres'].includes(dialect); | ||
|
|
||
| describe('QueryInterface#select', () => { | ||
| if (supportedByDialect) { | ||
| it('fetches records with alias minification', async () => { | ||
| const instance = createSequelizeInstance(); | ||
| const User = instance.define('user', { | ||
| name: { type: DataTypes.TEXT }, | ||
| }, { timestamps: false }); | ||
|
|
||
| await User.sync({ force: true }); | ||
|
|
||
| await User.create({ name: 'Sourav' }); | ||
|
|
||
| const qi = instance.getQueryInterface(); | ||
|
|
||
| const result = await qi.select(User, 'users', { where: { name: 'Sourav' }, minifyAliases: true }); | ||
|
|
||
| // @ts-expect-error -- queryInterface.select returns `object[]` can't really make it infer to user | ||
| expect(result[0].name).to.equal('Sourav'); | ||
| }); | ||
| } | ||
| }); |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.