mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-24 05:43:58 +00:00
- Fix simsimd Option/Result type mismatch in scaled_dot.rs - Fix f32/f64 type conversions in poincare.rs and lorentz.rs - Fix AVX512 missing wrapper functions by using AVX2 fallback - Fix Vec<Vec<f32>> to JsonB for pgrx pg_extern compatibility - Fix DashMap get() to get_mut() for mutable access - Fix router.rs dereference for best_score comparison - Update Dockerfile to copy pre-written SQL file for pgrx - Simplify init.sql to use correct function names - Add postgres-cli npm package for CLI tooling All changes tested successfully in Docker with: - Extension loads with AVX2 SIMD support (8 floats/op) - Distance functions verified working - PostgreSQL 16 container runs successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.4 KiB
SQL
45 lines
1.4 KiB
SQL
-- RuVector-Postgres Initialization Script
|
|
-- Creates extension and verifies basic functionality
|
|
|
|
-- Create the extension
|
|
CREATE EXTENSION IF NOT EXISTS ruvector;
|
|
|
|
-- Create test schema
|
|
CREATE SCHEMA IF NOT EXISTS ruvector_test;
|
|
|
|
-- Test table for basic usage
|
|
CREATE TABLE ruvector_test.test_basic (
|
|
id SERIAL PRIMARY KEY,
|
|
name TEXT NOT NULL,
|
|
category TEXT,
|
|
metadata JSONB,
|
|
created_at TIMESTAMP DEFAULT NOW()
|
|
);
|
|
|
|
-- Grant permissions
|
|
GRANT ALL ON SCHEMA ruvector_test TO ruvector;
|
|
GRANT ALL ON ALL TABLES IN SCHEMA ruvector_test TO ruvector;
|
|
GRANT ALL ON ALL SEQUENCES IN SCHEMA ruvector_test TO ruvector;
|
|
|
|
-- Log initialization and test basic functions
|
|
DO $$
|
|
DECLARE
|
|
version_info TEXT;
|
|
simd_info TEXT;
|
|
BEGIN
|
|
-- Test version function
|
|
SELECT ruvector_version() INTO version_info;
|
|
RAISE NOTICE 'RuVector-Postgres initialized successfully';
|
|
RAISE NOTICE 'Extension version: %', version_info;
|
|
|
|
-- Test SIMD info function
|
|
SELECT ruvector_simd_info() INTO simd_info;
|
|
RAISE NOTICE 'SIMD info: %', simd_info;
|
|
|
|
-- Test distance functions with array functions
|
|
RAISE NOTICE 'Testing distance functions...';
|
|
RAISE NOTICE 'Inner product: %', inner_product_arr(ARRAY[1.0, 2.0, 3.0]::real[], ARRAY[1.0, 2.0, 3.0]::real[]);
|
|
RAISE NOTICE 'Cosine distance: %', cosine_distance_arr(ARRAY[1.0, 0.0, 0.0]::real[], ARRAY[0.0, 1.0, 0.0]::real[]);
|
|
|
|
RAISE NOTICE 'All basic tests passed!';
|
|
END $$;
|