sqlalchemy-hawdb 0.26.0__tar.gz → 0.28.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlalchemy-hawdb
3
- Version: 0.26.0
3
+ Version: 0.28.0
4
4
  Summary: SQLAlchemy dialect for the embedded HawDB database
5
5
  License: Apache-2.0
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -13,7 +13,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
13
  Requires-Python: >=3.11
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: SQLAlchemy<3.0,>=2.0
16
- Requires-Dist: hawdb<0.27.0,>=0.26.0
16
+ Requires-Dist: hawdb<0.29.0,>=0.28.0
17
17
  Provides-Extra: test
18
18
  Requires-Dist: pytest<9,>=8; extra == "test"
19
19
  Requires-Dist: ruff<1,>=0.14; extra == "test"
@@ -32,7 +32,7 @@ driver and its supported SQL subset.
32
32
  ## Requirements
33
33
 
34
34
  - Python 3.11 or newer
35
- - HawDB Python binding 0.26.x (CI tests 0.26.0)
35
+ - HawDB Python binding 0.28.x (CI tests 0.28.0)
36
36
  - SQLAlchemy 2.x (CI tests both 2.0.x and 2.1.x)
37
37
 
38
38
  Install the dialect and its HawDB dependency from PyPI:
@@ -41,11 +41,11 @@ Install the dialect and its HawDB dependency from PyPI:
41
41
  python -m pip install sqlalchemy-hawdb
42
42
  ```
43
43
 
44
- If HawDB 0.26.0 is not available on your package index, build and install its
45
- wheel from the upstream release tag first:
44
+ To build HawDB 0.28.0 from source, build and install its wheel from the upstream
45
+ release tag first:
46
46
 
47
47
  ```sh
48
- git clone --branch v0.26.0 https://github.com/nowledge-co/hawdb.git
48
+ git clone --branch v0.28.0 https://github.com/nowledge-co/hawdb.git
49
49
  cd hawdb/bindings/python
50
50
  python -m pip install maturin==1.15.0
51
51
  maturin build --release --out dist
@@ -114,7 +114,7 @@ stable while the database is open. A Windows host can obtain the user's
114
114
  OS-provisioned LocalAppData path through the known-folder API. Pass the same
115
115
  anchor on read-only reopens. The default remains `None`; the dialect does not
116
116
  infer an anchor from directory existence or a permission error. See the
