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

Is there a way to name the binding parameters? #131

Open
bmovi opened this issue Nov 30, 2021 · 2 comments
Open

Is there a way to name the binding parameters? #131

bmovi opened this issue Nov 30, 2021 · 2 comments

Comments

@bmovi
Copy link

bmovi commented Nov 30, 2021

Hello, I use your library to generate sql for Clickhouse server.

I cannot use question mark because the Clickhouse php library doesn't support them.
Is there any way to name parameter?

My query looking like that:

SELECT "date", "id" FROM "users" WHERE ("date" >= ? AND "date" <= ?);

I need something like that:

SELECT "date", "id" FROM "users" WHERE ("date" >= :date AND "date" <= :date);

or that:

SELECT "date", "id" FROM "users" WHERE ("date" >= {date} AND "date" <= {date});

Maybe this is already possible with the library?
Eventually, is there a method to mix query and parameters? That way, I can cheat by managing the params myself

@shadowhand
Copy link
Owner

Currently it is not possible to use named parameters.

@bmovi
Copy link
Author

bmovi commented Dec 1, 2021

Ok, thanks.
For the moment, I will use str_replace and sprintf to use named parameters.

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

No branches or pull requests

2 participants