{"id":"a0329285470fa719","repo":"laravel/framework","slug":"this-database-driver-does-not-support-retrieving-i","errorCode":null,"errorMessage":"This database driver does not support retrieving indexes.","messagePattern":"This database driver does not support retrieving indexes\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/Schema/Grammars/Grammar.php","lineNumber":154,"sourceCode":"     * @throws \\RuntimeException\n     */\n    public function compileColumns($schema, $table)\n    {\n        throw new RuntimeException('This database driver does not support retrieving columns.');\n    }\n\n    /**\n     * Compile the query to determine the indexes.\n     *\n     * @param  string|null  $schema\n     * @param  string  $table\n     * @return string\n     *\n     * @throws \\RuntimeException\n     */\n    public function compileIndexes($schema, $table)\n    {\n        throw new RuntimeException('This database driver does not support retrieving indexes.');\n    }\n\n    /**\n     * Compile a vector index key command.\n     *\n     * @param  \\Illuminate\\Database\\Schema\\Blueprint  $blueprint\n     * @param  \\Illuminate\\Support\\Fluent  $command\n     * @return void\n     *\n     * @throws \\RuntimeException\n     */\n    public function compileVectorIndex(Blueprint $blueprint, Fluent $command)\n    {\n        throw new RuntimeException('The database driver in use does not support vector indexes.');\n    }\n\n    /**\n     * Compile the query to determine the foreign keys.","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Database/Schema/Grammars/Grammar.php#L136-L172","documentation":"Base Grammar::compileIndexes() throws RuntimeException when the driver's grammar does not override it. It powers Schema::getIndexes(); all first-class drivers implement it, so this surfaces only for a custom/incomplete grammar.","triggerScenarios":"Calling Schema::getIndexes($table) on a connection whose grammar lacks the override; introspection tooling running against a stub driver.","commonSituations":"Custom driver not implementing compileIndexes; outdated community driver behind the framework version.","solutions":["Use a first-class driver (mysql, pgsql, sqlite, sqlsrv).","Implement compileIndexes($schema, $table) on your custom grammar.","Verify the connection binding in config/database.php."],"exampleFix":"// before\n$indexes = Schema::connection('custom')->getIndexes('users');\n\n// after — implement on custom grammar\npublic function compileIndexes($schema, $table)\n{\n    return 'select ... from information_schema.statistics ...';\n}","handlingStrategy":"type-guard","validationCode":"$grammar = Schema::getConnection()->getSchemaGrammar();\nif ((new \\ReflectionMethod($grammar, 'compileIndexes'))->getDeclaringClass()->getName()\n    === \\Illuminate\\Database\\Schema\\Grammars\\Grammar::class) {\n    throw new \\RuntimeException('Index listing unsupported on '.DB::connection()->getDriverName());\n}\nreturn Schema::getIndexes($table);","typeGuard":"function driverSupportsIndexListing(): bool\n{\n    $g = Schema::getConnection()->getSchemaGrammar();\n\n    return (new \\ReflectionMethod($g, 'compileIndexes'))\n        ->getDeclaringClass()->getName() !== \\Illuminate\\Database\\Schema\\Grammars\\Grammar::class;\n}","tryCatchPattern":"try {\n    $indexes = Schema::getIndexes($table);\n} catch (\\RuntimeException $e) {\n    $indexes = [];\n}","preventionTips":["Use a first-class driver for index introspection.","Implement compileIndexes on custom grammars.","Verify connection bindings."],"tags":["schema","database","driver-support","grammar","indexes","catalogue"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}