0.1.0
Initial release. A PDO driver for DuckDB.
Added
- Connect to a file-backed or in-memory DuckDB database through the standard PDO API:
new PDO('duckdb:…')and, on PHP 8.4+,PDO::connect('duckdb:…'). - Prepared statements with positional
?and named:nameplaceholders (rewritten to DuckDB$N; a repeated:namebinds once). - Result decoding via DuckDB's data-chunk/vector API: native scalars map to PHP
int/float/string/bool;UBIGINT/HUGEINT/DECIMAL/temporal/UUID/ENUM/BITand nestedLIST/ARRAY/STRUCT/MAPrender to their canonical string form.execute()materializes the result; rows are then fetched chunk by chunk. Pdo\Duckdb\Appender(viaPDO::duckdbAppender()) for fast bulk inserts over DuckDB's native appender. It validates the whole row before appending and is marked unusable after a failed append/flush/close, per DuckDB's contract. On PHP 8.4+ the method lives on a driver-specificPdo\Duckdbsubclass.- Transactions (
beginTransaction/commit/rollBack),PDO::quote(), and DuckDB extension loading through ordinary SQL (LOAD/INSTALL). - PHP 8.1 through 8.5 support.
Security
- When
open_basediris set, the connection disables DuckDB's external SQL file access (read_csv/COPY/ATTACH/httpfs) viaenable_external_access=false, fails closed if it cannot be applied, and re-enforces the sandbox on the live connection at every SQL entry point — covering persistent-connection reuse andopen_basedirtightened mid-request after a connection opened. - Embedded NUL bytes in SQL (
query/prepare/exec) and induckdbAppender()table/schema names are rejected, rather than silently truncating the statement or identifier at the NUL.