purescript-selda icon indicating copy to clipboard operation
purescript-selda copied to clipboard

Columns named after SQL keywords causes problems

Open Kamirus opened this issue 5 years ago • 0 comments

Columns SQL keyword names like drop or backend-specific end (for PG) may not work properly.

PG should handle these names for queries without problems but insert/update/delete won't work properly.

There is a workaround - one can define the second table with explicitly escaped column names as follows and use the second table for insert/update/delete only

table ∷ Table ( end ∷ Int )
table = Table { name: "table" }

table_quote ∷ Table ( "\"end\"" ∷ Int )
table_quote = Table { name: "table" }

Kamirus avatar Jan 17 '20 11:01 Kamirus