Tags: illuminate/database
Tags
[13.x] feat: refresh configured model attributes after writes (#61523) * feat: refresh configured model attributes after writes Allow database-generated columns to be reloaded before model events without refreshing every attribute on the model. * add attribute --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
[13.x] Fix MariaDB vector distance SQL and add AsVector Eloquent cast…
… (#61337)
* Fix MariaDB vector distance SQL and add AsVector Eloquent cast
MariaDB's VEC_DISTANCE_* functions only accept VECTOR arguments, so the
JSON text bound by the vector query builder methods must be converted
with vec_fromtext(). Without it every whereVectorSimilarTo /
whereVectorDistanceLessThan / orderByVectorDistance / selectVectorDistance
call fails on MariaDB with "4079 Illegal parameter data type varchar for
operation 'VEC_DISTANCE_COSINE'".
Adds an AsVector cast so Eloquent models can read and write vector
columns: it decodes MariaDB's little-endian float32 bytes as well as
pgvector / vec_totext() JSON text, and writes vec_fromtext('[...]') on
MariaDB (which rejects text or raw bytes bound to a VECTOR column) or a
plain JSON string elsewhere.
* Update MariaDbGrammar.php
* formatting
---------
Co-authored-by: Taylor Otwell <taylor@laravel.com>
PreviousNext