-
Notifications
You must be signed in to change notification settings - Fork 348
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
Column aliases don't use NamingStrategy #2340
Comments
Shoot, looks like a sub-expansion issue. Will try to address this ASAP. |
@deusaquilus is it possible to have a fix for this issue in close future? It blocks migration to 3.12.0 for me |
@vladimirkl I experimented with this in a few different branches and the issue is deeper then I thought. I'm going to introduce a switch that will allow you to disable the column expansion entirely (i.e. the way it was in 3.10.0) in order unblock you. I.e. add the following to your SBT opts or your JVM opts in SBT if you are forking for Compile:
Continuing working on a solution in #2387. |
Version:
3.12.0
Module:
quill-jdbc-zio
Database:
postgres
Expected behavior
A fix for #2328 should use context
NamingStrategy
for column aliasesActual behavior
When using
SnakeCase
for quill context column aliases are generated with defaultCamelCase
q1 will print
SELECT x1.personName FROM ((SELECT 'x' AS personName FROM person p) UNION (SELECT x.person_name AS personName FROM person x)) AS x1
q2 will print
INSERT into names SELECT x1.personName FROM ((SELECT 'x' AS personName, p.age FROM person p) UNION (SELECT x.person_name AS personName, x.age FROM person x)) AS x1
In both cases
person_name
must be generated everywhere.This breaks existing queries which use infix and rely on column names
https://scastie.scala-lang.org/vladimirkl/r8zPuvwRSzWmh0NBIC3s2Q/9
Workaround
Downgrade to 3.10.0
@getquill/maintainers
The text was updated successfully, but these errors were encountered: