{"record":{"id":"021a40e9ff45876a","repo":"flarum/framework","slug":"unsupported-database-driver-drivername","errorCode":null,"errorMessage":"Unsupported database driver: {driverName}","messagePattern":"Unsupported database driver: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Post/Filter/FulltextFilter.php","lineNumber":41,"sourceCode":"{\n    public function __construct(\n        protected SettingsRepositoryInterface $settings\n    ) {\n    }\n\n    public function search(SearchState $state, string $value): void\n    {\n        if ($this->settings->get('search_cjk_mode')) {\n            $this->like($state, $value);\n\n            return;\n        }\n\n        match ($state->getQuery()->getConnection()->getDriverName()) {\n            'mysql', 'mariadb' => $this->mysql($state, $value),\n            'pgsql' => $this->pgsql($state, $value),\n            'sqlite' => $this->sqlite($state, $value),\n            default => throw new RuntimeException('Unsupported database driver: '.$state->getQuery()->getConnection()->getDriverName()),\n        };\n    }\n\n    protected function sqlite(DatabaseSearchState $state, string $value): void\n    {\n        $this->like($state, $value);\n    }\n\n    protected function like(DatabaseSearchState $state, string $value): void\n    {\n        $state->getQuery()->where('content', 'like', \"%$value%\");\n    }\n\n    protected function mysql(DatabaseSearchState $state, string $value): void\n    {\n        $query = $state->getQuery();\n\n        // Replace all non-word characters with spaces.","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Post/Filter/FulltextFilter.php#L23-L59","documentation":"Flarum's FulltextFilter dispatches the search filter to a driver-specific implementation via a match expression over the connection driver name; any driver other than mysql/mariadb/pgsql/sqlite hits the default arm and throws a RuntimeException. The library only ships fulltext search backends for the built-in drivers. The offending driver name is included in the message.","triggerScenarios":"Performing a search (filter[q]) on a connection whose getDriverName() returns something else — e.g. a custom third-party database driver (sqlsrv, oracle, mongodb bridge) registered on the Flarum forum connection.","commonSituations":"Installing a community database-driver extension and then searching; tests running against an unsupported driver; misconfiguring config.php with an unsupported driver string that some connector accepts.","solutions":["Use one of the supported drivers (mysql, mariadb, pgsql, sqlite) for the forum database","Remove or disable the third-party driver extension that overrides the default connection","Implement a matching fulltext filter path in the custom driver's integration, or contribute driver support upstream"],"exampleFix":"// before (config.php)\n'driver' => 'sqlsrv', // unsupported fulltext search\n// after\n'driver' => 'mysql',","handlingStrategy":"try-catch","validationCode":"$driver = $state->getQuery()->getConnection()->getDriverName();\nif (!in_array($driver, ['mysql','mariadb','pgsql','sqlite'], true)) { /* disable search filter or fall back */ }","typeGuard":null,"tryCatchPattern":"try { $filter->filter($state, $value); } catch (RuntimeException $e) { Log::warning($e->getMessage()); fall back to LIKE-based search; }","preventionTips":["Only register the fulltext search filter for supported drivers","Document driver requirements in third-party database driver extensions","Add integration tests running search on each supported driver"],"tags":["search","database-driver","unsupported-driver","fulltext"],"backgroundTag":"unsupported-operation","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}