walnut/lib_dbquery_pdo

There is no license information available for the latest version (0.0.5) of this package.

0.0.5 2024-01-21 17:10 UTC

This package is not auto-updated.

Last update: 2024-10-27 21:09:26 UTC


README

A default implementation for the QueryExecutor interface

Example

$connector = new PdoConnector('sqlite::memory:', '', '');
$executor = new PdoQueryExecutor($connector);

$executor->execute("SELECT 1 AS val")->singleValue(); //1
$executor->execute("SELECT 1 AS val")->first(); //['val' => '1'],
$executor->execute("SELECT 1 AS val")->all(); //[['val' => '1']]
$executor->execute("SELECT 1")->collectAsList()->all(); //[['val' => '1']]
$executor->execute("SELECT 1 AS k, 1 AS val")->collectAsHash()->all(); //[1 => ['val' => '1']]
$executor->execute("SELECT 1 AS k, 1 AS val")->collectAsTreeData()->all(); //[1 => [['val' => '1']]],