db-pgsql icon indicating copy to clipboard operation
db-pgsql copied to clipboard

Schema not loading with `PDO::ATTR_STRINGIFY_FETCHES => true`

Open Tigrov opened this issue 2 years ago • 0 comments

$dsn = (new Dsn('pgsql', '127.0.0.1'))->asString();
$pdoDriver = new Driver($dsn, 'postgres', '', [\PDO::ATTR_STRINGIFY_FETCHES => true]);
$schemaCache = new SchemaCache(new FileCache(__DIR__ . '/runtime/cache'));
$db = new Connection($pdoDriver, $schemaCache);
$schema = $db->getSchema();
$tableSchema = $schema->getTableSchema('table_name', true);

The result is TypeError: Yiisoft\Db\Schema\AbstractColumnSchema::allowNull(): Argument #1 ($value) must be of type bool, string given, called in ...\db-pgsql\src\Schema.php on line 775

Tigrov avatar Aug 25 '23 05:08 Tigrov