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

SQLColumn("*", table: ...) not working as expected #180

Closed
ptoffy opened this issue Jun 11, 2024 · 0 comments · Fixed by #181
Closed

SQLColumn("*", table: ...) not working as expected #180

ptoffy opened this issue Jun 11, 2024 · 0 comments · Fixed by #181
Labels
bug Something isn't working

Comments

@ptoffy
Copy link
Member

ptoffy commented Jun 11, 2024

Describe the issue

SQLColumn("*", table: ...) is not being correctly serialised

Vapor version

4.101.0

Operating system and version

MacOS 14.2.1

Swift version

Swift Package Manager - Swift 5.10.0-dev

Steps to reproduce

Using SQLColumn("*", table: ...) in a query such as

try await (database as! SQLDatabase).select()
    .column(SQLColumn("*", table: SQLQualifiedTable(Some.schema)))
    .from(Some.schema)
    .all()

results in an error: failed: caught error: "error: no such column: table_name.*".
This does not happen when using

try await (database as! SQLDatabase).select()
    .column(SQLColumn(SQLLiteral.all, table: SQLQualifiedTable(Some.schema)))
    .from(Some.schema)
    .all()

Outcome

No response

Additional notes

No response

@ptoffy ptoffy added the bug Something isn't working label Jun 11, 2024
gwynne added a commit that referenced this issue Jun 11, 2024
…s behavior belonged in SQLColumn, not in SQLUnqualifiedColumnListBuilder) and add tests. Fixes #180.
gwynne added a commit that referenced this issue Jun 11, 2024
Fix behavior of SQLColumn when "*" is specified as a column name (this behavior belonged in SQLColumn, not in SQLUnqualifiedColumnListBuilder) and add tests. Fixes #180.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant