-
Notifications
You must be signed in to change notification settings - Fork 686
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
Postgres, DSL Approach: primary key with custom names beside id
breaks (reproducible test included)
#284
Comments
Apparently using column name in the underscored form object BrokenPets : Table("BrokenPets") {
val id = long("pets_id").autoIncrement().primaryKey()
val name = varchar("name", 100)
} Relevant logs of the test passing:
However, the inconsistent behavior where columns created with Following Postgres syntax lexical:
And some certain Postgres only behavior:
I guess Postgres users will not get this error if they do follow |
For other columns, the below passes though: object BrokenPets : Table("BrokenPets") {
val id = long("pets_id").autoIncrement().primaryKey()
val name = varchar("validName", 100)
}
Logs:
SQL: CREATE TABLE IF NOT EXISTS brokenpets (pets_id BIGSERIAL PRIMARY KEY, "validName" VARCHAR(100) NOT NULL)
SQL: INSERT INTO brokenpets ("validName") VALUES ('Wolfy') It seems only primary keys denoted in camelCase produced the original bug. |
The problem is that Postgres jdbc-driver additionally quotes "quoted" column name provided in RETURNING part of insert query. Exposed quotes validName and petsId because we want to save the original case of column names and as you mentioned above:
I will investigate the possibility to remove quotation from RETURNING. |
…` breaks (reproducible test included) / Test case added
Fixed in master, while waiting for a fix in a driver. |
Dependencies:
Reproducible test case:
Logs:
Also there's an inconsistent behavior where some columns are created with
"columnName"
while another column in the same table is simply created ascolumnName
.The text was updated successfully, but these errors were encountered: