/* <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/lib.rs:17
-- bootstrap
-- List of shell types

CREATE TYPE sphere_vector;
/* </end connected objects> */

/* <begin connected objects> */
-- src/datatype/operators_pgvector_vector.rs:53
-- vchord::datatype::operators_pgvector_vector::_vchord_vector_sphere_cosine_in
CREATE  FUNCTION "_vchord_vector_sphere_cosine_in"(
    "lhs" vector, /* vchord::datatype::memory_pgvector_vector::PgvectorVectorInput */
    "rhs" sphere_vector /* pgrx::heap_tuple::PgHeapTuple<pgrx::pgbox::AllocatedByRust> */
) RETURNS bool /* bool */
IMMUTABLE STRICT PARALLEL SAFE
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', '_vchord_vector_sphere_cosine_in_wrapper';
/* </end connected objects> */

/* <begin connected objects> */
-- src/datatype/operators_pgvector_vector.rs:29
-- vchord::datatype::operators_pgvector_vector::_vchord_vector_sphere_ip_in
CREATE  FUNCTION "_vchord_vector_sphere_ip_in"(
    "lhs" vector, /* vchord::datatype::memory_pgvector_vector::PgvectorVectorInput */
    "rhs" sphere_vector /* pgrx::heap_tuple::PgHeapTuple<pgrx::pgbox::AllocatedByRust> */
) RETURNS bool /* bool */
IMMUTABLE STRICT PARALLEL SAFE
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', '_vchord_vector_sphere_ip_in_wrapper';
/* </end connected objects> */

/* <begin connected objects> */
-- src/datatype/operators_pgvector_vector.rs:5
-- vchord::datatype::operators_pgvector_vector::_vchord_vector_sphere_l2_in
CREATE  FUNCTION "_vchord_vector_sphere_l2_in"(
    "lhs" vector, /* vchord::datatype::memory_pgvector_vector::PgvectorVectorInput */
    "rhs" sphere_vector /* pgrx::heap_tuple::PgHeapTuple<pgrx::pgbox::AllocatedByRust> */
) RETURNS bool /* bool */
IMMUTABLE STRICT PARALLEL SAFE
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', '_vchord_vector_sphere_l2_in_wrapper';
/* </end connected objects> */

/* <begin connected objects> */
-- src/index/am.rs:29
-- vchord::index::am::_vchordrq_amhandler
/* </end connected objects> */

/* <begin connected objects> */
-- src/index/functions.rs:6
-- vchord::index::functions::_vchordrq_prewarm
/* </end connected objects> */

/* <begin connected objects> */
-- src/index/opclass.rs:11
-- vchord::index::opclass::_vchordrq_support_vector_cosine_ops
CREATE  FUNCTION "_vchordrq_support_vector_cosine_ops"() RETURNS TEXT /* alloc::string::String */
IMMUTABLE STRICT PARALLEL SAFE
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', '_vchordrq_support_vector_cosine_ops_wrapper';
/* </end connected objects> */

/* <begin connected objects> */
-- src/index/opclass.rs:6
-- vchord::index::opclass::_vchordrq_support_vector_ip_ops
CREATE  FUNCTION "_vchordrq_support_vector_ip_ops"() RETURNS TEXT /* alloc::string::String */
IMMUTABLE STRICT PARALLEL SAFE
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', '_vchordrq_support_vector_ip_ops_wrapper';
/* </end connected objects> */

/* <begin connected objects> */
-- src/index/opclass.rs:1
-- vchord::index::opclass::_vchordrq_support_vector_l2_ops
CREATE  FUNCTION "_vchordrq_support_vector_l2_ops"() RETURNS TEXT /* alloc::string::String */
IMMUTABLE STRICT PARALLEL SAFE
LANGUAGE c /* Rust */
AS 'MODULE_PATHNAME', '_vchordrq_support_vector_l2_ops_wrapper';
/* </end connected objects> */

/* <begin connected objects> */
-- src/lib.rs:18
-- finalize
-- List of data types

CREATE TYPE sphere_vector AS (
    center vector,
    radius REAL
);

-- List of operators

CREATE OPERATOR <<->> (
    PROCEDURE = _vchord_vector_sphere_l2_in,
    LEFTARG = vector,
    RIGHTARG = sphere_vector,
    COMMUTATOR = <<->>
);

CREATE OPERATOR <<#>> (
    PROCEDURE = _vchord_vector_sphere_ip_in,
    LEFTARG = vector,
    RIGHTARG = sphere_vector,
    COMMUTATOR = <<#>>
);

CREATE OPERATOR <<=>> (
    PROCEDURE = _vchord_vector_sphere_cosine_in,
    LEFTARG = vector,
    RIGHTARG = sphere_vector,
    COMMUTATOR = <<=>>
);

-- List of functions

CREATE FUNCTION sphere(vector, real) RETURNS sphere_vector
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)';

CREATE FUNCTION vchordrq_amhandler(internal) RETURNS index_am_handler
IMMUTABLE STRICT PARALLEL SAFE LANGUAGE c AS 'MODULE_PATHNAME', '_vchordrq_amhandler_wrapper';

CREATE FUNCTION vchordrq_prewarm(regclass, integer default 0) RETURNS TEXT
STRICT LANGUAGE c AS 'MODULE_PATHNAME', '_vchordrq_prewarm_wrapper';

-- List of access methods

CREATE ACCESS METHOD vchordrq TYPE INDEX HANDLER vchordrq_amhandler;

-- List of operator families

CREATE OPERATOR FAMILY vector_l2_ops USING vchordrq;
CREATE OPERATOR FAMILY vector_ip_ops USING vchordrq;
CREATE OPERATOR FAMILY vector_cosine_ops USING vchordrq;

-- List of operator classes

CREATE OPERATOR CLASS vector_l2_ops
    FOR TYPE vector USING vchordrq FAMILY vector_l2_ops AS
    OPERATOR 1 <-> (vector, vector) FOR ORDER BY float_ops,
    OPERATOR 2 <<->> (vector, sphere_vector) FOR SEARCH,
    FUNCTION 1 _vchordrq_support_vector_l2_ops();

CREATE OPERATOR CLASS vector_ip_ops
    FOR TYPE vector USING vchordrq FAMILY vector_ip_ops AS
    OPERATOR 1 <#> (vector, vector) FOR ORDER BY float_ops,
    OPERATOR 2 <<#>> (vector, sphere_vector) FOR SEARCH,
    FUNCTION 1 _vchordrq_support_vector_ip_ops();

CREATE OPERATOR CLASS vector_cosine_ops
    FOR TYPE vector USING vchordrq FAMILY vector_cosine_ops AS
    OPERATOR 1 <=> (vector, vector) FOR ORDER BY float_ops,
    OPERATOR 2 <<=>> (vector, sphere_vector) FOR SEARCH,
    FUNCTION 1 _vchordrq_support_vector_cosine_ops();
/* </end connected objects> */

