From 742642d0a5ce96e7319fbadc9031f446ab2c5d2d Mon Sep 17 00:00:00 2001 From: taoying <2474671424@qq.com> Date: Fri, 14 Feb 2025 17:10:32 +0800 Subject: [PATCH] Release v2.3.0 --- README.en.md | 19 +++++++++++++++++++ README.md | 19 +++++++++++++++++++ opengauss_sqlalchemy/__init__.py | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 5aba796..046421d 100644 --- a/README.en.md +++ b/README.en.md @@ -153,6 +153,25 @@ Table("some_talbe", ..., opengauss_partition_by="RANGE(column_name) ...", opengauss_enable_row_movement=True) ``` +### Vector Data Type +- vector data type with `select` +``` +tbl = Table( + "test", + m, + Column("id", Integer), + Column("bit_embedding", BIT(3)), + Column("sparsevec_embedding", SPARSEVEC(3)), + Column("vector_embedding", VECTOR(3)) +) + +select(tbl.c.id).order_by(tbl.c.bit_embedding.jaccard_distance('110')) + +select(tbl.c.id).order_by(tbl.c.sparsevec_embedding.l2_distance(SparseVector([1, 2, 3]))) + +select(tbl.c.id).order_by(tbl.c.vector_embedding.l2_distance([1,2,3])) +``` + ## Features For Centralized OpenGauss ### Index diff --git a/README.md b/README.md index e56e7ca..73ee0ca 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,25 @@ Table("some_talbe", ..., opengauss_partition_by="RANGE(column_name) ...", opengauss_enable_row_movement=True) ``` +### 向量数据类型 +- vector data type with `select` +``` +tbl = Table( + "test", + m, + Column("id", Integer), + Column("bit_embedding", BIT(3)), + Column("sparsevec_embedding", SPARSEVEC(3)), + Column("vector_embedding", VECTOR(3)) +) + +select(tbl.c.id).order_by(tbl.c.bit_embedding.jaccard_distance('110')) + +select(tbl.c.id).order_by(tbl.c.sparsevec_embedding.l2_distance(SparseVector([1, 2, 3]))) + +select(tbl.c.id).order_by(tbl.c.vector_embedding.l2_distance([1,2,3])) +``` + ## OpenGauss特性的使用方式(集中式) ### 索引 diff --git a/opengauss_sqlalchemy/__init__.py b/opengauss_sqlalchemy/__init__.py index 39dbfa2..1382c79 100644 --- a/opengauss_sqlalchemy/__init__.py +++ b/opengauss_sqlalchemy/__init__.py @@ -9,7 +9,7 @@ from sqlalchemy.dialects import registry -__version__ = "2.2.0" +__version__ = "2.3.0" registry.register( -- Gitee