pyvastbase 0.2.6__tar.gz → 0.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/CLAUDE.md +29 -4
  2. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/CONTEXT.md +17 -1
  3. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/PKG-INFO +24 -17
  4. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/README.md +21 -16
  5. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/README_en.md +19 -16
  6. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/__init__.py +222 -234
  7. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/async_impl/__init__.py +33 -42
  8. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/async_impl/collection.py +165 -148
  9. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/async_impl/connections.py +174 -56
  10. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/async_impl/index_builder.py +8 -11
  11. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/async_impl/search_builder.py +71 -51
  12. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/async_impl/utility.py +41 -38
  13. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/client.py +251 -82
  14. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/collection.py +64 -69
  15. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/collection_core.py +32 -25
  16. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/connections.py +181 -68
  17. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/constants.py +54 -36
  18. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/exceptions.py +25 -4
  19. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/mutation_result.py +4 -3
  20. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/schema.py +88 -50
  21. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/search_result.py +6 -2
  22. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/vector_types.py +22 -8
  23. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/index/index_builder.py +115 -123
  24. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/__init__.py +32 -33
  25. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/admin.py +33 -31
  26. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/ddl.py +5 -3
  27. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/index.py +3 -5
  28. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/insert.py +2 -4
  29. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/query.py +3 -5
  30. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/result.py +1 -1
  31. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/schema_reflect.py +2 -2
  32. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/search_result.py +2 -2
  33. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/upsert.py +1 -5
  34. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/orm/__init__.py +11 -13
  35. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/orm/base.py +183 -196
  36. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/orm/fields.py +43 -37
  37. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/pyproject.toml +3 -0
  38. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/pyvastbase.egg-info/SOURCES.txt +1 -0
  39. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/search/search_builder.py +124 -126
  40. pyvastbase-0.2.8/test_conn.py +27 -0
  41. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/conftest.py +45 -53
  42. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/helpers.py +3 -3
  43. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_async.py +427 -249
  44. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_async_alignment.py +25 -8
  45. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_async_executor.py +6 -2
  46. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_async_integration.py +19 -16
  47. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_async_with_executor.py +15 -10
  48. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_client_compat.py +4 -3
  49. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_collection.py +180 -201
  50. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_collection_adapter.py +14 -4
  51. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_collection_core.py +35 -25
  52. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_collection_integration.py +30 -22
  53. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_collection_properties.py +18 -17
  54. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_collection_signatures.py +39 -17
  55. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_connection_alignment.py +8 -2
  56. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_connection_provider.py +2 -0
  57. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_connections.py +138 -32
  58. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_constants.py +24 -22
  59. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_datatype_compat.py +3 -1
  60. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_datatype_intenum.py +24 -1
  61. pyvastbase-0.2.8/tests/test_datatype_mapping.py +132 -0
  62. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_exception_aliases.py +10 -3
  63. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_exceptions.py +32 -32
  64. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_executor.py +5 -7
  65. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_exports.py +27 -12
  66. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_hybrid_search.py +23 -16
  67. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_index_builder.py +34 -45
  68. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_integration.py +30 -33
  69. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_mutation_result.py +11 -6
  70. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_operations.py +10 -16
  71. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_operations_compat.py +18 -13
  72. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_orm.py +173 -133
  73. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_parameter_unification.py +12 -3
  74. pyvastbase-0.2.8/tests/test_pool_del_repro.py +216 -0
  75. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_return_type_rename.py +20 -4
  76. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_schema.py +115 -138
  77. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_schema_alignment.py +42 -23
  78. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_search_builder.py +67 -56
  79. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_type_alignment.py +26 -8
  80. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_utility.py +84 -82
  81. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_utility_compat.py +24 -13
  82. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_utility_integration.py +41 -31
  83. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_utils.py +735 -336
  84. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_vastbase_client.py +23 -7
  85. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_vector_types.py +27 -14
  86. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_with_executor.py +18 -20
  87. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utility.py +271 -258
  88. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utils/__init__.py +57 -57
  89. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utils/distance_utils.py +95 -106
  90. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utils/filter_utils.py +48 -47
  91. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utils/index_utils.py +68 -77
  92. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utils/result_utils.py +79 -118
  93. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utils/sql_utils.py +15 -10
  94. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/utils/vector_utils.py +134 -162
  95. pyvastbase-0.2.6/test_conn.py +0 -17
  96. pyvastbase-0.2.6/tests/test_datatype_mapping.py +0 -109
  97. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/MANIFEST.in +0 -0
  98. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/__init__.py +0 -0
  99. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/core/executor.py +0 -0
  100. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/executor/__init__.py +0 -0
  101. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/executor/async_impl.py +0 -0
  102. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/executor/sync.py +0 -0
  103. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/index/__init__.py +0 -0
  104. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/delete.py +0 -0
  105. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/operations/search.py +0 -0
  106. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/search/__init__.py +0 -0
  107. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/setup.cfg +0 -0
  108. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/__init__.py +0 -0
  109. {pyvastbase-0.2.6 → pyvastbase-0.2.8}/tests/test_packaging.py +0 -0
@@ -16,6 +16,10 @@ pyvastbase is a Python SDK for Vastbase V3 vector database — a PyMilvus-style
16
16
  # Install dev dependencies
17
17
  pip install -e ".[dev]"
18
18
 
19
+ # Install with connection pool / async extras
20
+ pip install -e ".[pool]" # psycopg-pool only
21
+ pip install -e ".[all]" # dev + pool
22
+
19
23
  # Run all tests (unit; integration skipped without VASTBASE_HOST)
20
24
  pytest
21
25
 
@@ -36,8 +40,21 @@ pytest --cov=pyvastbase --cov-report=term-missing
36
40
  black . --line-length 100
37
41
  isort . --profile black
38
42
 
39
- # Type check
40
- mypy .
43
+ # Type check (advisory — NOT in the release gate; see ADR 0002)
44
+ make typecheck
45
+ ```
46
+
47
+ ### Makefile release workflow
48
+
49
+ ```bash
50
+ make check-fast # black + isort + vermin --target=3.9- (static version scan)
51
+ make check # check-fast + pytest (mypy demoted — see typecheck)
52
+ make check-versions # uv 3.9/3.10/3.11/3.12: import smoke + pytest (release gate)
53
+ make typecheck # advisory mypy (NOT in release chain; ~140 real errors, see ADR 0002)
54
+ make build # clean + python -m build
55
+ make smoke-test # install from testpypi into temp venv, import smoke check
56
+ make release-test # clean -> check -> check-versions -> build -> twine check -> upload testpypi
57
+ make release # same flow -> upload pypi
41
58
  ```
42
59
 
43
60
  ## Architecture
@@ -64,6 +81,7 @@ Two-layer design — every module has a synchronous implementation and a paralle
64
81
  - [client.py](client.py) — `VastbaseClient` (aliased as `MilvusClient`): pymilvus-compatible high-level entry point. 40+ implemented methods delegating to Collection/utility, plus ~30 NotSupportedError stubs for PG-incompatible features (partition, role, replica, etc.). New pymilvus compat methods: `hybrid_search`, `query_iterator`, `search_iterator`, `describe_index`, `describe_database`, `describe_user`, `update_password`, `list_aliases`, `describe_alias`, `alter_index_properties`, `drop_index_properties`, `alter_collection_properties`, `drop_collection_properties`, `add_collection_field`, `flush_all`, `get_flush_all_state`
65
82
  - [operations/](operations/) — Pure SQL generation layer used by both sync and async paths. Each function returns `(sql, params)` tuple. Modules: admin (user/privilege/database SQL), ddl (drop/truncate/refresh/alter_table/add_column), index (drop/list/get/describe/alter_index), insert, delete, query, result, schema_reflect, search_result
66
83
  - [orm/](orm/) — Django-style ORM: `Entity` base class, `Model` decorator, `Field`/`VectorField` descriptors, field validators. Generates `CollectionSchema` from decorated classes.
84
+ - [executor/](executor/) — **Sole seam to the database.** All SQL execution crosses the `Executor` interface, never `VastbaseConnection` directly. Implementations: `SyncExecutor` / `AsyncExecutor` (psycopg 3, return `list[dict]`), `FakeExecutor` / `FakeAsyncExecutor` (in-memory test doubles). `SyncCollection` / `AsyncCollection` are thin adapters (~50 lines) that supply connection + Executor and delegate business logic to `CollectionCore` (sync-only). AsyncCollection bypasses Core for properties like `num_entities` / `index_params_async` — calls `_executor.execute()` directly. Utility functions access an Executor via `@with_executor` / `@async_with_executor` decorators. Only `create_database` / `drop_database` bypass the seam (need autocommit toggle — decorator passes both `_executor` and `_conn`). `VastbaseConnection.execute/fetch_one/fetch_all` are private (`_execute` / `_fetch_one` / `_fetch_all`); callers must cross the Executor seam.
67
85
 
68
86
  ### Supporting modules
69
87
 
@@ -71,9 +89,16 @@ Two-layer design — every module has a synchronous implementation and a paralle
71
89
  - [search/search_builder.py](search/search_builder.py) — `SearchParams`, `SearchResult`/`SearchResults`, `SearchQueryBuilder`, `FulltextSearchBuilder`
72
90
  - [utils/](utils/) — Internal SQL generation, vector serialization, distance calculation, filter expression building, result parsing
73
91
 
74
- ### Version detection & feature gating
92
+ ### hybrid_search vs hybrid_ann_search
93
+
94
+ Two distinct `hybrid_*` methods, easy to confuse:
95
+
96
+ - `hybrid_search` — **SDK-layer multi-way recall**. Issues multiple independent ANN SQL queries (one per vector field), merges via reranker (`RRFRanker`, `WeightedRRFRanker`, `WeightedRanker`). Vastbase has no native multi-way recall (no `rrf`/`fusion`/`rerank` in `pg_proc` on V3.0 Build 9), so reranking is client-side. Parallel by default (asyncio.gather / thread pool), serial optional. Returns `SearchResult` with `distance` = merged score.
97
+ - `hybrid_ann_search` — **Vastbase-native single-vector + scalar filter**. Queries one vector field using HybridANN index with WHERE-style scalar predicates. Not multi-way recall. Confirmed distinct by DB inspection.
98
+
99
+ See `docs/adr/0001-sdk-layer-multi-way-recall.md`.
75
100
 
76
- Vastbase exposes version via `SELECT vb_version()`, which returns both a Build number and a patch level (e.g., `version:V3.0 (Build 9)` + `patch:1`). Feature gating for 3.0.9+ features checks **both** `build >= 9 AND patch_level >= 1`. Version is cached per connection (one query, reused). New vector types (int8vector, halfvector, sparsevector), BM25 highlight, and auto-quantization all gate on this dual check. See [core/connections.py:219](core/connections.py#L219) `require_version()`.
101
+ ### Version detection & feature gating which returns product info, version, build number, patch level, and commit. Three product lines are auto-detected via the `product name:` line: Vastbase V3 (`V3.0 (Build 9) + patch:1`), VexDB Enterprise Edition (`V3.0.0.3` four-segment), and Vastbase G100 V2.2 (`V2.2 (Build 19) + patch:6`). VexDB and V2.2 versions are mapped to canonical V3-equivalent `(major, minor, build, patch_level)` tuples via lookup tables in [core/constants.py](core/constants.py). Unknown future versions default to `(99,99,99,99)` with a warning. Feature gating for 3.0.9+ features checks **both** `build >= 9 AND patch_level >= 1` against the canonical values. Version is cached per connection (one query, reused). New vector types (int8vector, halfvector, sparsevector), BM25 highlight, and auto-quantization all gate on this dual check. See `_parse_v3()`, `_parse_vexdb()`, `_parse_v2()` static methods in [core/connections.py](core/connections.py) and `require_version()`.
77
102
 
78
103
  ### Test conventions
79
104
 
@@ -6,7 +6,7 @@ A named set of data organized by a schema. Maps to a PostgreSQL table. Composed
6
6
 
7
7
  ## DataType
8
8
 
9
- An IntEnum holding the type of a field. Members carry both the Python-facing enum value and the PostgreSQL column type string via the `.pg_type` property. Example: `DataType.FLOAT_VECTOR` (value=101) maps to `floatvector`. The IntEnum design supports pymilvus-compatible `if dtype == DataType.INT64` comparisons while retaining PG type mapping for DDL generation. Aliases exist for backward compatibility (`DataType.INT64 == DataType.INT64`).
9
+ An IntEnum holding the type of a field. Members carry a pymilvus-aligned numeric value; the PostgreSQL column type string is obtained via the `DataType.to_pg_type()` classmethod (reverse via `DataType.from_pg_type()`). Example: `DataType.FLOAT_VECTOR` (value=16) maps to `floatvector`. PG-only types extend the range at values ≥100 (`TEXT`, `DATE`, `UUID`, `TIMESTAMP`). The IntEnum design supports pymilvus-compatible `if dtype == DataType.INT64` comparisons while retaining PG type mapping for DDL generation. Backward-compatible aliases: `HALF_VECTOR == FLOAT16_VECTOR`, `SPARSE_VECTOR == SPARSE_FLOAT_VECTOR`.
10
10
 
11
11
  ## MetricType
12
12
 
@@ -77,3 +77,19 @@ High-level pymilvus `MilvusClient`-compatible entry point. Delegates all operati
77
77
  ## Connection Provider
78
78
 
79
79
  A module that supplies database connections by alias. The `ConnectionProvider` protocol defines a single method `get_connection(alias) -> VastbaseConnection`. The default implementation (`VastbaseConnections`) holds a registry of named connection configurations. Consumers (Collection, utility functions) accept an optional `_connection_provider` parameter, defaulting to the global singleton instance. VastbaseConnection is an internal implementation detail of SyncExecutor/AsyncExecutor — callers should not use `_execute/_fetch_one/_fetch_all` directly; they cross the Executor seam instead.
80
+
81
+ ## VexDB Enterprise Edition
82
+
83
+ Vastbase enterprise variant. Uses a four-segment dotted version format (`V<major>.<minor>.<build>.<patch>`) in `vb_version()` output. Identified by `product name:VexDB Enterprise Edition`. Functionally equivalent to Vastbase V3; version mapping converts the raw version to a canonical V3 representation for feature gating.
84
+
85
+ ## Vastbase G100
86
+
87
+ Vastbase V2.2 product line. Uses the same `vb_version()` output format as V3 (`V<major>.<minor> (Build <N>)` + `patch:<P>`) but with `V2.2` major.minor. Identified by `product name:Vastbase G100`. Version mapping converts the raw version to a canonical V3 representation for feature gating.
88
+
89
+ ## Product Name
90
+
91
+ Identified by the `product name:` line in `vb_version()` output. Determines which version parser and mapping table to use. Known values: `VexDB Enterprise Edition`, `Vastbase G100`, and the default (Vastbase V3, when the line is absent or unrecognized).
92
+
93
+ ## Canonical Version
94
+
95
+ The V3-equivalent `(major, minor, build, patch)` tuple used internally for all feature gating, regardless of which product the SDK connects to. Obtained by parsing `vb_version()` output according to the product's format, then applying the product's mapping table. All version constants (e.g. `VB_VERSION_3_0_9`) and `require_version()` operate on canonical versions.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyvastbase
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: Python SDK for Vastbase V3 (PyMilvus-style API)
5
5
  Author-email: "zhangzhijie(字节)" <zhangzj@vastdata.com.cn>
6
6
  License-Expression: MIT
@@ -21,6 +21,7 @@ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
21
21
  Requires-Dist: black>=23.0.0; extra == "dev"
22
22
  Requires-Dist: isort>=5.12.0; extra == "dev"
23
23
  Requires-Dist: mypy>=1.5.0; extra == "dev"
24
+ Requires-Dist: vermin>=1.6; extra == "dev"
24
25
  Provides-Extra: pool
25
26
  Requires-Dist: psycopg-pool>=3.2; extra == "pool"
26
27
  Provides-Extra: async
@@ -32,11 +33,12 @@ Requires-Dist: pytest-cov>=4.1.0; extra == "all"
32
33
  Requires-Dist: black>=23.0.0; extra == "all"
33
34
  Requires-Dist: isort>=5.12.0; extra == "all"
34
35
  Requires-Dist: mypy>=1.5.0; extra == "all"
36
+ Requires-Dist: vermin>=1.6; extra == "all"
35
37
  Requires-Dist: psycopg-pool>=3.2; extra == "all"
36
38
 
37
39
  # pyvastbase
38
40
 
39
- Python SDK for Vastbase V3 — 对标 PyMilvus 接口风格,面向 Vastbase 向量引擎。支持 Vastbase 3.0.8+,对 3.0.9+ 新特性自动版本检测与功能门控。
41
+ Python SDK for Vastbase 向量引擎 — 对标 PyMilvus 接口风格。支持 Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2,自动识别产品线并映射版本,对 3.0.9+ 新特性自动版本检测与功能门控。
40
42
 
41
43
  ## 安装
42
44
 
@@ -150,19 +152,23 @@ col.insert([{
150
152
 
151
153
  ## 版本检测与自动门控
152
154
 
153
- SDK 通过 `SELECT vb_version()` 自动检测已连接的 Vastbase 版本,并对 3.0.9+ 特性进行功能门控。版本信息**按连接缓存**——仅查询一次,后续所有检查复用缓存结果。
155
+ SDK 通过 `SELECT vb_version()` 自动检测已连接的产品及版本,并对 3.0.9+ 特性进行功能门控。支持三种产品线,自动映射到统一的 V3 等效版本号。版本信息**按连接缓存**——仅查询一次,后续所有检查复用缓存结果。
154
156
 
155
- ### 双重校验:Build + Patch(来自 vb_version())
157
+ ### 多产品支持
156
158
 
157
- Vastbase 通过 Build 号和 Patch 级别共同标识版本:
159
+ SDK 根据 `vb_version()` 输出中的 `product name:` 行自动识别产品,并应用对应的版本映射:
158
160
 
159
- ```
160
- vb_version() 输出:
161
- version:V3.0 (Build 9) -> build = 9
162
- patch:1 -> patch_level = 1
163
- ```
161
+ | 产品 | product name 标识 | 版本格式 | 示例 |
162
+ |------|-------------------|----------|------|
163
+ | Vastbase V3 | 默认 / Vastbase V100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V3.0 (Build 9) + patch:1` |
164
+ | VexDB Enterprise Edition | VexDB Enterprise Edition | `V<M>.<m>.<B>.<P>` 四段式 | `V3.0.0.3` |
165
+ | Vastbase G100 V2.2 | Vastbase G100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V2.2 (Build 19) + patch:6` |
166
+
167
+ 所有产品线的版本号均映射为 V3 等效 `(major, minor, build, patch_level)` 元组,功能门控统一使用映射后的值。
168
+
169
+ ### 双重校验:Build + Patch(来自 vb_version())
164
170
 
165
- 功能门控**同时检查**两个条件:`build >= 9 AND patch_level >= 1`。
171
+ 功能门控**同时检查**两个条件:`build >= required_build AND patch_level >= required_patch`。
166
172
 
167
173
  ```python
168
174
  from pyvastbase import get_vb_version, check_vb_version
@@ -170,15 +176,16 @@ from pyvastbase import get_vb_version, check_vb_version
170
176
  ver = get_vb_version()
171
177
  print(ver["major"]) # 3
172
178
  print(ver["minor"]) # 0
173
- print(ver["build"]) # 9 (来自 version:V3.0 (Build 9))
174
- print(ver["patch_level"]) # 1 (来自 patch:1)
179
+ print(ver["build"]) # 9
180
+ print(ver["patch_level"]) # 1
181
+ print(ver["product_name"]) # "VexDB Enterprise Edition"
182
+ print(ver["commit"]) # "31338"
175
183
  print(ver["has_sparsevector"]) # True (build>=9 AND patch_level>=1)
176
184
  print(ver["has_int8vector"]) # True
177
185
 
178
- # 手动版本检查 (major, minor, build, patch_level)
179
- check_vb_version((3, 0, 9, 1)) # True — build 9 >= 9, patch 1 >= 1
186
+ # 手动版本检查 (major, minor, build, patch_level) — 使用映射后的 V3 等效版本
187
+ check_vb_version((3, 0, 9, 1)) # True — 所有产品线统一检查
180
188
  check_vb_version((3, 0, 9, 2)) # False — patch 1 < 2
181
- check_vb_version((3, 0, 8, 1)) # True — 服务器版本高于最低要求
182
189
  ```
183
190
 
184
191
  所有 3.0.9+ 操作在执行前会**自动校验**服务器版本。若服务器版本过低,会返回具体的错误信息,明确指出哪个条件未满足。
@@ -579,7 +586,7 @@ pyvastbase/
579
586
 
580
587
  - Python >= 3.9
581
588
  - psycopg[binary] >= 3.2
582
- - Vastbase >= 3.0.8(新向量类型和特性需要 3.0.9+)
589
+ - Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2(新向量类型和特性需要 3.0.9+)
583
590
 
584
591
  ## License
585
592
 
@@ -1,6 +1,6 @@
1
1
  # pyvastbase
2
2
 
3
- Python SDK for Vastbase V3 — 对标 PyMilvus 接口风格,面向 Vastbase 向量引擎。支持 Vastbase 3.0.8+,对 3.0.9+ 新特性自动版本检测与功能门控。
3
+ Python SDK for Vastbase 向量引擎 — 对标 PyMilvus 接口风格。支持 Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2,自动识别产品线并映射版本,对 3.0.9+ 新特性自动版本检测与功能门控。
4
4
 
5
5
  ## 安装
6
6
 
@@ -114,19 +114,23 @@ col.insert([{
114
114
 
115
115
  ## 版本检测与自动门控
116
116
 
117
- SDK 通过 `SELECT vb_version()` 自动检测已连接的 Vastbase 版本,并对 3.0.9+ 特性进行功能门控。版本信息**按连接缓存**——仅查询一次,后续所有检查复用缓存结果。
117
+ SDK 通过 `SELECT vb_version()` 自动检测已连接的产品及版本,并对 3.0.9+ 特性进行功能门控。支持三种产品线,自动映射到统一的 V3 等效版本号。版本信息**按连接缓存**——仅查询一次,后续所有检查复用缓存结果。
118
118
 
119
- ### 双重校验:Build + Patch(来自 vb_version())
119
+ ### 多产品支持
120
120
 
121
- Vastbase 通过 Build 号和 Patch 级别共同标识版本:
121
+ SDK 根据 `vb_version()` 输出中的 `product name:` 行自动识别产品,并应用对应的版本映射:
122
122
 
123
- ```
124
- vb_version() 输出:
125
- version:V3.0 (Build 9) -> build = 9
126
- patch:1 -> patch_level = 1
127
- ```
123
+ | 产品 | product name 标识 | 版本格式 | 示例 |
124
+ |------|-------------------|----------|------|
125
+ | Vastbase V3 | 默认 / Vastbase V100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V3.0 (Build 9) + patch:1` |
126
+ | VexDB Enterprise Edition | VexDB Enterprise Edition | `V<M>.<m>.<B>.<P>` 四段式 | `V3.0.0.3` |
127
+ | Vastbase G100 V2.2 | Vastbase G100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V2.2 (Build 19) + patch:6` |
128
+
129
+ 所有产品线的版本号均映射为 V3 等效 `(major, minor, build, patch_level)` 元组,功能门控统一使用映射后的值。
130
+
131
+ ### 双重校验:Build + Patch(来自 vb_version())
128
132
 
129
- 功能门控**同时检查**两个条件:`build >= 9 AND patch_level >= 1`。
133
+ 功能门控**同时检查**两个条件:`build >= required_build AND patch_level >= required_patch`。
130
134
 
131
135
  ```python
132
136
  from pyvastbase import get_vb_version, check_vb_version
@@ -134,15 +138,16 @@ from pyvastbase import get_vb_version, check_vb_version
134
138
  ver = get_vb_version()
135
139
  print(ver["major"]) # 3
136
140
  print(ver["minor"]) # 0
137
- print(ver["build"]) # 9 (来自 version:V3.0 (Build 9))
138
- print(ver["patch_level"]) # 1 (来自 patch:1)
141
+ print(ver["build"]) # 9
142
+ print(ver["patch_level"]) # 1
143
+ print(ver["product_name"]) # "VexDB Enterprise Edition"
144
+ print(ver["commit"]) # "31338"
139
145
  print(ver["has_sparsevector"]) # True (build>=9 AND patch_level>=1)
140
146
  print(ver["has_int8vector"]) # True
141
147
 
142
- # 手动版本检查 (major, minor, build, patch_level)
143
- check_vb_version((3, 0, 9, 1)) # True — build 9 >= 9, patch 1 >= 1
148
+ # 手动版本检查 (major, minor, build, patch_level) — 使用映射后的 V3 等效版本
149
+ check_vb_version((3, 0, 9, 1)) # True — 所有产品线统一检查
144
150
  check_vb_version((3, 0, 9, 2)) # False — patch 1 < 2
145
- check_vb_version((3, 0, 8, 1)) # True — 服务器版本高于最低要求
146
151
  ```
147
152
 
148
153
  所有 3.0.9+ 操作在执行前会**自动校验**服务器版本。若服务器版本过低,会返回具体的错误信息,明确指出哪个条件未满足。
@@ -543,7 +548,7 @@ pyvastbase/
543
548
 
544
549
  - Python >= 3.9
545
550
  - psycopg[binary] >= 3.2
546
- - Vastbase >= 3.0.8(新向量类型和特性需要 3.0.9+)
551
+ - Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2(新向量类型和特性需要 3.0.9+)
547
552
 
548
553
  ## License
549
554
 
@@ -1,6 +1,6 @@
1
1
  # pyvastbase
2
2
 
3
- Python SDK for Vastbase V3 — a PyMilvus-style API for Vastbase's vector engine. Supports Vastbase 3.0.8+ with automatic version detection and feature gating for 3.0.9+ features.
3
+ Python SDK for Vastbase vector engine — a PyMilvus-style API. Supports Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2 with automatic product detection, version mapping, and feature gating for 3.0.9+ features.
4
4
 
5
5
  ## Installation
6
6
 
@@ -110,19 +110,21 @@ col.insert([{
110
110
 
111
111
  ## Version Detection & Auto-Gating
112
112
 
113
- The SDK automatically detects the connected Vastbase version via `SELECT vb_version()` and gates 3.0.9+ features. The version is **cached per connection** — only one query, reused for all subsequent checks.
113
+ The SDK automatically detects the connected product and version via `SELECT vb_version()`. Three product lines are recognized through the `product name:` line, with versions mapped to canonical V3-equivalent `(major, minor, build, patch_level)` tuples. The version is **cached per connection** — only one query, reused for all subsequent checks.
114
114
 
115
- ### Dual-Check: Build + Patch from vb_version()
115
+ ### Multi-Product Support
116
116
 
117
- Vastbase identifies versions with both a Build number and a Patch level:
117
+ | Product | product name | Version Format | Example |
118
+ |---------|-------------|----------------|---------|
119
+ | Vastbase V3 | default / Vastbase V100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V3.0 (Build 9) + patch:1` |
120
+ | VexDB Enterprise Edition | VexDB Enterprise Edition | `V<M>.<m>.<B>.<P>` 4-segment | `V3.0.0.3` |
121
+ | Vastbase G100 V2.2 | Vastbase G100 | `V<M>.<m> (Build <B>) + patch:<P>` | `V2.2 (Build 19) + patch:6` |
118
122
 
