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

Syntax Error with squirrel.Or in Postgres #358

Open
maxlambrecht opened this issue Jun 4, 2023 · 0 comments
Open

Syntax Error with squirrel.Or in Postgres #358

maxlambrecht opened this issue Jun 4, 2023 · 0 comments

Comments

@maxlambrecht
Copy link

Problem

I have encountered a syntax error when using the squirrel.Or construct with Postgres:

squirrel.Or{
	squirrel.Eq{"field_1": value},
	squirrel.Eq{"field_2": value},
}

The following error occurs: "ERROR: syntax error at or near 'OR' (SQLSTATE 42601)"

Workaround:

squirrel.Or{
	squirrel.Expr("field_1 = $1 OR field_2 = $2", value, value),
}

Additional Information:

Postgres version: 15
Squirrel version: v1.5.4

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

1 participant