{"record":{"id":"ae66bf0a18afd359","repo":"symfony/http-foundation","slug":"creating-the-session-table-is-currently-not-implemented-for","errorCode":null,"errorMessage":"Creating the session table is currently not implemented for PDO driver \"%s\".","messagePattern":"Creating the session table is currently not implemented for PDO driver \"(.+?)\"\\.","errorType":"exception","errorClass":"DomainException","httpStatus":null,"severity":"error","filePath":"Session/Storage/Handler/PdoSessionHandler.php","lineNumber":249,"sourceCode":"                    ->addColumn(Column::editor()->setUnquotedName($this->lifetimeCol)->setTypeName(Types::INTEGER)->setNotNull(true)->create())\n                    ->addColumn(Column::editor()->setUnquotedName($this->timeCol)->setTypeName(Types::INTEGER)->setNotNull(true)->create());\n                break;\n            case 'oci':\n                $editor\n                    ->addColumn(Column::editor()->setUnquotedName($this->idCol)->setTypeName(Types::STRING)->setLength(128)->setNotNull(true)->create())\n                    ->addColumn(Column::editor()->setUnquotedName($this->dataCol)->setTypeName(Types::BLOB)->setNotNull(true)->create())\n                    ->addColumn(Column::editor()->setUnquotedName($this->lifetimeCol)->setTypeName(Types::INTEGER)->setNotNull(true)->create())\n                    ->addColumn(Column::editor()->setUnquotedName($this->timeCol)->setTypeName(Types::INTEGER)->setNotNull(true)->create());\n                break;\n            case 'sqlsrv':\n                $editor\n                    ->addColumn(Column::editor()->setUnquotedName($this->idCol)->setTypeName(Types::STRING)->setLength(128)->setNotNull(true)->create())\n                    ->addColumn(Column::editor()->setUnquotedName($this->dataCol)->setTypeName(Types::BLOB)->setNotNull(true)->create())\n                    ->addColumn(Column::editor()->setUnquotedName($this->lifetimeCol)->setTypeName(Types::INTEGER)->setUnsigned(true)->setNotNull(true)->create())\n                    ->addColumn(Column::editor()->setUnquotedName($this->timeCol)->setTypeName(Types::INTEGER)->setUnsigned(true)->setNotNull(true)->create());\n                break;\n            default:\n                throw new \\DomainException(\\sprintf('Creating the session table is currently not implemented for PDO driver \"%s\".', $this->driver));\n        }\n\n        return $editor\n            ->addPrimaryKeyConstraint(new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted($this->idCol))], true))\n            ->addIndex(Index::editor()->setUnquotedName($this->lifetimeCol.'_idx')->setUnquotedColumnNames($this->lifetimeCol)->create())\n            ->create();\n    }\n\n    /**\n     * To be removed when doctrine/dbal minimum is bumped to ^4.5.\n     */\n    private function configureSchemaTable(Table $table): void\n    {\n        switch ($this->driver) {\n            case 'mysql':\n                $table->addColumn($this->idCol, Types::BINARY, ['length' => 128, 'notnull' => true]);\n                $table->addColumn($this->dataCol, Types::BLOB, ['notnull' => true]);\n                $table->addColumn($this->lifetimeCol, Types::INTEGER, ['unsigned' => true, 'notnull' => true]);","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/symfony/http-foundation/blob/5aea19cd678fa4140f6108406f1096de5e9ed6e4/Session/Storage/Handler/PdoSessionHandler.php#L231-L267","documentation":"PdoSessionHandler::buildSchemaTable() builds the session table schema via a Dbal schema editor only for a known set of PDO drivers (mysql, sqlite, pgsql, oci, sqlsrv). When $this->driver falls outside that switch, a DomainException is thrown because column types/DDL differ per driver and no generic fallback exists.","triggerScenarios":"Instantiating PdoSessionHandler with a PDO DSN whose driver name is not one of mysql/sqlite/pgsql/oci/sqlsrv (e.g. an unfamiliar or aliased driver string) while using the DBAL-based schema creation path (configureSchema -> buildSchemaTable).","commonSituations":"Using a driver name with different casing or an alias not normalized (e.g. 'mssql' instead of 'sqlsrv', 'postgres' instead of 'pgsql'), or a less common PDO driver like ibm/odbc with a DSN passed directly instead of a URL.","solutions":["Use a supported driver: mysql, sqlite, pgsql, oci, or sqlsrv in your PDO DSN","If using an alias driver name, pass the URL form (database_url style) so buildDsnFromUrl normalizes aliases (mssql->sqlsrv, postgres->pgsql, mysql2->mysql)","Normalize the driver name yourself before constructing the handler, or override/extend the handler to implement the schema for your driver"],"exampleFix":"// before\n$pdo = new \\PDO('odbc:DSN=mydb');\n$handler = new \\PdoSessionHandler($pdo);\n// after\n$pdo = new \\PDO('mysql:host=localhost;dbname=mydb', $user, $pass);\n$handler = new \\PdoSessionHandler($pdo);","handlingStrategy":"validation","validationCode":"$supported = ['mysql','sqlite','pgsql','oci','sqlsrv'];\nif (!in_array($driverName, $supported, true)) {\n    throw new \\LogicException(sprintf('Driver \"%s\" unsupported by PdoSessionHandler; use one of: %s', $driverName, implode(',', $supported)));\n}","typeGuard":"$driverName = (parse_url($url, PHP_URL_SCHEME) ?: substr($dsn, 0, strpos($dsn, ':')));\nif (!is_string($driverName) || $driverName === '') { /* reject */ }","tryCatchPattern":null,"preventionTips":["Verify the driver portion of your PDO DSN before constructing the handler","Prefer URL configuration so aliases (postgres, mssql, mysql2) are normalized automatically","Create the session table via migrations rather than runtime schema building for exotic drivers"],"tags":["pdo","sessions","database","unsupported-driver"],"backgroundTag":"unsupported-enum-value","analyzedSha":"5aea19cd678fa4140f6108406f1096de5e9ed6e4","analyzedAt":"2026-09-13T01:52:22.855Z","contentChangedAt":"2026-09-13T01:52:22.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}