From 04e1d1309b2e1c70e1e979c49d71b3f499cf5853 Mon Sep 17 00:00:00 2001 From: Matvey Arye Date: Thu, 8 Aug 2024 22:10:29 -0400 Subject: [PATCH] Prepare 0.3.0 --- pgvectorscale/Cargo.toml | 2 +- .../sql/vectorscale--0.0.2--0.2.0.sql | 4 +- .../sql/vectorscale--0.0.2--0.3.0.sql | 1 + .../sql/vectorscale--0.2.0--0.3.0.sql | 50 +++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) create mode 120000 pgvectorscale/sql/vectorscale--0.0.2--0.3.0.sql create mode 100644 pgvectorscale/sql/vectorscale--0.2.0--0.3.0.sql diff --git a/pgvectorscale/Cargo.toml b/pgvectorscale/Cargo.toml index 0832337..273b653 100644 --- a/pgvectorscale/Cargo.toml +++ b/pgvectorscale/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vectorscale" -version = "0.2.0" +version = "0.3.0" edition = "2021" [lib] diff --git a/pgvectorscale/sql/vectorscale--0.0.2--0.2.0.sql b/pgvectorscale/sql/vectorscale--0.0.2--0.2.0.sql index 24e5ddb..bc7d782 100644 --- a/pgvectorscale/sql/vectorscale--0.0.2--0.2.0.sql +++ b/pgvectorscale/sql/vectorscale--0.0.2--0.2.0.sql @@ -12,7 +12,7 @@ ALTER FUNCTION tsv_amhandler(internal) RENAME TO diskann_amhandler; -- src/access_method/mod.rs:48 -- pgvectorscale::access_method::amhandler - CREATE OR REPLACE FUNCTION diskann_amhandler(internal) RETURNS index_am_handler PARALLEL SAFE IMMUTABLE STRICT COST 0.0001 LANGUAGE c AS '$libdir/pgvectorscale-0.0.3-dev', 'amhandler_wrapper'; + CREATE OR REPLACE FUNCTION diskann_amhandler(internal) RETURNS index_am_handler PARALLEL SAFE IMMUTABLE STRICT COST 0.0001 LANGUAGE c AS '$libdir/vectorscale-0.2.0', 'amhandler_wrapper'; DO $$ DECLARE @@ -50,4 +50,4 @@ BEGIN OPERATOR 1 <=> (vector, vector) FOR ORDER BY float_ops; END IF; END; -$$; \ No newline at end of file +$$; diff --git a/pgvectorscale/sql/vectorscale--0.0.2--0.3.0.sql b/pgvectorscale/sql/vectorscale--0.0.2--0.3.0.sql new file mode 120000 index 0000000..9431f64 --- /dev/null +++ b/pgvectorscale/sql/vectorscale--0.0.2--0.3.0.sql @@ -0,0 +1 @@ +vectorscale--0.2.0--0.3.0.sql \ No newline at end of file diff --git a/pgvectorscale/sql/vectorscale--0.2.0--0.3.0.sql b/pgvectorscale/sql/vectorscale--0.2.0--0.3.0.sql new file mode 100644 index 0000000..4b13927 --- /dev/null +++ b/pgvectorscale/sql/vectorscale--0.2.0--0.3.0.sql @@ -0,0 +1,50 @@ +/* +This file is auto generated by pgrx. + +The ordering of items is not stable, it is driven by a dependency graph. +*/ + +-- src/access_method/mod.rs:44 +-- vectorscale::access_method::amhandler + + CREATE OR REPLACE FUNCTION diskann_amhandler(internal) RETURNS index_am_handler PARALLEL SAFE IMMUTABLE STRICT COST 0.0001 LANGUAGE c AS '$libdir/vectorscale-0.3.0', 'amhandler_wrapper'; + + DO $$ + DECLARE + c int; + BEGIN + SELECT count(*) + INTO c + FROM pg_catalog.pg_am a + WHERE a.amname = 'diskann'; + + IF c = 0 THEN + CREATE ACCESS METHOD diskann TYPE INDEX HANDLER diskann_amhandler; + END IF; + END; + $$; + + + + +-- src/access_method/mod.rs:89 + +DO $$ +DECLARE + c int; +BEGIN + SELECT count(*) + INTO c + FROM pg_catalog.pg_opclass c + WHERE c.opcname = 'vector_cosine_ops' + AND c.opcmethod = (SELECT oid FROM pg_catalog.pg_am am WHERE am.amname = 'diskann'); + + IF c = 0 THEN + CREATE OPERATOR CLASS vector_cosine_ops DEFAULT + FOR TYPE vector USING diskann AS + OPERATOR 1 <=> (vector, vector) FOR ORDER BY float_ops; + END IF; +END; +$$; + +