Files
static-php-cli/src/globals/ext-tests/pdo_sqlite.php
Jan Jakeš ca0167c83e Enable SQLite column metadata
Build Unix SQLite with SQLITE_ENABLE_COLUMN_METADATA so the metadata APIs are available on macOS and Linux.

Remove the pdo_sqlite configure override that forced PHP to treat sqlite3_column_table_name() as unavailable, and add sanity checks for both SQLite compile options and PDO column metadata.
2026-07-07 16:25:00 +02:00

17 lines
507 B
PHP

<?php
declare(strict_types=1);
$pdo = new PDO('sqlite::memory:');
$pdo->exec('CREATE TABLE spc_column_metadata_test (id INTEGER)');
$stmt = $pdo->query('SELECT id FROM spc_column_metadata_test');
if ($stmt === false) {
throw new RuntimeException('Failed to query SQLite metadata test table.');
}
$metadata = $stmt->getColumnMeta(0);
if (($metadata['table'] ?? null) !== 'spc_column_metadata_test') {
throw new RuntimeException('PDO SQLite column metadata does not include the origin table.');
}