Hi,
i am currently toying around with Lift and Postgres and have the Mapper creating bogus SQL on me.
The whole thing is rather simple. Scala code is not more than:
val thing = new Thing
thing.save()
The model includes only a MappedString and extends a trait with some additional columns (trying to implement a nested set).
The generated SQL happily crashes the app.
Generated SQL Looks like
INSERT INTO thing (entrytext,layout,lft,pagetype,parentid,rgt,title) VALUES ("",0,1,0,1,2,"") RETURNING id
Which causes a "zero-length delimited identifier" error.
Looks like the mapper is generating double quoted strings while postgres requires them to be single quotes.
This
does not matter as long those wrongly quoted strings are not the first
and last elements in the VALUES block so it will run if the order is
different (go figure...).
The query works if those quotes are changed to single ones.
Is this an issue of mapper or jdbc?
And more importantly, how do i change the strings to be single quoted?
I am using lift 3.1.0
And
"org.postgresql" % "postgresql" % "9.4-1200-jdbc41"
Best regards