Closed OfekTeken closed 2 months ago
I am looking into š¦ and should be able to add some support for this
AT TIME ZONE
is a binary operator resulting in a timestamp with/without time zone that is inverted
and zone
is a valid zone identifier - effectively a text type
timestamp without time zoneĀ AT TIME ZONEĀ zoneĀ āĀ timestamp with time zone
timestamp with time zoneĀ AT TIME ZONEĀ zoneĀ āĀ timestamp without time
*time with time zoneĀ AT TIME ZONEĀ zoneĀ āĀ time
SELECT TIMESTAMP '2001-02-16 20:38:40' AT TIME ZONE 'America/Denver';
SELECT TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-05' AT TIME ZONE 'America/Denver';
SELECT TIMESTAMP '2001-02-16 20:38:40' AT TIME ZONE 'Asia/Tokyo' AT TIME ZONE 'America/Chicago';
Binds As well as Timestamp column types and literals - it maybe possible to support bind arguments - as the types are TIMESTAMP|TIMESTAMPTZ and zone (Text)
SELECT CAST(? AS TIMESTAMPTZ) AT TIME ZONE ?;
*SqlDelight currently doesn't have a TIME WITH A TIMEZONE type that would map to java.OffsetTime
The function timezone(zone, timestamp)
is equivalent to timestamp AT TIME ZONE zone
- also not currently supported
Hey @griffio, Thanks for this - Sounds interesting :)
SQLDelight Version
2.0.2
SQLDelight Dialect
PostgreSQL
Describe the Bug
I'm trying to write a query which utilizes the AT TIME ZONE functionality.
If I were to query that, I would expect to get:
2024-05-09 16:28:36
But unfortunately, SQLDelight has a compile error:
Of course that my actual intent is to replace the
2024-05-10...
andAmerica/Chicago
with actual selectable fieldsStacktrace
No response