Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicate with parameter the same as a table column name #233

Open
Davidvlv opened this issue Oct 13, 2021 · 1 comment
Open

Predicate with parameter the same as a table column name #233

Davidvlv opened this issue Oct 13, 2021 · 1 comment

Comments

@Davidvlv
Copy link

Hi, how are you supposed to deal with reserved words for column names?

We are creating our predicates like:

let name = "test";
Predicate.create("Name", "contains", name);

The above works when the name variable is something random, but if it happens to be the same as the name of a column, e.g. "Id", then the SQL generated is something like:

SELECT * FROM Table WHERE Name = Id

Instead of

SELECT * FROM Table WHERE Name = 'Id'

How do we create the predicate in a way that the third parameter can overlap a column name?

@steveschmitt
Copy link
Member

I think the syntax is

let name = "test";
Predicate.create("Name", "contains", { value: name, isProperty: false });

but this probably only works with breeze-client 2.0 or newer.

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

No branches or pull requests

2 participants