Open adamsar opened 2 years ago
Would it be valid in SQL to use the word "order"?
I always quote my table names, column names, table aliases, column aliases, fixed column values to make sure that I don't have to think about database keywords in my class names or properties.
We do the following in mysql, but I suspect it would work similarly for the postgres dialect
trait NamingMysqlDialect extends MySQLDialect:
override def tokenizeColumnAlias(strategy: NamingStrategy, column: String): String =
strategy.column(column)
override def tokenizeFixedColumn(strategy: NamingStrategy, column: String): String =
strategy.column(column)
override def tokenizeTableAlias(strategy: NamingStrategy, table: String): String =
strategy.table(table)
override def tokenizeIdentName(strategy: NamingStrategy, name: String): String =
strategy.default(name)
Version: 4.4.1 Module: quill-jdbc-zio Database: postgres
Expected behavior
I have a table called
orders
in the database. I would assume this would be a fairly common thing for people developing commerce related applications. If I make a query like this:I expect it to return orders great then the provided id
Actual behavior
It compiles correctly, but gives abstruse errors on execution (syntax errors)
Workaround
Just use any other name in functions, such as
@getquill/maintainers