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

Add aliasPrefix option #533

Merged
merged 11 commits into from
May 17, 2024
Merged

Conversation

jasonwoodland
Copy link
Contributor

@jasonwoodland jasonwoodland commented May 17, 2024

Description

Adds an optional prefixAliases property to the join-monster options object. When set to true, table and column aliases are prefixed with "$" to avoid conflicting with commonly used single-letter aliases defined in where/join subqueries.

References

Testing

No change when prefixAliases is omitted. When specified, generated SQL queries contain the prefixed string.

Checklist

  • I have added documentation for new/changed functionality in this PR via comments and by updating the change log

@jasonwoodland jasonwoodland changed the title Fix/issue 532 Add prefixAliases option May 17, 2024
Copy link
Contributor

@nicoabie nicoabie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to include some tests too!

docs/API.md Outdated Show resolved Hide resolved
docs/CHANGELOG.md Outdated Show resolved Hide resolved
src/alias-namespace.js Outdated Show resolved Hide resolved
src/alias-namespace.js Show resolved Hide resolved
src/index.d.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@nicoabie nicoabie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

test-api/schema-paginated/Node.js Show resolved Hide resolved
@nicoabie
Copy link
Contributor

@jasonwoodland there is an alias-namespace test file, please make sure to add a test there as well.

Copy link
Contributor

@nicoabie nicoabie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work! Squashing and merging as soon as the pipeline succeeds!!!!

@jasonwoodland jasonwoodland changed the title Add prefixAliases option Add aliasPrefix option May 17, 2024
@nicoabie nicoabie merged commit 9d9a76f into join-monster:master May 17, 2024
10 checks passed
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.

None yet

2 participants