Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Add option to add column/table name as a parameter #359

Open
orlavy-bigabid opened this issue Jul 2, 2018 · 1 comment
Open

Add option to add column/table name as a parameter #359

orlavy-bigabid opened this issue Jul 2, 2018 · 1 comment

Comments

@orlavy-bigabid
Copy link

I think there should be an option to insert the column name as a dynamic parameter in queries like

squel.select()
.from('table')
.where('? > ?', 'price', 5)
.toString();

In the current state, the result is "SELECT * FROM table WHERE ('price' > 5)"

And as you can see, the column name is inside quotes (where it should be left "as is")

For reference, the "mysql" package has an option to use '??' (instead of a single '?') as "placeholders for identifiers you would like to have escaped" As indicated here

@jonahbron
Copy link

You might be able to use squel.str() for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants