We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If I have table let's say { tableName: { column1: string }} then in .groupBy I can only group by column1 string, which is fine.
{ tableName: { column1: string }}
.groupBy
column1
However if I add something to a query via .select().as('column2') then I cannot group by this column.
.select().as('column2')
This would be effectively something like this SQL:
SELECT 'Text' as field, COUNT(*) GROUP BY field;
In postgres this works, but I cannot to make it working in Kysely types. I have to cast as any (or just sql.ref):
sql.ref
.groupBy([sql.ref('field')])
Looks like a bug to me or maybe it's postgres specific that's why it is not implemented.
The text was updated successfully, but these errors were encountered:
Yep, that's a bug. I'll fix it right away. Thanks for opening the issue!
Sorry, something went wrong.
8f054ae
Fixed in 0.21.1
Fell in love with this library, very well designed in my opinion :)
No branches or pull requests
If I have table let's say
{ tableName: { column1: string }}
then in.groupBy
I can only group bycolumn1
string, which is fine.However if I add something to a query via
.select().as('column2')
then I cannot group by this column.This would be effectively something like this SQL:
In postgres this works, but I cannot to make it working in Kysely types. I have to cast as any (or just
sql.ref
):Looks like a bug to me or maybe it's postgres specific that's why it is not implemented.
The text was updated successfully, but these errors were encountered: