You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
knex({ client: 'pg' })
.select(knex.ref('Date as of'))
.from('table')
.toSQL().sql;
or
knex({ client: 'pg' })
.select(knex.raw('??', 'Date as of'))
.from('table');
.toSQL().sql;
return
'select "Date" as "of" from "table"'
whereas I expect
'select "Date as of" from "table"'
Feature discussion / request
There are legitimate cases where a column name contains "as" (the above is from a real in-production example). Splitting on "as" is error-prone and leads to unexpected behavior. Instead, there should be a proper syntax for column aliasing.
This problem is also mentioned in this old issue: #139
The text was updated successfully, but these errors were encountered:
Environment
Knex version: latest ( ^0.21.21 )
Bug
or
return
'select "Date" as "of" from "table"'
whereas I expect
'select "Date as of" from "table"'
Feature discussion / request
There are legitimate cases where a column name contains "as" (the above is from a real in-production example). Splitting on "as" is error-prone and leads to unexpected behavior. Instead, there should be a proper syntax for column aliasing.
This problem is also mentioned in this old issue: #139
The text was updated successfully, but these errors were encountered: