sqldelight icon indicating copy to clipboard operation
sqldelight copied to clipboard

Simple distinct query don't supported

Open Angel-Ponce opened this issue 2 months ago • 4 comments

SQLDelight Version

2.0.2

SQLDelight Dialect

libs.postgresql.dialect

Describe the Bug

I'm trying to execute the following query:

SELECT DISTINCT CAST(DATE_TRUNC('month', issue_close_date_iso) AS DATE) as local_date
FROM ProductUpdateDb
ORDER BY local_date DESC

but it'snt supported by sqldelight:

Error: '{' expected, got: ':'

I followed the https://github.com/cashapp/sqldelight/issues/4580 resulting on this "solution" but it seems that is not the full solution, because in this case I need to extract the "date" of my "local date time date" column, but these solution does'nt allow to distinct over modified columns.

Stacktrace

No response

Angel-Ponce avatar May 07 '24 17:05 Angel-Ponce