0.0.2 2018-02-19 22:45 UTC

This package is auto-updated.

Last update: 2024-04-29 03:38:36 UTC


A very simple PDO wrapper

Detailed documentation is coming Soon™.



public function __construct(PDO $pdo)


public function select(string $query, array $params = []): Generator

Pass in any SELECT query, with colon-prefixed :placeholders. For each of those placeholders, ensure $params has a matching key, including the colon. The value can be any scalar type, or an array of scalar types which will automatically be expanded when matched with an IN() clause. Automatic IN support was the primary motivation behind this library.

public function selectOne(string $query, array $params = []): array

Same as above, but you get either the first row directly or a NoResultError will be thrown. Nice for primary/unique key SELECTs.