Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 1.45 KB

postgresql-dialect-evaluating.md

File metadata and controls

63 lines (46 loc) · 1.45 KB

PostgreSQL Dialect

The PostgreSQL dialect is not yet available. The examples provided illustrate what the output would look like if a PostgreSQL dialect were implemented. The results are intentionally generated using non-official expressions to highlight the differences that occur when applying the same criteria expression across different dialects.

We are currently working on the official PostgreSQL dialect. In the meantime, you can use the SQL dialect to implement your own PostgreSQL dialect.

For these examples we will use the defined expressions in the Defining Criteria Expressions document.

expr[PostgreSQL]
// res: (('field1' <= 3) AND ('field2' <= 4)) OR ('field3' = c)

Case of use

ageCriteria[PostgreSQL]
// res: ('age' > 18) AND ('age' < 65)
refCriteria[PostgreSQL]("id", UUID.randomUUID())
// res: 'id' = 473a1484-afd8-4ebd-8eb4-312fd51510b3

Using IS NULL expression

isNullExpr[PostgreSQL]("field")
// res: 'field' IS NULL

Using NOT expression

notExpr[PostgreSQL]("field")
// res: (NOT ('field' > 2)) AND ('field' <= 10)

Using BETWEEN expression

betweenExpr[PostgreSQL]("field")
// res: 'field' BETWEEN 100 TO 150

Using ARRAY expression

arrayExpr[PostgreSQL]("field")
// res: 'field' IN (1, 2, 3)

Using LIKE expression

likeExpr[PostgreSQL]("field")
// res: 'field' LIKE a%