karamaan / karamaan-opaleye

Other
11 stars 7 forks source link

Column names are not escaped #59

Open bergmark opened 10 years ago

bergmark commented 10 years ago

If you define a column as eg Wire "don'tdothis" opaleye will generate invalid queries.

tomjaguarpaw commented 10 years ago

Interesting. Is this actually a valid column name?

bergmark commented 10 years ago

Yep

# create table x ("id'" int);
CREATE TABLE
# insert into x ("id'") values (1);
INSERT 0 1
# select * from x;
 id'
-----
   1
(1 row)

I don't really care about this by the way, but thought it was worth mentioning.

tomjaguarpaw commented 10 years ago

It's definitely worth having a record of it, so thanks for pointing it out.

tomjaguarpaw commented 9 years ago

I think this is now fixed in Opaleye 1: https://github.com/tomjaguarpaw/haskell-opaleye/commit/3d9946f3f9ea912aa320ed7908357fe3a62dad5f