postgresqlPackages.pgvecto-rs: drop
Package is unmaintained and has been replaced by vectorchord.
This commit is contained in:
@@ -23,4 +23,5 @@ in
|
||||
// lib.optionalAttrs config.allowAliases {
|
||||
cstore_fdw = throw "PostgreSQL extension `cstore_fdw` has been removed due to being broken for more than a year; see RFC 180"; # Added 2026-02-05
|
||||
pg_embedding = throw "PostgreSQL extension `pg_embedding` has been removed since the project has been abandoned. Upstream's recommendation is to use pgvector instead (https://neon.tech/docs/extensions/pg_embedding#migrate-from-pg_embedding-to-pgvector)";
|
||||
pgvecto-rs = throw "PostgreSQL extension `pgvecto-rs` has been removed since the project has been abandoned. Upstream's recommendation is to use vectorchord instead (https://docs.vectorchord.ai/vectorchord/admin/migration.html#from-pgvecto-rs) "; # Added 2026-03-13
|
||||
}
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
diff --git a/crates/c/build.rs b/crates/c/build.rs
|
||||
index 8d822e5..8b7e371 100644
|
||||
--- a/crates/c/build.rs
|
||||
+++ b/crates/c/build.rs
|
||||
@@ -1,9 +1,13 @@
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=src/f16.h");
|
||||
println!("cargo:rerun-if-changed=src/f16.c");
|
||||
+ println!("cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS");
|
||||
cc::Build::new()
|
||||
- .compiler("clang-16")
|
||||
+ .compiler("@clang@")
|
||||
.file("./src/f16.c")
|
||||
+ // read env var set by rustPlatform.bindgenHook
|
||||
+ .try_flags_from_environment("BINDGEN_EXTRA_CLANG_ARGS")
|
||||
+ .expect("the BINDGEN_EXTRA_CLANG_ARGS environment variable must be specified and UTF-8")
|
||||
.opt_level(3)
|
||||
.debug(true)
|
||||
.compile("vectorsc");
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs
|
||||
index 18172b9..6fc7e82 100644
|
||||
--- a/crates/common/src/lib.rs
|
||||
+++ b/crates/common/src/lib.rs
|
||||
@@ -1,3 +1,4 @@
|
||||
+#![warn(dangerous_implicit_autorefs)]
|
||||
pub mod clean;
|
||||
pub mod dir_ops;
|
||||
pub mod file_atomic;
|
||||
diff --git a/src/lib.rs b/src/lib.rs
|
||||
index 068c65d..82609e9 100644
|
||||
--- a/src/lib.rs
|
||||
+++ b/src/lib.rs
|
||||
@@ -6,6 +6,7 @@
|
||||
#![allow(clippy::needless_range_loop)]
|
||||
#![allow(clippy::single_match)]
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
+#![warn(dangerous_implicit_autorefs)]
|
||||
|
||||
mod bgworker;
|
||||
mod datatype;
|
||||
@@ -1,119 +0,0 @@
|
||||
{
|
||||
buildPgrxExtension,
|
||||
cargo-pgrx_0_12_0_alpha_1,
|
||||
clang,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
nix-update-script,
|
||||
openssl,
|
||||
pkg-config,
|
||||
postgresql,
|
||||
postgresqlTestExtension,
|
||||
replaceVars,
|
||||
}:
|
||||
|
||||
buildPgrxExtension (finalAttrs: {
|
||||
inherit postgresql;
|
||||
cargo-pgrx = cargo-pgrx_0_12_0_alpha_1;
|
||||
|
||||
pname = "pgvecto-rs";
|
||||
version = "0.3.0";
|
||||
|
||||
buildInputs = [ openssl ];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
patches = [
|
||||
# Tell the `c` crate to use the flags from the rust bindgen hook
|
||||
(replaceVars ./0001-read-clang-flags-from-environment.diff {
|
||||
clang = lib.getExe clang;
|
||||
})
|
||||
# Rust 1.89 denies implicit autorefs by default, making the compilation fail.
|
||||
# This restores the behaviour of previous rust versions by making the lint throw a warning instead.
|
||||
./0002-allow-dangerous-implicit-autorefs.diff
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tensorchord";
|
||||
repo = "pgvecto.rs";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-X7BY2Exv0xQNhsS/GA7GNvj9OeVDqVCd/k3lUkXtfgE=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-8otJ1uqGrCmlxAqvfAL3OjhBI4I6dAu6EoajstO46Sw=";
|
||||
|
||||
# Set appropriate version on vectors.control, otherwise it won't show up on PostgreSQL
|
||||
postPatch = ''
|
||||
substituteInPlace ./vectors.control --subst-var-by CARGO_VERSION ${finalAttrs.version}
|
||||
'';
|
||||
|
||||
# Include upgrade scripts in the final package
|
||||
# https://github.com/tensorchord/pgvecto.rs/blob/v0.2.0/scripts/ci_package.sh#L6-L8
|
||||
postInstall = ''
|
||||
cp sql/upgrade/* $out/share/postgresql/extension/
|
||||
'';
|
||||
|
||||
env = {
|
||||
# Needed to get openssl-sys to use pkg-config.
|
||||
OPENSSL_NO_VENDOR = 1;
|
||||
|
||||
# Bypass rust nightly features not being available on rust stable
|
||||
RUSTC_BOOTSTRAP = 1;
|
||||
};
|
||||
|
||||
# This crate does not have the "pg_test" feature
|
||||
usePgTestCheckFeature = false;
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
tests.extension = postgresqlTestExtension {
|
||||
inherit (finalAttrs) finalPackage;
|
||||
postgresqlExtraSettings = ''
|
||||
shared_preload_libraries='vectors'
|
||||
'';
|
||||
sql = ''
|
||||
CREATE EXTENSION vectors;
|
||||
|
||||
CREATE TABLE items (
|
||||
id bigserial PRIMARY KEY,
|
||||
content text NOT NULL,
|
||||
embedding vectors.vector(3) NOT NULL -- 3 dimensions
|
||||
);
|
||||
|
||||
INSERT INTO items (content, embedding) VALUES
|
||||
('a fat cat sat on a mat and ate a fat rat', '[1, 2, 3]'),
|
||||
('a fat dog sat on a mat and ate a fat rat', '[4, 5, 6]'),
|
||||
('a thin cat sat on a mat and ate a thin rat', '[7, 8, 9]'),
|
||||
('a thin dog sat on a mat and ate a thin rat', '[10, 11, 12]');
|
||||
'';
|
||||
asserts = [
|
||||
{
|
||||
query = "SELECT default_version FROM pg_available_extensions WHERE name = 'vectors'";
|
||||
expected = "'${finalAttrs.version}'";
|
||||
description = "Extension vectors has correct version.";
|
||||
}
|
||||
{
|
||||
query = "SELECT COUNT(embedding) FROM items WHERE to_tsvector('english', content) @@ 'cat & rat'::tsquery";
|
||||
expected = "2";
|
||||
description = "Stores and returns vectors.";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
# Upstream removed support for PostgreSQL 13 on 0.3.0: https://github.com/tensorchord/pgvecto.rs/issues/343
|
||||
broken =
|
||||
(lib.versionOlder postgresql.version "14")
|
||||
||
|
||||
# PostgreSQL 17 support issue upstream: https://github.com/tensorchord/pgvecto.rs/issues/607
|
||||
# Check after next package update.
|
||||
lib.versionAtLeast postgresql.version "17" && finalAttrs.version == "0.3.0";
|
||||
description = "Scalable, Low-latency and Hybrid-enabled Vector Search in Postgres";
|
||||
homepage = "https://github.com/tensorchord/pgvecto.rs";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [
|
||||
diogotcorreia
|
||||
esclear
|
||||
];
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user