RedBeardLab / zeeSQL-doc

5 stars 0 forks source link

using on predis php client #2

Closed ihabhamad closed 2 years ago

ihabhamad commented 2 years ago

on testing on Laravel Redis (Predis lib) $data = Redis::connection('test')->executeRaw(['ZEESQL.QUERY',"DB","COMMAND SELECT FROM foo"]); or $data = Redis::connection('test')->executeRaw(['ZEESQL.QUERY',"DB COMMAND ","SELECT FROM foo"]); or $data = Redis::connection('test')->executeRaw(['ZEESQL.QUERY',"DB COMMAND SELECT * FROM foo"]);

return Command incomplete, no COMMAND nor STATEMENT fields"

and

$data = Redis::connection('test')->executeRaw(['ZEESQL.QUERY DB COMMAND'," SELECT * FROM foo"]);

return "ERR unknown command ZEESQL.QUERY DB COMMAND, with args beginning with: SELECT * FROM foo, "

any idea??

image

That's in Redis monitor the client not compatible?

ihabhamad commented 2 years ago

after testing phpredis extension returns the same error

you need to accept quotation marks in parameters

for example $redis->rawCommand('set','fo','bar'); in monitor "set" "fo" "bar" Redis accept that command and parameters but
"ZEESQL.EXEC" "DB COMMAND" "select * from mydb" that's not acceptable please update your module to work with PHP Redis clients

siscia commented 2 years ago

Can you try what to me seems the most obvious?

 $data = Redis::connection('test')->executeRaw(['ZEESQL.QUERY',"DB","COMMAND",  "SELECT * FROM foo"]);

So you are telling ZEESQL to query, then what database, then that you are executing a command and finally the command you are executing.

ihabhamad commented 2 years ago

@siscia thats works image

image

siscia commented 2 years ago

That's great!

Glad to help :)