119
- ```
120
- vb_version() output:
121
- version:V3.0 (Build 9) -> build = 9
122
- patch:1 -> patch_level = 1
123
- ```
123
+ All products are mapped to canonical V3-equivalent versions for unified feature gating.
124
+
125
+ ### Dual-Check: Build + Patch
124
126
 
125
- Feature gating checks **both** conditions: `build >= 9 AND patch_level >= 1`.
127
+ Feature gating checks **both** conditions: `build >= required_build AND patch_level >= required_patch`.
126
128
 
127
129
  ```python
128
130
  from pyvastbase import get_vb_version, check_vb_version
@@ -130,15 +132,16 @@ from pyvastbase import get_vb_version, check_vb_version
130
132
  ver = get_vb_version()
131
133
  print(ver["major"]) # 3
132
134
  print(ver["minor"]) # 0
133
- print(ver["build"]) # 9 (from version:V3.0 (Build 9))
134
- print(ver["patch_level"]) # 1 (from patch:1)
135
+ print(ver["build"]) # 9
136
+ print(ver["patch_level"]) # 1
137
+ print(ver["product_name"]) # "VexDB Enterprise Edition"
138
+ print(ver["commit"]) # "31338"
135
139
  print(ver["has_sparsevector"]) # True (build>=9 AND patch_level>=1)
136
140
  print(ver["has_int8vector"]) # True
137
141
 
138
- # Manual version check (major, minor, build, patch_level)
139
- check_vb_version((3, 0, 9, 1)) # True — build 9 >= 9, patch 1 >= 1
142
+ # Manual version check (major, minor, build, patch_level) — uses canonical V3 values
143
+ check_vb_version((3, 0, 9, 1)) # True — works across all product lines
140
144
  check_vb_version((3, 0, 9, 2)) # False — patch 1 < 2
141
- check_vb_version((3, 0, 8, 1)) # True — server exceeds minimum
142
145
  ```
143
146
 
144
147
  All 3.0.9+ operations automatically validate the server version before executing. If the server is too old, specific error messages indicate which requirement failed.
@@ -540,7 +543,7 @@ pyvastbase/
540
543
 
541
544
  - Python >= 3.9
542
545
  - psycopg[binary] >= 3.1
543
- - Vastbase >= 3.0.8 (3.0.9+ for new vector types and features)
546
+ - Vastbase V3 / VexDB Enterprise Edition / Vastbase G100 V2.2 (3.0.9+ for new vector types and features)
544
547
 
545
548
  ## License
546
549