{"id":"a83d6a795fb69e55","repo":"laravel/framework","slug":"this-database-driver-does-not-support-retrieving-t","errorCode":null,"errorMessage":"This database driver does not support retrieving tables.","messagePattern":"This database driver does not support retrieving tables\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/Schema/Grammars/Grammar.php","lineNumber":100,"sourceCode":"     * @param  string  $table\n     * @return string|null\n     */\n    public function compileTableExists($schema, $table)\n    {\n        //\n    }\n\n    /**\n     * Compile the query to determine the tables.\n     *\n     * @param  string|string[]|null  $schema\n     * @return string\n     *\n     * @throws \\RuntimeException\n     */\n    public function compileTables($schema)\n    {\n        throw new RuntimeException('This database driver does not support retrieving tables.');\n    }\n\n    /**\n     * Compile the query to determine the views.\n     *\n     * @param  string|string[]|null  $schema\n     * @return string\n     *\n     * @throws \\RuntimeException\n     */\n    public function compileViews($schema)\n    {\n        throw new RuntimeException('This database driver does not support retrieving views.');\n    }\n\n    /**\n     * Compile the query to determine the user-defined types.\n     *","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Database/Schema/Grammars/Grammar.php#L82-L118","documentation":"Base Grammar::compileTables() throws RuntimeException when the driver's grammar does not override it. compileTables produces the query behind Schema::getTableListing()/getTables(); all four first-class drivers override it, so hitting this usually means a custom/incomplete driver or a broken connection binding.","triggerScenarios":"Calling Schema::getTables(), Schema::getTableListing(), or hasTable() on a Connection whose schema grammar is the base Grammar or a subclass that did not override compileTables.","commonSituations":"A custom driver extending Grammar without implementing compileTables; an old/community driver behind the framework version in use.","solutions":["Switch to a first-class driver (mysql, pgsql, sqlite, sqlsrv) whose grammar implements compileTables.","If you maintain the driver, override compileTables($schema) with the engine's table-listing SQL.","Verify the connection key in config/database.php resolves to the intended driver, not a stub."],"exampleFix":"// before — 'custom' connection uses a Grammar that does not override compileTables\n$tables = Schema::connection('custom')->getTableListing();\n\n// after\nclass CustomGrammar extends \\Illuminate\\Database\\Schema\\Grammars\\Grammar\n{\n    public function compileTables($schema)\n    {\n        return 'select ... from information_schema.tables ...';\n    }\n}","handlingStrategy":"type-guard","validationCode":"$grammar = Schema::getConnection()->getSchemaGrammar();\nif ((new \\ReflectionMethod($grammar, 'compileTables'))->getDeclaringClass()->getName()\n    === \\Illuminate\\Database\\Schema\\Grammars\\Grammar::class) {\n    throw new \\RuntimeException('Table listing unsupported on '.DB::connection()->getDriverName());\n}\nreturn Schema::getTableListing();","typeGuard":"function driverSupportsTableListing(): bool\n{\n    $g = Schema::getConnection()->getSchemaGrammar();\n\n    return (new \\ReflectionMethod($g, 'compileTables'))\n        ->getDeclaringClass()->getName() !== \\Illuminate\\Database\\Schema\\Grammars\\Grammar::class;\n}","tryCatchPattern":"try {\n    $tables = Schema::getTableListing();\n} catch (\\RuntimeException $e) {\n    // custom/incomplete driver — surface to caller\n    throw $e;\n}","preventionTips":["Use a first-class driver for table introspection.","Implement compileTables on custom grammars.","Verify config/database.php connection bindings."],"tags":["schema","database","driver-support","grammar","catalogue"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}