laravel/framework · error · RuntimeException

This database driver does not support the vector type.

Error message

This database driver does not support the vector type.

What it means

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.

Solutions

  1. Run vector() migrations on Postgres or MySQL/MariaDB only.
  2. In tests, use a different column type (e.g. text/json) on SQLite, or run the test suite against Postgres.
  3. If you maintain a custom driver, override typeVector() in its grammar to emit the engine's vector/JSON column type.

Example fix

// before - throws on SQLite test DB
Schema::create('embeddings', function (Blueprint $t) {
    $t->vector('embedding', 1536);
});

// after - choose type by driver
Schema::create('embeddings', function (Blueprint $t) {
    if (in_array(config('database.default'), ['pgsql', 'mysql', 'mariadb'])) {
        $t->vector('embedding', 1536);
    } else {
        $t->json('embedding'); // store vectors as JSON on engines without a vector type
    }
});
Defensive patterns

Strategy: validation

Validate before calling

$driver = Schema::getConnection()->getDriverName();
if (! in_array($driver, ['pgsql', 'mysql', 'mariadb'], true)) {
    throw new \DomainException("vector() columns are unsupported on driver '{$driver}'.");
}

Type guard

function supportsVectorColumns(string $driverName): bool
{
    return in_array($driverName, ['pgsql', 'mysql', 'mariadb'], true);
}

Try / catch

try {
    Schema::create('docs', fn ($t) => $t->vector('embedding', 1536));
} catch (\RuntimeException $e) {
    if (str_contains($e->getMessage(), 'vector type')) {
        Schema::create('docs', fn ($t) => $t->json('embedding')); // store as JSON on unsupported engines
    } else {
        throw $e;
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of laravel/framework@e0f6eb3518 (2026-08-11). Data as JSON: /api/errors/4ce65fdbd831d673. Report an issue: GitHub.

Appendix: source

Thrown at src/Illuminate/Database/Schema/Grammars/Grammar.php:365

     *
     * @throws \RuntimeException
     */
    protected function typeComputed(Fluent $column)
    {
        throw new RuntimeException('This database driver does not support the computed type.');
    }

    /**
     * Create the column definition for a vector type.
     *
     * @param  \Illuminate\Support\Fluent  $column
     * @return string
     *
     * @throws \RuntimeException
     */
    protected function typeVector(Fluent $column)
    {
        throw new RuntimeException('This database driver does not support the vector type.');
    }

    /**
     * Create the column definition for a tsvector type.
     *
     * @param  \Illuminate\Support\Fluent  $column
     * @return string
     *
     * @throws \RuntimeException
     */
    protected function typeTsvector(Fluent $column)
    {
        throw new RuntimeException('This database driver does not support the tsvector type.');
    }

    /**
     * Create the column definition for a raw column type.
     *

View on GitHub (pinned to e0f6eb3518)