Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cevian committed Oct 10, 2024
1 parent 008a83c commit 9b7fa18
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions pgvectorscale/sql/vectorscale--0.0.2--0.4.0.sql
1 change: 1 addition & 0 deletions pgvectorscale/sql/vectorscale--0.2.0--0.4.0.sql
55 changes: 55 additions & 0 deletions pgvectorscale/sql/vectorscale--0.3.0--0.4.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* <begin connected objects> */
/*
This file is auto generated by pgrx.
The ordering of items is not stable, it is driven by a dependency graph.
*/
/* </end connected objects> */

/* <begin connected objects> */
-- src/access_method/mod.rs:26
-- 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.4.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;
$$;
/* </end connected objects> */

/* <begin connected objects> */
-- src/access_method/mod.rs:89
-- requires:
-- amhandler


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;
$$;
/* </end connected objects> */

0 comments on commit 9b7fa18

Please sign in to comment.