v0.31.0-beta #2367
AndriiSherman
announced in
Announcements
v0.31.0-beta
#2367
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Breaking changes
PostgreSQL indexes API was changed
The previous Drizzle+PostgreSQL indexes API was incorrect and was not aligned with the PostgreSQL documentation. The good thing is that it was not used in queries, and drizzle-kit didn't support all properties for indexes. This means we can now change the API to the correct one and provide full support for it in drizzle-kit
Previous API
.on
..using
and.on
in our case are the same thing, so the API is incorrect here..asc()
,.desc()
,.nullsFirst()
, and.nullsLast()
should be specified for each column or expression on indexes, but not on an index itself.Current API
New Features
🎉 "pg_vector" extension support
You can now specify indexes for
pg_vector
and utilizepg_vector
functions for querying, ordering, etc.Let's take a few examples of
pg_vector
indexes from thepg_vector
docs and translate them to DrizzleL2 distance, Inner product and Cosine distance
L1 distance, Hamming distance and Jaccard distance - added in pg_vector 0.7.0 version
For queries, you can use predefined functions for vectors or create custom ones using the SQL template operator.
You can also use the following helpers:
If
pg_vector
has some other functions to use, you can replicate implimentation from existing one we have. Here is how it can be doneName it as you wish and change the operator. This example allows for a numbers array, strings array, string, or even a select query. Feel free to create any other type you want or even contribute and submit a PR
Examples
Let's take a few examples of
pg_vector
queries from thepg_vector
docs and translate them to DrizzleThis discussion was created from the release v0.31.0-beta.
Beta Was this translation helpful? Give feedback.
All reactions