Skip to content

Add flag expandSelectStar #5813

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

griffio
Copy link
Collaborator

@griffio griffio commented Jun 20, 2025

Add flag build/compile time flag expandSelectStar Boolean defaults to false

Since #5054 was added - SqlDelight automatically rewrites SELECT *.

This appears to have been added to keep an existing generated schema stable/compatible with a target database schema - where schema columns are added independently - by fixing the columns selected at compile time allows forward compatibility

SqlDelight should not rewrite queries unless the user opts in - as any given Sql must remain un-mutated to avoid surprises to the developer who owns the Sql.

For SqlDelight test cases, the expandSelectStar is set to true in the build/test environments, as some of these tests were written after the #5054 change and have specific column ordering

Add property expandSelectStar to common docs

TODO - further local testing


  • CHANGELOG.md's "Unreleased" section has been updated, if applicable.

griffio added 2 commits June 20, 2025 17:36
Defaults to false

Determines if the compiler rewrites queries to expand `SELECT *` to column names.

Update ProjectService.kt
The tests must pass with expandSelectStar set to true for compatibility

Update SqlDelightProjectTestCase.kt

Update SqlDelightProjectTestCase.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant