Laravel 13 Adds Native Vector Search for MariaDB, MySQL Users Still Excluded
A pull request merged into Laravel's 13.x branch on August 20 extended the framework's native vector search capabilities — including methods like whereVectorSimilarTo and orderByVectorDistance — to MariaDB, after previously supporting only PostgreSQL with pgvector. The update refactored vector distance logic from a hardcoded PostgreSQL check in the query builder into driver-level grammar methods, making it easier to add support for additional databases. MariaDB gains this support because it ships a native vec_distance_cosine() function and VECTOR column type since version 11.7 Community. Standard MySQL installations remain unsupported because MySQL lacks a native vector distance function outside of Oracle's HeatWave and MySQL AI cloud offerings. Notably, the Laravel team chose to throw a clear RuntimeException rather than implement a silent in-memory PHP fallback, which would have broken pagination semantics and query performance guarantees.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in