latitude icon indicating copy to clipboard operation
latitude copied to clipboard

Is there a way to name the binding parameters?

Open bmovi opened this issue 4 years ago • 2 comments

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

bmovi avatar Nov 30 '21 16:11 bmovi

Currently it is not possible to use named parameters.

shadowhand avatar Nov 30 '21 17:11 shadowhand

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

bmovi avatar Dec 01 '21 09:12 bmovi