ccmbenchmark / ting

Lightweight PHP datamapper
http://tech.ccmbg.com/ting/doc/3.x/en/index.html
Apache License 2.0
1 stars 5 forks source link

Driver Mysqli execute multi_query #27

Open robotccm opened 8 years ago

robotccm commented 8 years ago

Original report by Pascal Roux (Bitbucket: pizzavomito, GitHub: pizzavomito).


Hi,

Could you add the multi_query on the mysqli driver ?

It's very useful for faceted search in Sphinx : http://sphinxsearch.com/blog/2014/05/22/the-facet-feature/

Or just for multi queries:

#!sql
SELECT SQL_CALC_FOUND_ROWS * FROM users LIMIT 0,10;
SELECT FOUND_ROWS();

Thx

robotccm commented 8 years ago

Original comment by Sylvain Robez-Masson (Bitbucket: srobez-masson, ).


Multi query isn't supported by postgresql driver :(

robotccm commented 8 years ago

Original comment by Pascal Roux (Bitbucket: pizzavomito, GitHub: pizzavomito).


Yes, postgresql does not support multi queries. But it would be possible to implement it in the Mysqli driver and throw an error in the Pgsql driver, no ?

#!php

// Pqsql/Driver.php

public function executeMultiQuery(...){
    throw new RuntimeException('Pqsql driver does not support multi query');
}