proullon/ramsql

Sometimes ORM wrap columns with quotes

sneko opened this issue · 5 comments

sneko commented

Hi @proullon ,

Some ORM wrap columns with quotes as in the example of GORM:

UPDATE "challenges" SET "deleted_at"='2022-07-11 14:52:45.804' WHERE "challenges"."deleted_at" IS NULL

But I get this error:

Syntax error near . \" deleted_at

Note that when testing the followings it works perfectly:

UPDATE "challenges" SET "deleted_at"='2022-07-11 14:52:45.804' WHERE "challenges".deleted_at IS NULL
UPDATE "challenges" SET "deleted_at"='2022-07-11 14:52:45.804' WHERE challenges.deleted_at IS NULL

Is it possible you accept quotes for columns as you do for tables?

Thank you,

Hi,

indeed it should be handled, and would not be hard to do. Unfortunately I have very few coding time right now sorry. I'll try to get to it soon.

Maybe you can give it a go ?

Would this be a driver issue? I am having the same issue when using gorm

Hi,

It should be good for this issue, I'll try to setup a test suite with gorm

sneko commented

Thank you @proullon !

Note: another thing among GORM issues is #61 (comment) when trying to migrate schemas to the DB.

Ok, I'll take a look.

I'm also looking for a way to generate the parser from bnf file, I'm spending so much time on parsing and very little on actual feature