From c5a21b29a6ad68bc35025e235e7ff230f17d855d Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Tue, 22 Oct 2024 12:11:04 +0300 Subject: [PATCH 1/4] update test for new example table --- README.md | 4 ++-- docs/examples/scheduling.md | 4 ++-- extension/tests/integration_tests.rs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index de6f9e8..26f3d30 100644 --- a/README.md +++ b/README.md @@ -244,8 +244,8 @@ Alternatively, `schedule => 'realtime` creates triggers on the source table and Statements below would will result in new embeddings being generated either immediately (`schedule => 'realtime'`) or within the cron schedule set in the `schedule` parameter. ```sql -INSERT INTO products (product_id, product_name, description) -VALUES (12345, 'pizza', 'dish of Italian origin consisting of a flattened disk of bread'); +INSERT INTO products (product_id, product_name, description, product_category, price) +VALUES (12345, 'pizza', 'dish of Italian origin consisting of a flattened disk of bread', 'food', 5.99); UPDATE products SET description = 'sling made of fabric, rope, or netting, suspended between two or more points, used for swinging, sleeping, or resting' diff --git a/docs/examples/scheduling.md b/docs/examples/scheduling.md index b77873c..b964bb0 100644 --- a/docs/examples/scheduling.md +++ b/docs/examples/scheduling.md @@ -9,8 +9,8 @@ Alternatively, `schedule => 'realtime` creates triggers on the source table and Statements below would will result in new embeddings being generated either immediately (`schedule => 'realtime'`) or within the cron schedule set in the `schedule` parameter. ```sql -INSERT INTO products (product_id, product_name, description) -VALUES (12345, 'pizza', 'dish of Italian origin consisting of a flattened disk of bread'); +INSERT INTO products (product_id, product_name, description, product_category, price) +VALUES (12345, 'pizza', 'dish of Italian origin consisting of a flattened disk of bread', 'food', 5.99); UPDATE products SET description = 'sling made of fabric, rope, or netting, suspended between two or more points, used for swinging, sleeping, or resting' diff --git a/extension/tests/integration_tests.rs b/extension/tests/integration_tests.rs index 02cb904..6361682 100644 --- a/extension/tests/integration_tests.rs +++ b/extension/tests/integration_tests.rs @@ -166,8 +166,8 @@ async fn test_realtime_job() { let random_product_id = rng.gen_range(0..100000); let insert_query = format!( - "INSERT INTO \"{test_table_name}\"(product_id, product_name, description) - VALUES ({random_product_id}, 'car tester', $$a product for testing car's components$$);" + "INSERT INTO \"{test_table_name}\"(product_id, product_name, description, product_category, price) + VALUES ({random_product_id}, 'car tester', $$a product for testing car's components$$, 'electronics', 10.99);" ); // insert a new row @@ -198,8 +198,8 @@ async fn test_realtime_job() { let random_product_id = rng.gen_range(0..100000); let insert_query = format!( - "INSERT INTO \"{test_table_name}\"(product_id, product_name, description) - VALUES ({random_product_id}, 'messy-product', $DELIM$the $$quick brown fox jump's over the lazy dog$DELIM$);" + "INSERT INTO \"{test_table_name}\"(product_id, product_name, description, product_category, price) + VALUES ({random_product_id}, 'messy-product', $DELIM$the $$quick brown fox jump's over the lazy dog$DELIM$, 'product', 10.99);" ); // insert a new row @@ -332,8 +332,8 @@ async fn test_static() { let random_product_id = rng.gen_range(1..100000); let insert_query = format!( - "INSERT INTO \"{test_table_name}\"(product_id, product_name, description) - VALUES ({random_product_id}, 'car tester', 'a product for testing cars');" + "INSERT INTO \"{test_table_name}\"(product_id, product_name, description, product_category, price) + VALUES ({random_product_id}, 'car tester', 'a product for testing cars', 'electronics', 10.99);" ); // insert a new row @@ -424,8 +424,8 @@ async fn test_realtime_tabled() { // insert a new row let insert_query = format!( - "INSERT INTO \"{test_table_name}\"(product_id, product_name, description) - VALUES ({random_product_id}, 'car tester', 'a product for testing cars');" + "INSERT INTO \"{test_table_name}\"(product_id, product_name, description, product_category, price) + VALUES ({random_product_id}, 'car tester', 'a product for testing cars', 'electronics', 10.99);" ); let _result = sqlx::query(&insert_query) .execute(&conn) From bc5c156237955282d40a4f3e4b7c26f481b8e168 Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Tue, 22 Oct 2024 12:25:54 +0300 Subject: [PATCH 2/4] add missing migration sql --- .github/workflows/extension_upgrade.yml | 4 ++-- extension/sql/vectorize--0.18.3--0.19.0.sql | 0 extension/sql/vectorize--0.19.0--0.19.1.sql | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 extension/sql/vectorize--0.18.3--0.19.0.sql create mode 100644 extension/sql/vectorize--0.19.0--0.19.1.sql diff --git a/.github/workflows/extension_upgrade.yml b/.github/workflows/extension_upgrade.yml index 479a65e..ff8a570 100644 --- a/.github/workflows/extension_upgrade.yml +++ b/.github/workflows/extension_upgrade.yml @@ -16,7 +16,7 @@ on: jobs: test: name: Upgrade Test - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 services: vector-serve: image: quay.io/tembo/vector-serve:latest @@ -43,7 +43,7 @@ jobs: run: echo "CI_BRANCH=$(git name-rev --name-only HEAD)" >> $GITHUB_OUTPUT - name: Install sys dependencies run: | - sudo apt-get update && sudo apt-get install -y postgresql-server-dev-16 libopenblas-dev libreadline-dev + sudo apt-get update && sudo apt-get install -y postgresql-server-dev-15 libopenblas-dev libreadline-dev - uses: ./.github/actions/pgx-init with: working-directory: ./extension diff --git a/extension/sql/vectorize--0.18.3--0.19.0.sql b/extension/sql/vectorize--0.18.3--0.19.0.sql new file mode 100644 index 0000000..e69de29 diff --git a/extension/sql/vectorize--0.19.0--0.19.1.sql b/extension/sql/vectorize--0.19.0--0.19.1.sql new file mode 100644 index 0000000..56cf6dd --- /dev/null +++ b/extension/sql/vectorize--0.19.0--0.19.1.sql @@ -0,0 +1,2 @@ +ALTER TABLE vectorize.example_products ADD COLUMN product_category TEXT NOT NULL; +ALTER TABLE vectorize.example_products ADD COLUMN price DECIMAL(10, 2) NOT NULL; \ No newline at end of file From 4a7b913b7818bd4f50a93c30f9279338ddda787a Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Tue, 22 Oct 2024 12:26:40 +0300 Subject: [PATCH 3/4] update versions --- extension/Cargo.toml | 2 +- extension/Trunk.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/Cargo.toml b/extension/Cargo.toml index 3a2e328..cc2bcfa 100644 --- a/extension/Cargo.toml +++ b/extension/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vectorize" -version = "0.19.0" +version = "0.19.1" edition = "2021" publish = false diff --git a/extension/Trunk.toml b/extension/Trunk.toml index 164d00d..472d5d5 100644 --- a/extension/Trunk.toml +++ b/extension/Trunk.toml @@ -6,7 +6,7 @@ description = "The simplest way to orchestrate vector search on Postgres." homepage = "https://github.com/tembo-io/pg_vectorize" documentation = "https://github.com/tembo-io/pg_vectorize" categories = ["orchestration", "machine_learning"] -version = "0.19.0" +version = "0.19.1" loadable_libraries = [{ library_name = "vectorize", requires_restart = true }] [build] From d3cd89d35f9442759b5265225902280650870b6d Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Tue, 22 Oct 2024 12:30:59 +0300 Subject: [PATCH 4/4] pg16 --- .github/workflows/extension_upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extension_upgrade.yml b/.github/workflows/extension_upgrade.yml index ff8a570..48f9461 100644 --- a/.github/workflows/extension_upgrade.yml +++ b/.github/workflows/extension_upgrade.yml @@ -43,7 +43,7 @@ jobs: run: echo "CI_BRANCH=$(git name-rev --name-only HEAD)" >> $GITHUB_OUTPUT - name: Install sys dependencies run: | - sudo apt-get update && sudo apt-get install -y postgresql-server-dev-15 libopenblas-dev libreadline-dev + sudo apt-get update && sudo apt-get install -y postgresql-server-dev-16 libopenblas-dev libreadline-dev - uses: ./.github/actions/pgx-init with: working-directory: ./extension