117
- [upstream host contract](https://github.com/nowledge-co/hawdb/blob/v0.26.0/bindings/python/README.md).
117
+ [upstream host contract](https://github.com/nowledge-co/hawdb/blob/v0.28.0/bindings/python/README.md).
118
118
 
119
119
  ## Supported behavior
120
120
 
@@ -149,9 +149,34 @@ rejects precision overflow. Decimal/`DOUBLE PRECISION` arithmetic and comparison
149
149
  require an explicit `CAST`; this bounded numeric contract does not provide PostgreSQL's
150
150
  arbitrary-precision numeric semantics.
151
151
 
152
- ### HawDB 0.26 compatibility
153
-
154
- HawDB 0.26 uses PEG for its supported SQL grammar and retains bounded,
152
+ ### HawDB 0.28 compatibility
153
+
154
+ HawDB 0.28 retains the Python DB-API, value conversions, and connection contract
155
+ from 0.27. CI checks published PyPI wheels separately from wheels built from the
156
+ release tag.
157
+
158
+ Queries that fix an equality prefix of a composite primary key and optionally
159
+ bound the next key column can now use a primary-key range seek. The dialect's
160
+ existing bound parameters, `order_by`, `limit`, and `offset` work with this
161
+ engine optimization. Ascending key order can avoid a sort; descending queries
162
+ still sort. Always specify `order_by` when application behavior depends on row
163
+ order, since a new access path can change unordered results.
164
+
165
+ Relational scans no longer have a fixed 16,384-entry cap on merged
166
+ uncheckpointed rows. They use the statement row budget instead. An explicit
167
+ `max_read_result_rows` supplied through `connect_args` still bounds SQL reads.
168
+ The integration tests cover a 20,000-row batch load, aggregation, mutations,
169
+ reopen, and budget refusal followed by a point read. They do not control
170
+ checkpoint timing; engine-level tests own the deterministic overlay regression.
171
+
172
+ New variable-length paths, relationship type disjunctions, scalar functions,
173
+ and comprehensions belong to Cypher. Per-query DiskANN beam/candidate settings
174
+ belong to the Rust vector search API. These do not add relational SQL syntax
175
+ or Python connection options. The embedded API renaming in this release is a
176
+ Rust source migration; the dialect does not use the renamed contracts. See the
177
+ [0.28 release notes](https://github.com/nowledge-co/hawdb/releases/tag/v0.28.0).
178
+
179
+ Since 0.26, HawDB uses PEG for its supported SQL grammar and retains bounded,
155
180
  schema-neutral templates for repeated parameterized INSERT, UPDATE, and DELETE
156
181
  statements. SQLAlchemy's compiled-statement cache and HawDB's syntax-template
157
182
  cache remain separate; values are bound for every execution. UPDATE arithmetic
@@ -159,11 +184,11 @@ works with typed DOUBLE and Decimal parameters, with the explicit-cast rules
159
184
  above. These engine changes do not imply support for the entire PostgreSQL
160
185
  grammar.
161
186
 
162
- CI creates persistent databases with the released HawDB 0.25.0 wheel in an
163
- isolated interpreter, then checks reads, indexes, Decimal scale, duplicate
164
- keyless rows, new writes, and reopen using 0.26. Both normal close and abrupt
165
- process exit after committed writes are covered. This is a focused default-
166
- configuration upgrade fixture, not a migration facility for older formats.
187
+ CI creates persistent databases in isolated HawDB 0.25.0, 0.26.0, and 0.27.0
188
+ interpreters, then checks reads, indexes, Decimal scale, duplicate keyless rows,
189
+ new writes, and reopen using 0.28. Both normal close and abrupt process exit
190
+ after committed writes are covered. This is a focused default-configuration
191
+ upgrade fixture, not a migration facility for older formats.
167
192
 
168
193
  ### Upgrading from 0.24
169
194
 
@@ -196,12 +221,19 @@ python -m pytest
196
221
  ```
197
222
 
198
223
  GitHub Actions builds the source distribution and wheel, checks their metadata,
199
- builds HawDB v0.26.0 from its upstream release tag, and tests the installed
224
+ builds HawDB v0.28.0 from its upstream release tag, and tests the installed
200
225
  dialect wheel on Python 3.11-3.13 with SQLAlchemy 2.0.x and 2.1.x for every push
201
- and pull request. The six test jobs also install HawDB 0.25.0 in a separate
202
- interpreter for cross-version data fixtures. To include those fixtures locally,
203
- set `HAWDB_PREVIOUS_PYTHON` to an interpreter containing exactly `hawdb==0.25.0`.
204
- The upgrade tests are skipped when that interpreter is not configured.
226
+ and pull request. An additional Python 3.11 / SQLAlchemy 2.1 job runs the same
227
+ tests with HawDB's published PyPI wheel instead of the source-built wheel.
228
+ All jobs run on Linux.
229
+
230
+ Each test job also installs HawDB 0.25.0 and 0.27.0 from PyPI and HawDB 0.26.0
231
+ from its release tag in separate interpreters for cross-version data fixtures. Version
232
+ 0.26.0 was not published to PyPI. To include those fixtures locally, set
233
+ `HAWDB_PREVIOUS_PYTHON` to an interpreter containing exactly `hawdb==0.25.0` and
234
+ `HAWDB_026_PYTHON` to one containing exactly `hawdb==0.26.0`, and
235
+ `HAWDB_027_PYTHON` to one containing exactly `hawdb==0.27.0`. Upgrade tests for
236
+ an interpreter are skipped when its environment variable is not configured.
205
237
 
206
238
  These are the project's targeted compatibility tests. SQLAlchemy's full
207
239
  `sqlalchemy.testing.suite` additionally requires HawDB-specific capability
@@ -212,7 +244,7 @@ compliance gate.
212
244
 
213
245
  `.github/workflows/pypi.yaml` publishes the tested source distribution and wheel
214
246
  when a GitHub Release is published. The release tag must match the version in
215
- `pyproject.toml`, for example `v0.26.0`. A manual workflow dispatch runs the same
247
+ `pyproject.toml`, for example `v0.28.0`. A manual workflow dispatch runs the same
216
248
  build and tests without uploading to PyPI.
217
249
 
218
250
  Configure a PyPI Trusted Publisher for the `sqlalchemy-hawdb` project with:
@@ -12,7 +12,7 @@ driver and its supported SQL subset.
12
12
  ## Requirements
13
13
 
14
14
  - Python 3.11 or newer
15
- - HawDB Python binding 0.26.x (CI tests 0.26.0)
15
+ - HawDB Python binding 0.28.x (CI tests 0.28.0)
16
16
  - SQLAlchemy 2.x (CI tests both 2.0.x and 2.1.x)
17
17
 
18
18
  Install the dialect and its HawDB dependency from PyPI:
@@ -21,11 +21,11 @@ Install the dialect and its HawDB dependency from PyPI:
21
21
  python -m pip install sqlalchemy-hawdb
22
22
  ```
23
23
 
24
- If HawDB 0.26.0 is not available on your package index, build and install its
25
- wheel from the upstream release tag first:
24
+ To build HawDB 0.28.0 from source, build and install its wheel from the upstream
25
+ release tag first:
26
26
 
27
27
  ```sh
28
- git clone --branch v0.26.0 https://github.com/nowledge-co/hawdb.git
28
+ git clone --branch v0.28.0 https://github.com/nowledge-co/hawdb.git
29
29
  cd hawdb/bindings/python
30
30
  python -m pip install maturin==1.15.0
31
31
  maturin build --release --out dist
@@ -94,7 +94,7 @@ stable while the database is open. A Windows host can obtain the user's
94
94
  OS-provisioned LocalAppData path through the known-folder API. Pass the same
95
95
  anchor on read-only reopens. The default remains `None`; the dialect does not
96
96
  infer an anchor from directory existence or a permission error. See the
97
- [upstream host contract](https://github.com/nowledge-co/hawdb/blob/v0.26.0/bindings/python/README.md).
97
+ [upstream host contract](https://github.com/nowledge-co/hawdb/blob/v0.28.0/bindings/python/README.md).
98
98
 
99
99
  ## Supported behavior
100
100
 
@@ -129,9 +129,34 @@ rejects precision overflow. Decimal/`DOUBLE PRECISION` arithmetic and comparison
129
129
  require an explicit `CAST`; this bounded numeric contract does not provide PostgreSQL's
130
130
  arbitrary-precision numeric semantics.
131
131
 
132
- ### HawDB 0.26 compatibility
133
-
134
- HawDB 0.26 uses PEG for its supported SQL grammar and retains bounded,
132
+ ### HawDB 0.28 compatibility
133
+
134
+ HawDB 0.28 retains the Python DB-API, value conversions, and connection contract
135
+ from 0.27. CI checks published PyPI wheels separately from wheels built from the
136
+ release tag.
137
+
138
+ Queries that fix an equality prefix of a composite primary key and optionally
139
+ bound the next key column can now use a primary-key range seek. The dialect's
140
+ existing bound parameters, `order_by`, `limit`, and `offset` work with this
141
+ engine optimization. Ascending key order can avoid a sort; descending queries
142
+ still sort. Always specify `order_by` when application behavior depends on row
143
+ order, since a new access path can change unordered results.
144
+
145
+ Relational scans no longer have a fixed 16,384-entry cap on merged
146
+ uncheckpointed rows. They use the statement row budget instead. An explicit
147
+ `max_read_result_rows` supplied through `connect_args` still bounds SQL reads.
148
+ The integration tests cover a 20,000-row batch load, aggregation, mutations,
149
+ reopen, and budget refusal followed by a point read. They do not control
150
+ checkpoint timing; engine-level tests own the deterministic overlay regression.
151
+
152
+ New variable-length paths, relationship type disjunctions, scalar functions,
153
+ and comprehensions belong to Cypher. Per-query DiskANN beam/candidate settings
154
+ belong to the Rust vector search API. These do not add relational SQL syntax
155
+ or Python connection options. The embedded API renaming in this release is a
156
+ Rust source migration; the dialect does not use the renamed contracts. See the
157
+ [0.28 release notes](https://github.com/nowledge-co/hawdb/releases/tag/v0.28.0).
158
+
159
+ Since 0.26, HawDB uses PEG for its supported SQL grammar and retains bounded,
135
160
  schema-neutral templates for repeated parameterized INSERT, UPDATE, and DELETE
136
161
  statements. SQLAlchemy's compiled-statement cache and HawDB's syntax-template
137
162
  cache remain separate; values are bound for every execution. UPDATE arithmetic
@@ -139,11 +164,11 @@ works with typed DOUBLE and Decimal parameters, with the explicit-cast rules
139
164
  above. These engine changes do not imply support for the entire PostgreSQL
140
165
  grammar.
141
166
 
142
- CI creates persistent databases with the released HawDB 0.25.0 wheel in an
143
- isolated interpreter, then checks reads, indexes, Decimal scale, duplicate
144
- keyless rows, new writes, and reopen using 0.26. Both normal close and abrupt
145
- process exit after committed writes are covered. This is a focused default-
146
- configuration upgrade fixture, not a migration facility for older formats.
167
+ CI creates persistent databases in isolated HawDB 0.25.0, 0.26.0, and 0.27.0
168
+ interpreters, then checks reads, indexes, Decimal scale, duplicate keyless rows,
169
+ new writes, and reopen using 0.28. Both normal close and abrupt process exit
170
+ after committed writes are covered. This is a focused default-configuration
171
+ upgrade fixture, not a migration facility for older formats.
147
172
 
148
173
  ### Upgrading from 0.24
149
174
 
@@ -176,12 +201,19 @@ python -m pytest
176
201
  ```
177
202
 
178
203
  GitHub Actions builds the source distribution and wheel, checks their metadata,
179
- builds HawDB v0.26.0 from its upstream release tag, and tests the installed
204
+ builds HawDB v0.28.0 from its upstream release tag, and tests the installed
180
205
  dialect wheel on Python 3.11-3.13 with SQLAlchemy 2.0.x and 2.1.x for every push
181
- and pull request. The six test jobs also install HawDB 0.25.0 in a separate
182
- interpreter for cross-version data fixtures. To include those fixtures locally,
183
- set `HAWDB_PREVIOUS_PYTHON` to an interpreter containing exactly `hawdb==0.25.0`.
184
- The upgrade tests are skipped when that interpreter is not configured.
206
+ and pull request. An additional Python 3.11 / SQLAlchemy 2.1 job runs the same
207
+ tests with HawDB's published PyPI wheel instead of the source-built wheel.
208
+ All jobs run on Linux.
209
+
210
+ Each test job also installs HawDB 0.25.0 and 0.27.0 from PyPI and HawDB 0.26.0
211
+ from its release tag in separate interpreters for cross-version data fixtures. Version
212
+ 0.26.0 was not published to PyPI. To include those fixtures locally, set
213
+ `HAWDB_PREVIOUS_PYTHON` to an interpreter containing exactly `hawdb==0.25.0` and
214
+ `HAWDB_026_PYTHON` to one containing exactly `hawdb==0.26.0`, and
215
+ `HAWDB_027_PYTHON` to one containing exactly `hawdb==0.27.0`. Upgrade tests for
216
+ an interpreter are skipped when its environment variable is not configured.
185
217
 
186
218
  These are the project's targeted compatibility tests. SQLAlchemy's full
187
219
  `sqlalchemy.testing.suite` additionally requires HawDB-specific capability
@@ -192,7 +224,7 @@ compliance gate.
192
224
 
193
225
  `.github/workflows/pypi.yaml` publishes the tested source distribution and wheel
194
226
  when a GitHub Release is published. The release tag must match the version in
195
- `pyproject.toml`, for example `v0.26.0`. A manual workflow dispatch runs the same
227
+ `pyproject.toml`, for example `v0.28.0`. A manual workflow dispatch runs the same
196
228
  build and tests without uploading to PyPI.
197
229
 
198
230
  Configure a PyPI Trusted Publisher for the `sqlalchemy-hawdb` project with:
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sqlalchemy-hawdb"
7
- version = "0.26.0"
7
+ version = "0.28.0"
8
8
  description = "SQLAlchemy dialect for the embedded HawDB database"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
11
11
  license = { text = "Apache-2.0" }
12
- dependencies = ["SQLAlchemy>=2.0,<3.0", "hawdb>=0.26.0,<0.27.0"]
12
+ dependencies = ["SQLAlchemy>=2.0,<3.0", "hawdb>=0.28.0,<0.29.0"]
13
13
  classifiers = [
14
14
  "Development Status :: 3 - Alpha",
15
15
  "Programming Language :: Python :: 3",
@@ -78,7 +78,7 @@ class HawDBDialect(default.DefaultDialect):
78
78
  except ImportError as error:
79
79
  raise ImportError(
80
80
  "HawDB's Python binding is required; install it with "
81
- "python -m pip install 'hawdb>=0.26.0,<0.27.0'"
81
+ "python -m pip install 'hawdb>=0.28.0,<0.29.0'"
82
82
  ) from error
83
83
 
84
84
  def create_connect_args(self, url):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlalchemy-hawdb
3
- Version: 0.26.0
3
+ Version: 0.28.0
4
4
  Summary: SQLAlchemy dialect for the embedded HawDB database
5
5
  License: Apache-2.0
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -13,7 +13,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
13
  Requires-Python: >=3.11
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: SQLAlchemy<3.0,>=2.0
16
- Requires-Dist: hawdb<0.27.0,>=0.26.0
16
+ Requires-Dist: hawdb<0.29.0,>=0.28.0
17
17
  Provides-Extra: test
18
18
  Requires-Dist: pytest<9,>=8; extra == "test"
19
19
  Requires-Dist: ruff<1,>=0.14; extra == "test"
@@ -32,7 +32,7 @@ driver and its supported SQL subset.
32
32
  ## Requirements
33
33
 
34
34
  - Python 3.11 or newer
35
- - HawDB Python binding 0.26.x (CI tests 0.26.0)
35
+ - HawDB Python binding 0.28.x (CI tests 0.28.0)
36
36
  - SQLAlchemy 2.x (CI tests both 2.0.x and 2.1.x)
37
37
 
38
38
  Install the dialect and its HawDB dependency from PyPI:
@@ -41,11 +41,11 @@ Install the dialect and its HawDB dependency from PyPI:
41
41
  python -m pip install sqlalchemy-hawdb
42
42
  ```
43
43
 
44
- If HawDB 0.26.0 is not available on your package index, build and install its
45
- wheel from the upstream release tag first:
44
+ To build HawDB 0.28.0 from source, build and install its wheel from the upstream
45
+ release tag first:
46
46
 
47
47
  ```sh
48
- git clone --branch v0.26.0 https://github.com/nowledge-co/hawdb.git
48
+ git clone --branch v0.28.0 https://github.com/nowledge-co/hawdb.git
49
49
  cd hawdb/bindings/python
50
50
  python -m pip install maturin==1.15.0
51
51
  maturin build --release --out dist
@@ -114,7 +114,7 @@ stable while the database is open. A Windows host can obtain the user's
114
114
  OS-provisioned LocalAppData path through the known-folder API. Pass the same
115
115
  anchor on read-only reopens. The default remains `None`; the dialect does not
116
116
  infer an anchor from directory existence or a permission error. See the
117
- [upstream host contract](https://github.com/nowledge-co/hawdb/blob/v0.26.0/bindings/python/README.md).
117
+ [upstream host contract](https://github.com/nowledge-co/hawdb/blob/v0.28.0/bindings/python/README.md).
118
118
 
119
119
  ## Supported behavior
120
120
 
@@ -149,9 +149,34 @@ rejects precision overflow. Decimal/`DOUBLE PRECISION` arithmetic and comparison
149
149
  require an explicit `CAST`; this bounded numeric contract does not provide PostgreSQL's
150
150
  arbitrary-precision numeric semantics.
151
151
 
152
- ### HawDB 0.26 compatibility
153
-
154
- HawDB 0.26 uses PEG for its supported SQL grammar and retains bounded,
152
+ ### HawDB 0.28 compatibility
153
+
154
+ HawDB 0.28 retains the Python DB-API, value conversions, and connection contract
155
+ from 0.27. CI checks published PyPI wheels separately from wheels built from the
156
+ release tag.
157
+
158
+ Queries that fix an equality prefix of a composite primary key and optionally
159
+ bound the next key column can now use a primary-key range seek. The dialect's
160
+ existing bound parameters, `order_by`, `limit`, and `offset` work with this
161
+ engine optimization. Ascending key order can avoid a sort; descending queries
162
+ still sort. Always specify `order_by` when application behavior depends on row
163
+ order, since a new access path can change unordered results.
164
+
165
+ Relational scans no longer have a fixed 16,384-entry cap on merged
166
+ uncheckpointed rows. They use the statement row budget instead. An explicit
167
+ `max_read_result_rows` supplied through `connect_args` still bounds SQL reads.
168
+ The integration tests cover a 20,000-row batch load, aggregation, mutations,
169
+ reopen, and budget refusal followed by a point read. They do not control
170
+ checkpoint timing; engine-level tests own the deterministic overlay regression.
171
+
172
+ New variable-length paths, relationship type disjunctions, scalar functions,
173
+ and comprehensions belong to Cypher. Per-query DiskANN beam/candidate settings
174
+ belong to the Rust vector search API. These do not add relational SQL syntax
175
+ or Python connection options. The embedded API renaming in this release is a
176
+ Rust source migration; the dialect does not use the renamed contracts. See the
177
+ [0.28 release notes](https://github.com/nowledge-co/hawdb/releases/tag/v0.28.0).
178
+
179
+ Since 0.26, HawDB uses PEG for its supported SQL grammar and retains bounded,
155
180
  schema-neutral templates for repeated parameterized INSERT, UPDATE, and DELETE
156
181
  statements. SQLAlchemy's compiled-statement cache and HawDB's syntax-template
157
182
  cache remain separate; values are bound for every execution. UPDATE arithmetic
@@ -159,11 +184,11 @@ works with typed DOUBLE and Decimal parameters, with the explicit-cast rules
159
184
  above. These engine changes do not imply support for the entire PostgreSQL
160
185
  grammar.
161
186
 
162
- CI creates persistent databases with the released HawDB 0.25.0 wheel in an
163
- isolated interpreter, then checks reads, indexes, Decimal scale, duplicate
164
- keyless rows, new writes, and reopen using 0.26. Both normal close and abrupt
165
- process exit after committed writes are covered. This is a focused default-
166
- configuration upgrade fixture, not a migration facility for older formats.
187
+ CI creates persistent databases in isolated HawDB 0.25.0, 0.26.0, and 0.27.0
188
+ interpreters, then checks reads, indexes, Decimal scale, duplicate keyless rows,
189
+ new writes, and reopen using 0.28. Both normal close and abrupt process exit
190
+ after committed writes are covered. This is a focused default-configuration
191
+ upgrade fixture, not a migration facility for older formats.
167
192
 
168
193
  ### Upgrading from 0.24
169
194
 
@@ -196,12 +221,19 @@ python -m pytest
196
221
  ```
197
222
 
198
223
  GitHub Actions builds the source distribution and wheel, checks their metadata,
199
- builds HawDB v0.26.0 from its upstream release tag, and tests the installed
224
+ builds HawDB v0.28.0 from its upstream release tag, and tests the installed
200
225
  dialect wheel on Python 3.11-3.13 with SQLAlchemy 2.0.x and 2.1.x for every push
201
- and pull request. The six test jobs also install HawDB 0.25.0 in a separate
202
- interpreter for cross-version data fixtures. To include those fixtures locally,
203
- set `HAWDB_PREVIOUS_PYTHON` to an interpreter containing exactly `hawdb==0.25.0`.
204
- The upgrade tests are skipped when that interpreter is not configured.
226
+ and pull request. An additional Python 3.11 / SQLAlchemy 2.1 job runs the same
227
+ tests with HawDB's published PyPI wheel instead of the source-built wheel.
228
+ All jobs run on Linux.
229
+
230
+ Each test job also installs HawDB 0.25.0 and 0.27.0 from PyPI and HawDB 0.26.0
231
+ from its release tag in separate interpreters for cross-version data fixtures. Version
232
+ 0.26.0 was not published to PyPI. To include those fixtures locally, set
233
+ `HAWDB_PREVIOUS_PYTHON` to an interpreter containing exactly `hawdb==0.25.0` and
234
+ `HAWDB_026_PYTHON` to one containing exactly `hawdb==0.26.0`, and
235
+ `HAWDB_027_PYTHON` to one containing exactly `hawdb==0.27.0`. Upgrade tests for
236
+ an interpreter are skipped when its environment variable is not configured.
205
237
 
206
238
  These are the project's targeted compatibility tests. SQLAlchemy's full
207
239
  `sqlalchemy.testing.suite` additionally requires HawDB-specific capability
@@ -212,7 +244,7 @@ compliance gate.
212
244
 
213
245
  `.github/workflows/pypi.yaml` publishes the tested source distribution and wheel
214
246
  when a GitHub Release is published. The release tag must match the version in
215
- `pyproject.toml`, for example `v0.26.0`. A manual workflow dispatch runs the same
247
+ `pyproject.toml`, for example `v0.28.0`. A manual workflow dispatch runs the same
216
248
  build and tests without uploading to PyPI.
217
249
 
218
250
  Configure a PyPI Trusted Publisher for the `sqlalchemy-hawdb` project with:
@@ -9,5 +9,6 @@ sqlalchemy_hawdb.egg-info/entry_points.txt
9
9
  sqlalchemy_hawdb.egg-info/requires.txt
10
10
  sqlalchemy_hawdb.egg-info/top_level.txt
11
11
  tests/test_dialect.py
12
+ tests/test_relational_028.py
12
13
  tests/test_sqlalchemy_integration.py
13
14
  tests/test_upgrade.py
@@ -1,5 +1,5 @@
1
1
  SQLAlchemy<3.0,>=2.0
2
- hawdb<0.27.0,>=0.26.0
2
+ hawdb<0.29.0,>=0.28.0
3
3
 
4
4
  [test]
5
5
  pytest<9,>=8
@@ -0,0 +1,202 @@
1
+ import pytest
2
+ from sqlalchemy import (
3
+ Column,
4
+ Integer,
5
+ MetaData,
6
+ Table,
7
+ bindparam,
8
+ create_engine,
9
+ func,
10
+ select,
11
+ )
12
+ from sqlalchemy.engine import URL
13
+ from sqlalchemy.exc import DBAPIError
14
+
15
+
16
+ @pytest.mark.parametrize("descending", [False, True])
17
+ def test_composite_primary_key_range_seek_with_rebinding_and_rollback(
18
+ tmp_path, descending
19
+ ):
20
+ engine = create_engine(URL.create("hawdb", database=str(tmp_path / "range.hawdb")))
21
+ metadata = MetaData()
22
+ orders = Table(
23
+ "orders",
24
+ metadata,
25
+ Column("tenant_id", Integer, primary_key=True, autoincrement=False),
26
+ Column("warehouse_id", Integer, primary_key=True, autoincrement=False),
27
+ Column("order_id", Integer, primary_key=True, autoincrement=False),
28
+ )
29
+ order = orders.c.order_id.desc() if descending else orders.c.order_id
30
+ statement = (
31
+ select(orders.c.order_id)
32
+ .where(
33
+ orders.c.tenant_id == bindparam("tenant"),
34
+ orders.c.warehouse_id == bindparam("warehouse"),
35
+ orders.c.order_id > bindparam("lower"),
36
+ orders.c.order_id <= bindparam("upper"),
37
+ )
38
+ .order_by(order)
39
+ .limit(2)
40
+ .offset(1)
41
+ )
42
+ first = {"tenant": 1, "warehouse": 1, "lower": 2, "upper": 6}
43
+ first_expected = [5, 4] if descending else [4, 5]
44
+ try:
45
+ metadata.create_all(engine)
46
+ with engine.begin() as connection:
47
+ connection.execute(
48
+ orders.insert(),
49
+ [
50
+ {
51
+ "tenant_id": tenant,
52
+ "warehouse_id": warehouse,
53
+ "order_id": identifier,
54
+ }
55
+ for tenant in (1, 2)
56
+ for warehouse in (1, 2)
57
+ for identifier in range(1, 21)
58
+ ],
59
+ )
60
+ with engine.connect() as connection:
61
+ compiled = statement.compile(dialect=engine.dialect)
62
+ values = {**compiled.params, **first}
63
+ plan = (
64
+ connection.exec_driver_sql(
65
+ f"EXPLAIN {compiled}",
66
+ tuple(values[name] for name in compiled.positiontup),
67
+ )
68
+ .mappings()
69
+ .all()
70
+ )
71
+ assert any("TableRangeScanExec" in row["id"] for row in plan)
72
+ assert any(
73
+ "primary_key_range" in (row["access object"] or "") for row in plan
74
+ )
75
+ if not descending:
76
+ assert all(
77
+ "SortExec" not in row["id"] and "TopNExec" not in row["id"]
78
+ for row in plan
79
+ )
80
+
81
+ for parameters, expected in (
82
+ (first, first_expected),
83
+ (
84
+ {"tenant": 2, "warehouse": 2, "lower": 17, "upper": 20},
85
+ [19, 18] if descending else [19, 20],
86
+ ),
87
+ ({"tenant": 1, "warehouse": 1, "lower": None, "upper": 6}, []),
88
+ ({"tenant": 1, "warehouse": 1, "lower": 6, "upper": 2}, []),
89
+ (first, first_expected),
90
+ ):
91
+ assert connection.scalars(statement, parameters).all() == expected
92
+ connection.rollback()
93
+
94
+ connection.execute(
95
+ orders.delete().where(
96
+ orders.c.tenant_id == 1,
97
+ orders.c.warehouse_id == 1,
98
+ orders.c.order_id == 4,
99
+ )
100
+ )
101
+ assert connection.scalars(statement, first).all() == (
102
+ [5, 3] if descending else [5, 6]
103
+ )
104
+ connection.rollback()
105
+ assert connection.scalars(statement, first).all() == first_expected
106
+ finally:
107
+ engine.dispose()
108
+
109
+
110
+ def test_batch_load_scans_and_aggregates_after_multiple_commits(tmp_path):
111
+ engine = create_engine(URL.create("hawdb", database=str(tmp_path / "batch.hawdb")))
112
+ metadata = MetaData()
113
+ records = Table(
114
+ "records",
115
+ metadata,
116
+ Column("id", Integer, primary_key=True, autoincrement=False),
117
+ Column("value", Integer),
118
+ )
119
+ count = 20_000
120
+ total = count * (count + 1) // 2
121
+ try:
122
+ metadata.create_all(engine)
123
+ with engine.connect() as connection:
124
+ for start in range(1, count + 1, 4_000):
125
+ connection.execute(
126
+ records.insert(),
127
+ [
128
+ {"id": identifier, "value": identifier}
129
+ for identifier in range(start, start + 4_000)
130
+ ],
131
+ )
132
+ connection.commit()
133
+ assert connection.scalar(select(func.count()).select_from(records)) == count
134
+ assert connection.scalar(select(func.sum(records.c.value))) == total
135
+ assert connection.scalars(
136
+ select(records.c.id)
137
+ .where(records.c.value >= 0)
138
+ .order_by(records.c.id)
139
+ .limit(3)
140
+ ).all() == [1, 2, 3]
141
+ assert connection.scalars(
142
+ select(records.c.id).order_by(records.c.value.desc()).limit(2)
143
+ ).all() == [count, count - 1]
144
+
145
+ connection.execute(
146
+ records.update()
147
+ .where(records.c.id <= 1_000)
148
+ .values(value=records.c.value + 1)
149
+ )
150
+ connection.execute(records.delete().where(records.c.id > count - 100))
151
+ connection.commit()
152
+ expected_total = total + 1_000 - sum(range(count - 99, count + 1))
153
+ assert (
154
+ connection.scalar(select(func.count()).select_from(records))
155
+ == count - 100
156
+ )
157
+ assert (
158
+ connection.scalar(select(func.sum(records.c.value))) == expected_total
159
+ )
160
+ finally:
161
+ engine.dispose()
162
+
163
+ reopened = create_engine(engine.url)
164
+ try:
165
+ with reopened.connect() as connection:
166
+ assert (
167
+ connection.scalar(select(func.count()).select_from(records))
168
+ == count - 100
169
+ )
170
+ assert (
171
+ connection.scalar(select(func.sum(records.c.value))) == expected_total
172
+ )
173
+ finally:
174
+ reopened.dispose()
175
+
176
+
177
+ def test_statement_row_budget_refuses_scan_but_allows_point_read(tmp_path):
178
+ url = URL.create("hawdb", database=str(tmp_path / "budget.hawdb"))
179
+ engine = create_engine(url)
180
+ metadata = MetaData()
181
+ records = Table(
182
+ "records",
183
+ metadata,
184
+ Column("id", Integer, primary_key=True, autoincrement=False),
185
+ )
186
+ try:
187
+ metadata.create_all(engine)
188
+ with engine.begin() as connection:
189
+ connection.execute(
190
+ records.insert(), [{"id": identifier} for identifier in (1, 2, 3)]
191
+ )
192
+ finally:
193
+ engine.dispose()
194
+
195
+ limited = create_engine(url, connect_args={"max_read_result_rows": 1})
196
+ try:
197
+ with limited.connect() as connection:
198
+ with pytest.raises(DBAPIError, match="max_intermediate_rows 1"):
199
+ connection.execute(select(records.c.id))
200
+ assert connection.scalar(select(records.c.id).where(records.c.id == 3)) == 3
201
+ finally:
202
+ limited.dispose()
@@ -28,7 +28,7 @@ def test_engine_initializes_version_and_default_schema(tmp_path):
28
28
  engine = make_engine(tmp_path / "initialization.hawdb")
29
29
  try:
30
30
  with engine.connect() as connection:
31
- assert engine.dialect.server_version_info[:2] == (0, 26)
31
+ assert engine.dialect.server_version_info[:2] == (0, 28)
32
32
  assert inspect(connection).default_schema_name == "public"
33
33
  finally:
34
34
  engine.dispose()
@@ -9,15 +9,27 @@ from sqlalchemy.engine import URL
9
9
 
10
10
 
11
11
  @pytest.mark.parametrize("close_mode", ["close", "process_exit"])
12
- def test_025_database_reopens_and_accepts_writes_in_026(tmp_path, close_mode):
13
- previous_python = os.environ.get("HAWDB_PREVIOUS_PYTHON")
12
+ @pytest.mark.parametrize(
13
+ ("previous_version", "interpreter_env"),
14
+ [
15
+ ("0.25.0", "HAWDB_PREVIOUS_PYTHON"),
16
+ ("0.26.0", "HAWDB_026_PYTHON"),
17
+ ("0.27.0", "HAWDB_027_PYTHON"),
18
+ ],
19
+ )
20
+ def test_previous_database_reopens_and_accepts_writes_in_current_release(
21
+ tmp_path, close_mode, previous_version, interpreter_env
22
+ ):
23
+ previous_python = os.environ.get(interpreter_env)
14
24
  if previous_python is None:
15
- pytest.skip("Set HAWDB_PREVIOUS_PYTHON to an isolated HawDB 0.25 interpreter")
25
+ pytest.skip(
26
+ f"Set {interpreter_env} to an isolated HawDB {previous_version} interpreter"
27
+ )
16
28
 
17
29
  path = tmp_path / "upgrade.hawdb"
18
- fixture_script = Path(__file__).parent / "fixtures" / "create_025_database.py"
30
+ fixture_script = Path(__file__).parent / "fixtures" / "create_previous_database.py"
19
31
  fixture = subprocess.run(
20
- [previous_python, str(fixture_script), str(path), close_mode],
32
+ [previous_python, str(fixture_script), str(path), close_mode, previous_version],
21
33
  check=False,
22
34
  capture_output=True,
23
35
  text=True,