File tree Expand file tree Collapse file tree
main/antlr4/org/dhatim/sql/lang
test/java/org/dhatim/sql/hamcrest Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ timestamp_literal
338338
339339date_literal
340340 : DATE date_string=Character_String_Literal
341+ | date_string=Character_String_Literal CAST_EXPRESSION DATE
341342 ;
342343
343344interval_literal
@@ -350,6 +351,7 @@ boolean_literal
350351
351352uuid_literal
352353 : UUID uuid_string=Character_String_Literal
354+ | uuid_string=Character_String_Literal CAST_EXPRESSION UUID
353355 ;
354356
355357/*
Original file line number Diff line number Diff line change @@ -72,11 +72,13 @@ public void testLike() {
7272 @ Test
7373 public void testUUIDLiteral () {
7474 assertThat (sql ("SELECT UUID 'c96ff414-8559-484c-bd43-c978130a5ee4'" ), query (uuidLiteral ("c96ff414-8559-484c-bd43-c978130a5ee4" )));
75+ assertThat (sql ("SELECT 'c96ff414-8559-484c-bd43-c978130a5ee4'::uuid" ), query (uuidLiteral ("c96ff414-8559-484c-bd43-c978130a5ee4" )));
7576 }
7677
7778 @ Test
7879 public void testDateLiteral () {
7980 assertThat (sql ("SELECT DATE '2010-10-10'" ), query (dateLiteral ("2010-10-10" )));
81+ assertThat (sql ("SELECT '2010-10-10'::date" ), query (dateLiteral ("2010-10-10" )));
8082 }
8183
8284 @ Test
You can’t perform that action at this time.
0 commit comments