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
Requires
- walnut/lib_dbquery: ^0.0.5
- walnut/lib_transactioncontext: ^0.0.1
Requires (Dev)
- ext-pdo: *
- phpunit/phpunit: ^9.5.20
- vimeo/psalm: ^4.23.0
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']]],