{"record":{"id":"4ce65fdbd831d673","repo":"laravel/framework","slug":"this-database-driver-does-not-support-the-vector-t","errorCode":null,"errorMessage":"This database driver does not support the vector type.","messagePattern":"This database driver does not support the vector type\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/Schema/Grammars/Grammar.php","lineNumber":365,"sourceCode":"     *\n     * @throws \\RuntimeException\n     */\n    protected function typeComputed(Fluent $column)\n    {\n        throw new RuntimeException('This database driver does not support the computed type.');\n    }\n\n    /**\n     * Create the column definition for a vector type.\n     *\n     * @param  \\Illuminate\\Support\\Fluent  $column\n     * @return string\n     *\n     * @throws \\RuntimeException\n     */\n    protected function typeVector(Fluent $column)\n    {\n        throw new RuntimeException('This database driver does not support the vector type.');\n    }\n\n    /**\n     * Create the column definition for a tsvector type.\n     *\n     * @param  \\Illuminate\\Support\\Fluent  $column\n     * @return string\n     *\n     * @throws \\RuntimeException\n     */\n    protected function typeTsvector(Fluent $column)\n    {\n        throw new RuntimeException('This database driver does not support the tsvector type.');\n    }\n\n    /**\n     * Create the column definition for a raw column type.\n     *","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/laravel/framework/blob/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Database/Schema/Grammars/Grammar.php#L347-L383","documentation":"Grammar::typeVector() throws RuntimeException on the base; ONLY PostgresGrammar and MySqlGrammar override it (MariaDb inherits via MySql). SQLiteGrammar and SqlServerGrammar fall through to the throwing base. typeVector is the type-renderer invoked when a Blueprint defines a vector() column.","triggerScenarios":"Defining $table->vector('embedding', 1536) in a migration running on SQLite (common in test suites) or SQL Server. The Blueprint renders the column type by calling typeVector, which the base/SQLite/SQL Server grammar refuses.","commonSituations":"Postgres or MySQL production app with a SQLite test database; running vector-column migrations on an engine with no native vector type; refactoring a feature onto SQL Server.","solutions":["Run vector() migrations on Postgres or MySQL/MariaDB only.","In tests, use a different column type (e.g. text/json) on SQLite, or run the test suite against Postgres.","If you maintain a custom driver, override typeVector() in its grammar to emit the engine's vector/JSON column type."],"exampleFix":"// before - throws on SQLite test DB\nSchema::create('embeddings', function (Blueprint $t) {\n    $t->vector('embedding', 1536);\n});\n\n// after - choose type by driver\nSchema::create('embeddings', function (Blueprint $t) {\n    if (in_array(config('database.default'), ['pgsql', 'mysql', 'mariadb'])) {\n        $t->vector('embedding', 1536);\n    } else {\n        $t->json('embedding'); // store vectors as JSON on engines without a vector type\n    }\n});","handlingStrategy":"validation","validationCode":"$driver = Schema::getConnection()->getDriverName();\nif (! in_array($driver, ['pgsql', 'mysql', 'mariadb'], true)) {\n    throw new \\DomainException(\"vector() columns are unsupported on driver '{$driver}'.\");\n}","typeGuard":"function supportsVectorColumns(string $driverName): bool\n{\n    return in_array($driverName, ['pgsql', 'mysql', 'mariadb'], true);\n}","tryCatchPattern":"try {\n    Schema::create('docs', fn ($t) => $t->vector('embedding', 1536));\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'vector type')) {\n        Schema::create('docs', fn ($t) => $t->json('embedding')); // store as JSON on unsupported engines\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Use vector() columns only on Postgres or MySQL/MariaDB.","For SQLite test suites, substitute a JSON column or run tests against Postgres.","In shared migrations, branch the vector column definition on the connection driver."],"tags":["schema","grammar","database-driver","vector","postgres","mysql","runtime-exception"],"backgroundTag":null,"analyzedSha":"e0f6eb3518ac29fbbca8529e97d0df7fc9f24481","analyzedAt":"2026-08-11T20:52:37.562Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}