a method that escapes a "table.column" string #582

Closed
sdepold opened this Issue Nov 12, 2012 · 1 comment

Projects

None yet

2 participants

@sdepold

Hi :)

is there an internal method I could use in my plugin, that would convert a string "table.column" into the respective dialects escaped equivalent? So that i would get "table.column" for mysql and whatever syntax postgres and co has for those dialects?

greetings
@sdepold

@jeremyevans
Owner

No. That requires parsing SQL, which is something that Sequel never does. The general Sequel way to represent qualified identifiers is :table__column.

You could probably do the following: Sequel.qualify(*str.split('.', 2)), which returns an object that Sequel will literalize correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment