dg / dibi

Dibi - smart database abstraction layer
https://dibiphp.com
Other
487 stars 135 forks source link

FirebirdDriver::escapeLike Dibi\NotImplementedException #291

Open jan-oliva opened 6 years ago

jan-oliva commented 6 years ago

Hello I have problem with firebird driver. Firebird driver has not implemented escapeLike method. Is possible to implement this method ?

Thanks

dg commented 6 years ago

Can you try to do it and send a pull request?

jan-oliva commented 5 years ago

Pull request created https://github.com/dg/dibi/pull/300

dg commented 5 years ago

Thanks

jan-oliva commented 5 years ago

Is possible propagate changes into tag v3.2.1 (v3.2.2) ? Thanks

dg commented 5 years ago

Are you sure that this solution is correct? According to http://www.janus-software.com/fbmanual/manual.php?book=psql&topic=82 If the escape clause is ommitted, then there is no default escape character..

jan-oliva commented 5 years ago

Do you mean last_name LIKE '%A\_B%' ESCAPE '\'

New code return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'") .' ESCAPE '. "'\'";

returns string like LIKE '%Bašt%' ESCAPE '\'

I will commit new code for pull request

jan-oliva commented 5 years ago

dle http://www.janus-software.com/fbmanual/manual.php?book=psql&topic=82 jsem to chápal, jako že když tam právě uvedu ESCAPE '\', že tím právě definuji escape znak.

dg commented 5 years ago

Asi jo, ale musí se to otestovat. Zkusil jsem přidat test. https://github.com/dg/dibi/commit/0fb63f3e6b1370f5b1c5bf5b4253728d658a30ea