surreal-orm-lite 0.38.2__tar.gz → 0.38.3__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 (63) hide show
  1. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/CHANGELOG.md +17 -0
  2. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/PKG-INFO +11 -10
  3. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/README.md +10 -9
  4. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/pyproject.toml +1 -1
  5. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/__init__.py +1 -1
  6. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/subquery.py +3 -3
  7. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/.gitignore +0 -0
  8. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/LICENSE +0 -0
  9. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/Makefile +0 -0
  10. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/_sdk.py +0 -0
  11. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/aggregations.py +0 -0
  12. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/auth.py +0 -0
  13. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/cache.py +0 -0
  14. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/changefeed.py +0 -0
  15. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/concurrency.py +0 -0
  16. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/connection_config.py +0 -0
  17. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/connection_manager.py +0 -0
  18. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/constants.py +0 -0
  19. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/decoding.py +0 -0
  20. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/define_parser.py +0 -0
  21. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/edge.py +0 -0
  22. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/embedded.py +0 -0
  23. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/encoding.py +0 -0
  24. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/enum.py +0 -0
  25. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/exceptions.py +0 -0
  26. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/functions.py +0 -0
  27. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/geo.py +0 -0
  28. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/hybrid.py +0 -0
  29. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/introspection.py +0 -0
  30. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/live.py +0 -0
  31. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/__init__.py +0 -0
  32. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/autodetect.py +0 -0
  33. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/compare.py +0 -0
  34. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/constants.py +0 -0
  35. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/executor.py +0 -0
  36. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/generator.py +0 -0
  37. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/introspector.py +0 -0
  38. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/loader.py +0 -0
  39. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/migration.py +0 -0
  40. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/operations.py +0 -0
  41. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/render.py +0 -0
  42. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/migrations/state.py +0 -0
  43. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/model_auth.py +0 -0
  44. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/model_base.py +0 -0
  45. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/model_ddl.py +0 -0
  46. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/model_generator.py +0 -0
  47. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/py.typed +0 -0
  48. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/q.py +0 -0
  49. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/query_set.py +0 -0
  50. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/routing.py +0 -0
  51. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/schema.py +0 -0
  52. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/schema_state.py +0 -0
  53. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/search.py +0 -0
  54. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/signals.py +0 -0
  55. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/surql_literal.py +0 -0
  56. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/testing/__init__.py +0 -0
  57. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/testing/database.py +0 -0
  58. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/testing/fixtures.py +0 -0
  59. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/time_travel.py +0 -0
  60. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/transaction.py +0 -0
  61. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/types.py +0 -0
  62. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/utils.py +0 -0
  63. {surreal_orm_lite-0.38.2 → surreal_orm_lite-0.38.3}/src/surreal_orm_lite/vector.py +0 -0
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.38.3] - 2026-10-30
9
+
10
+ Test pins move to SurrealDB 3.3.5, which fixes the inline ordered and limited sub-SELECT bug
11
+ (surrealdb/surrealdb#7470).
12
+
13
+ ### Changed
14
+
15
+ - The primary test pin is now SurrealDB **3.3.5** (CI, `.surrealdb-version`, README, ROADMAP).
16
+ The 2.x line stays on 2.7.0.
17
+
18
+ ### Fixed
19
+
20
+ - The #7470 pin test now expects the wrong rows only on SurrealDB 3.2.0 to 3.3.4 and the right
21
+ rows on 2.x, 3.1 and 3.3.5+ (it failed on purpose when the server fixed the bug). The ORM still
22
+ binds each subquery once in a `LET`, which the affected releases need; README and docstrings
23
+ name the affected range.
24
+
8
25
  ## [0.38.2] - 2026-10-30
9
26
 
10
27
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: surreal-orm-lite
3
- Version: 0.38.2
3
+ Version: 0.38.3
4
4
  Summary: Lightweight Django-style ORM for SurrealDB using the official Python SDK. Async support with Pydantic validation.
5
5
  Project-URL: Homepage, https://github.com/EulogySnowfall/SurrealDB-ORM-lite
6
6
  Project-URL: Documentation, https://github.com/EulogySnowfall/SurrealDB-ORM-lite
@@ -52,7 +52,7 @@ Description-Content-Type: text/markdown
52
52
  # Surreal ORM Lite
53
53
 
54
54
  ![Python](https://img.shields.io/badge/python-3.11%2B-blue)
55
- ![SurrealDB](https://img.shields.io/badge/SurrealDB-2.7.0%20%7C%203.3.4-purple)
55
+ ![SurrealDB](https://img.shields.io/badge/SurrealDB-2.7.0%20%7C%203.3.5-purple)
56
56
  ![SDK](https://img.shields.io/badge/SDK-Official%202.0-green)
57
57
  ![License](https://img.shields.io/badge/license-MIT-blue)
58
58
  [![codecov](https://codecov.io/gh/EulogySnowfall/SurrealDB-ORM-lite/graph/badge.svg)](https://codecov.io/gh/EulogySnowfall/SurrealDB-ORM-lite)
@@ -79,7 +79,7 @@ This ORM is designed to:
79
79
  | Official SDK | surrealdb[pydantic]>=2.0.0,<3.0.0 |
80
80
  | Pydantic | >=2.13.4 |
81
81
 
82
- > **Note**: As of v0.7.0, Surreal ORM Lite targets the SurrealDB Python SDK 2.x (`surrealdb[pydantic]>=2.0.0,<3.0.0`), which supports the SurrealDB 3.x protocol. It is tested against SurrealDB **v2.7.0** and **v3.3.4**; up to v0.19.0 the pins were v2.6.5 and v3.2.4. The 2.x line behaves identically on 2.7.0, and 3.3.0 differs from 3.2.4 in one server behaviour, listed in the behaviour table. SurrealDB 3.1.x is no longer a supported line as of v0.14.0 — the suite is still run against 3.1.5 as a backward-compatibility check, but a regression there does not block a release.
82
+ > **Note**: As of v0.7.0, Surreal ORM Lite targets the SurrealDB Python SDK 2.x (`surrealdb[pydantic]>=2.0.0,<3.0.0`), which supports the SurrealDB 3.x protocol. It is tested against SurrealDB **v2.7.0** and **v3.3.5**; up to v0.19.0 the pins were v2.6.5 and v3.2.4. The 2.x line behaves identically on 2.7.0, and 3.3.0 differs from 3.2.4 in one server behaviour, listed in the behaviour table. SurrealDB 3.1.x is no longer a supported line as of v0.14.0 — the suite is still run against 3.1.5 as a backward-compatibility check, but a regression there does not block a release.
83
83
 
84
84
  ---
85
85
 
@@ -964,7 +964,7 @@ await user.merge(plan="pro", server_values={"updated_at": SurrealFunc.call(Surre
964
964
 
965
965
  `SurrealFunc.call(fn, *args)` builds `fn(arg, …)` from a function name — a plain string or a
966
966
  member of the shipped enums, which give you autocompletion over a **curated catalog whose every
967
- member is tested against SurrealDB 2.7.0 and 3.3.4**:
967
+ member is tested against SurrealDB 2.7.0 and 3.3.5**:
968
968
 
969
969
  | Enum | Covers |
970
970
  | ----------------------- | ---------------------------------------------------------------- |
@@ -3613,10 +3613,11 @@ A statement with subqueries is one block, whose `LET`s bind each subquery once,
3613
3613
  { LET $_sq0 = (SELECT id AS _sqv, age FROM Person WHERE active = $_f0 ORDER BY age DESC LIMIT 1)._sqv; (SELECT * FROM Post WHERE author IN $_sq0) };
3614
3614
  ```
3615
3615
 
3616
- - **Why a `LET`**: SurrealDB 3.2 and later can return wrong rows for an inline sub-SELECT with
3616
+ - **Why a `LET`**: SurrealDB 3.2.0 to 3.3.4 can return wrong rows for an inline sub-SELECT with
3617
3617
  `ORDER BY` and `LIMIT`, which gives its value to the first outer record only
3618
- ([surrealdb/surrealdb#7470](https://github.com/surrealdb/surrealdb/issues/7470)). Bound once,
3619
- the subquery is right on every line, and the server runs it once instead of once per record.
3618
+ ([surrealdb/surrealdb#7470](https://github.com/surrealdb/surrealdb/issues/7470), fixed in 3.3.5).
3619
+ Bound once, the subquery is right on every release, and the server runs it once instead of once
3620
+ per record.
3620
3621
  - **Why `_sqv`**: an ordered subquery selects its column as `_sqv`, with its order fields, and
3621
3622
  reads `._sqv` back: SurrealDB 2.x refuses to order a sub-SELECT of one column by another field.
3622
3623
  - **Reserved names**: `$_sq0`, `$_sq1`, … (`_sq<N>`) are the block's `LET`s and hide a
@@ -7150,7 +7151,7 @@ As of v0.7.0, Surreal ORM Lite uses `surrealdb[pydantic]>=2.0.0,<3.0.0` (Surreal
7150
7151
 
7151
7152
  | SurrealDB Version | SDK Version | Status |
7152
7153
  | -------------------------------------------------- | ----------- | ------------------------------------ |
7153
- | 3.3.4 | 2.0 | ✅ Tested |
7154
+ | 3.3.5 | 2.0 | ✅ Tested |
7154
7155
  | 2.7.0 | 2.0 | ✅ Tested |
7155
7156
  | Embedded engine (SDK 2.0.0: SurrealDB 2.3.10 core) | 2.0 | ✅ Tested (in-process) |
7156
7157
  | 3.2.4 | 2.0 | ✅ Compatible (tested up to v0.19.0) |
@@ -7185,7 +7186,7 @@ The SDK's in-process engine has a table of its own: [ORM behaviour: the embedded
7185
7186
  | `patch()` / `atomic_append` / `atomic_set_add` / `atomic_remove` / `atomic_increment` | same on both lines (portable `array::*` fns chosen over divergent `+=`/`-=`) | same on both lines | v0.11.0 |
7186
7187
  | `retry_on_conflict` / `SurrealDbConflictError` (retryable conflict) | same type + decorator; conflicts rarer (engine serialises more), except on `CHANGEFEED` tables (section 22) | same type + decorator; conflicts are the normal optimistic-MVCC failure | v0.12.0 |
7187
7188
  | `SurrealFunc` / `server_values=` / `extra_vars=` on `save`/`merge` | same on both lines (compiled to portable `CREATE`/`UPDATE … SET`) | same on both lines | v0.13.0 |
7188
- | Shipped function-name enums (`SurrealTimeFunction`, `SurrealCryptoFunction`, …) | every catalogued member verified on 2.7.0 | every catalogued member verified on 3.3.4 | v0.13.0 |
7189
+ | Shipped function-name enums (`SurrealTimeFunction`, `SurrealCryptoFunction`, …) | every catalogued member verified on 2.7.0 | every catalogued member verified on 3.3.5 | v0.13.0 |
7189
7190
  | `server_values` inside a transaction — when the instance sees the computed value | only after commit (buffered; `refresh()` to read it) | immediately (interactive returns the row) | v0.13.0 |
7190
7191
  | `merge(server_values=)` on a missing record / never-created table | server returns no rows → ORM raises `SurrealDbError` | server raises `NotFound` for a missing table → ORM raises the same error | v0.13.0 |
7191
7192
  | Computed fields (`Computed[...]` → `DEFINE FIELD … VALUE`) | same on both lines (DDL, recompute triggers, precedence over client data) | same on both lines | v0.14.0 |
@@ -7270,7 +7271,7 @@ The SDK's in-process engine has a table of its own: [ORM behaviour: the embedded
7270
7271
  | Writing history with a raw `CREATE … VERSION` | stored at that moment, readable with `as_of()` | accepted, not readable at that moment (the table did not exist then) | v0.26.0 |
7271
7272
  | `as_of()` moment before 1970-01-01 or after 2262-04-11T23:47:16.854775Z | refused by the ORM before any read (`ValueError`; `SurrealDbError` for a duration or expression resolving there): the server reads an earlier moment as the current state | refused by the ORM before any read, same errors: the server would fail with an internal error | v0.26.0 |
7272
7273
  | Subqueries (`Subquery`, or a QuerySet as a filter value) | one statement for every read, count, aggregation, write by filter and live query; reads inside a transaction raise (buffered) | the same, and reads inside an interactive transaction (`objects(tx=)`) see its uncommitted writes | v0.27.0 |
7273
- | A subquery with `order_by()` and `limit()` | right; the ORM also selects the order fields, without which 2.x refuses to order by a field other than the one compared | right: the ORM binds each subquery once, in a `LET`; 3.2 and later can return wrong rows for such an inline sub-SELECT (surrealdb#7470) | v0.27.0 |
7274
+ | A subquery with `order_by()` and `limit()` | right; the ORM also selects the order fields, without which 2.x refuses to order by a field other than the one compared | right: the ORM binds each subquery once, in a `LET`; 3.2.0 to 3.3.4 can return wrong rows for such an inline sub-SELECT (surrealdb#7470, fixed in 3.3.5) | v0.27.0 |
7274
7275
  | A subquery reading a table that does not exist | read as empty, like any missing table | read as empty in three requests (statement, table probe, re-send); other errors, even ones quoting "does not exist", are relayed; transaction writes fail; `live()` raises on start | v0.27.0 |
7275
7276
  | Subqueries under `as_of()` | each subquery reads at the same moment: the ORM adds `VERSION` to it (the server would read the current state) | the same (the server applies the outer `VERSION` to an inline sub-SELECT only); without versioned storage `SurrealDbError`, but 3.1.5 raises the server's own `ThrownError` | v0.27.0 |
7276
7277
  | Query cache (`cache()`, `QueryCache`) | same on both lines: client-side, per connection and identity; writes in a transaction invalidate at commit; reads in one are never cached (on 2.x they raise: buffered) | the same; reads inside an interactive transaction are never cached (they see its uncommitted writes) | v0.28.0 |
@@ -1,7 +1,7 @@
1
1
  # Surreal ORM Lite
2
2
 
3
3
  ![Python](https://img.shields.io/badge/python-3.11%2B-blue)
4
- ![SurrealDB](https://img.shields.io/badge/SurrealDB-2.7.0%20%7C%203.3.4-purple)
4
+ ![SurrealDB](https://img.shields.io/badge/SurrealDB-2.7.0%20%7C%203.3.5-purple)
5
5
  ![SDK](https://img.shields.io/badge/SDK-Official%202.0-green)
6
6
  ![License](https://img.shields.io/badge/license-MIT-blue)
7
7
  [![codecov](https://codecov.io/gh/EulogySnowfall/SurrealDB-ORM-lite/graph/badge.svg)](https://codecov.io/gh/EulogySnowfall/SurrealDB-ORM-lite)
@@ -28,7 +28,7 @@ This ORM is designed to:
28
28
  | Official SDK | surrealdb[pydantic]>=2.0.0,<3.0.0 |
29
29
  | Pydantic | >=2.13.4 |
30
30
 
31
- > **Note**: As of v0.7.0, Surreal ORM Lite targets the SurrealDB Python SDK 2.x (`surrealdb[pydantic]>=2.0.0,<3.0.0`), which supports the SurrealDB 3.x protocol. It is tested against SurrealDB **v2.7.0** and **v3.3.4**; up to v0.19.0 the pins were v2.6.5 and v3.2.4. The 2.x line behaves identically on 2.7.0, and 3.3.0 differs from 3.2.4 in one server behaviour, listed in the behaviour table. SurrealDB 3.1.x is no longer a supported line as of v0.14.0 — the suite is still run against 3.1.5 as a backward-compatibility check, but a regression there does not block a release.
31
+ > **Note**: As of v0.7.0, Surreal ORM Lite targets the SurrealDB Python SDK 2.x (`surrealdb[pydantic]>=2.0.0,<3.0.0`), which supports the SurrealDB 3.x protocol. It is tested against SurrealDB **v2.7.0** and **v3.3.5**; up to v0.19.0 the pins were v2.6.5 and v3.2.4. The 2.x line behaves identically on 2.7.0, and 3.3.0 differs from 3.2.4 in one server behaviour, listed in the behaviour table. SurrealDB 3.1.x is no longer a supported line as of v0.14.0 — the suite is still run against 3.1.5 as a backward-compatibility check, but a regression there does not block a release.
32
32
 
33
33
  ---
34
34
 
@@ -913,7 +913,7 @@ await user.merge(plan="pro", server_values={"updated_at": SurrealFunc.call(Surre
913
913
 
914
914
  `SurrealFunc.call(fn, *args)` builds `fn(arg, …)` from a function name — a plain string or a
915
915
  member of the shipped enums, which give you autocompletion over a **curated catalog whose every
916
- member is tested against SurrealDB 2.7.0 and 3.3.4**:
916
+ member is tested against SurrealDB 2.7.0 and 3.3.5**:
917
917
 
918
918
  | Enum | Covers |
919
919
  | ----------------------- | ---------------------------------------------------------------- |
@@ -3562,10 +3562,11 @@ A statement with subqueries is one block, whose `LET`s bind each subquery once,
3562
3562
  { LET $_sq0 = (SELECT id AS _sqv, age FROM Person WHERE active = $_f0 ORDER BY age DESC LIMIT 1)._sqv; (SELECT * FROM Post WHERE author IN $_sq0) };
3563
3563
  ```
3564
3564
 
3565
- - **Why a `LET`**: SurrealDB 3.2 and later can return wrong rows for an inline sub-SELECT with
3565
+ - **Why a `LET`**: SurrealDB 3.2.0 to 3.3.4 can return wrong rows for an inline sub-SELECT with
3566
3566
  `ORDER BY` and `LIMIT`, which gives its value to the first outer record only
3567
- ([surrealdb/surrealdb#7470](https://github.com/surrealdb/surrealdb/issues/7470)). Bound once,
3568
- the subquery is right on every line, and the server runs it once instead of once per record.
3567
+ ([surrealdb/surrealdb#7470](https://github.com/surrealdb/surrealdb/issues/7470), fixed in 3.3.5).
3568
+ Bound once, the subquery is right on every release, and the server runs it once instead of once
3569
+ per record.
3569
3570
  - **Why `_sqv`**: an ordered subquery selects its column as `_sqv`, with its order fields, and
3570
3571
  reads `._sqv` back: SurrealDB 2.x refuses to order a sub-SELECT of one column by another field.
3571
3572
  - **Reserved names**: `$_sq0`, `$_sq1`, … (`_sq<N>`) are the block's `LET`s and hide a
@@ -7099,7 +7100,7 @@ As of v0.7.0, Surreal ORM Lite uses `surrealdb[pydantic]>=2.0.0,<3.0.0` (Surreal
7099
7100
 
7100
7101
  | SurrealDB Version | SDK Version | Status |
7101
7102
  | -------------------------------------------------- | ----------- | ------------------------------------ |
7102
- | 3.3.4 | 2.0 | ✅ Tested |
7103
+ | 3.3.5 | 2.0 | ✅ Tested |
7103
7104
  | 2.7.0 | 2.0 | ✅ Tested |
7104
7105
  | Embedded engine (SDK 2.0.0: SurrealDB 2.3.10 core) | 2.0 | ✅ Tested (in-process) |
7105
7106
  | 3.2.4 | 2.0 | ✅ Compatible (tested up to v0.19.0) |
@@ -7134,7 +7135,7 @@ The SDK's in-process engine has a table of its own: [ORM behaviour: the embedded
7134
7135
  | `patch()` / `atomic_append` / `atomic_set_add` / `atomic_remove` / `atomic_increment` | same on both lines (portable `array::*` fns chosen over divergent `+=`/`-=`) | same on both lines | v0.11.0 |
7135
7136
  | `retry_on_conflict` / `SurrealDbConflictError` (retryable conflict) | same type + decorator; conflicts rarer (engine serialises more), except on `CHANGEFEED` tables (section 22) | same type + decorator; conflicts are the normal optimistic-MVCC failure | v0.12.0 |
7136
7137
  | `SurrealFunc` / `server_values=` / `extra_vars=` on `save`/`merge` | same on both lines (compiled to portable `CREATE`/`UPDATE … SET`) | same on both lines | v0.13.0 |
7137
- | Shipped function-name enums (`SurrealTimeFunction`, `SurrealCryptoFunction`, …) | every catalogued member verified on 2.7.0 | every catalogued member verified on 3.3.4 | v0.13.0 |
7138
+ | Shipped function-name enums (`SurrealTimeFunction`, `SurrealCryptoFunction`, …) | every catalogued member verified on 2.7.0 | every catalogued member verified on 3.3.5 | v0.13.0 |
7138
7139
  | `server_values` inside a transaction — when the instance sees the computed value | only after commit (buffered; `refresh()` to read it) | immediately (interactive returns the row) | v0.13.0 |
7139
7140
  | `merge(server_values=)` on a missing record / never-created table | server returns no rows → ORM raises `SurrealDbError` | server raises `NotFound` for a missing table → ORM raises the same error | v0.13.0 |
7140
7141
  | Computed fields (`Computed[...]` → `DEFINE FIELD … VALUE`) | same on both lines (DDL, recompute triggers, precedence over client data) | same on both lines | v0.14.0 |
@@ -7219,7 +7220,7 @@ The SDK's in-process engine has a table of its own: [ORM behaviour: the embedded
7219
7220
  | Writing history with a raw `CREATE … VERSION` | stored at that moment, readable with `as_of()` | accepted, not readable at that moment (the table did not exist then) | v0.26.0 |
7220
7221
  | `as_of()` moment before 1970-01-01 or after 2262-04-11T23:47:16.854775Z | refused by the ORM before any read (`ValueError`; `SurrealDbError` for a duration or expression resolving there): the server reads an earlier moment as the current state | refused by the ORM before any read, same errors: the server would fail with an internal error | v0.26.0 |
7221
7222
  | Subqueries (`Subquery`, or a QuerySet as a filter value) | one statement for every read, count, aggregation, write by filter and live query; reads inside a transaction raise (buffered) | the same, and reads inside an interactive transaction (`objects(tx=)`) see its uncommitted writes | v0.27.0 |
7222
- | A subquery with `order_by()` and `limit()` | right; the ORM also selects the order fields, without which 2.x refuses to order by a field other than the one compared | right: the ORM binds each subquery once, in a `LET`; 3.2 and later can return wrong rows for such an inline sub-SELECT (surrealdb#7470) | v0.27.0 |
7223
+ | A subquery with `order_by()` and `limit()` | right; the ORM also selects the order fields, without which 2.x refuses to order by a field other than the one compared | right: the ORM binds each subquery once, in a `LET`; 3.2.0 to 3.3.4 can return wrong rows for such an inline sub-SELECT (surrealdb#7470, fixed in 3.3.5) | v0.27.0 |
7223
7224
  | A subquery reading a table that does not exist | read as empty, like any missing table | read as empty in three requests (statement, table probe, re-send); other errors, even ones quoting "does not exist", are relayed; transaction writes fail; `live()` raises on start | v0.27.0 |
7224
7225
  | Subqueries under `as_of()` | each subquery reads at the same moment: the ORM adds `VERSION` to it (the server would read the current state) | the same (the server applies the outer `VERSION` to an inline sub-SELECT only); without versioned storage `SurrealDbError`, but 3.1.5 raises the server's own `ThrownError` | v0.27.0 |
7225
7226
  | Query cache (`cache()`, `QueryCache`) | same on both lines: client-side, per connection and identity; writes in a transaction invalidate at commit; reads in one are never cached (on 2.x they raise: buffered) | the same; reads inside an interactive transaction are never cached (they see its uncommitted writes) | v0.28.0 |
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "surreal-orm-lite"
3
- version = "0.38.2"
3
+ version = "0.38.3"
4
4
  description = "Lightweight Django-style ORM for SurrealDB using the official Python SDK. Async support with Pydantic validation."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,4 +1,4 @@
1
- __version__ = "0.38.2"
1
+ __version__ = "0.38.3"
2
2
 
3
3
  from ._sdk import BoundExcluded, BoundIncluded
4
4
  from .aggregations import Aggregation, Avg, Count, Max, Min, Sum
@@ -12,9 +12,9 @@ value is read as ``Subquery(qs)`` — sends **one** statement, inside which the
12
12
  is its last one, on 2.x, 3.x and the embedded engine, over WebSocket and HTTP, in a buffered batch and in an
13
13
  interactive transaction. Its ``LET`` s are scoped to the block (a bound ``$_sq0`` is shadowed), each evaluated
14
14
  once, innermost first; the trailing statement is parenthesised, without which 2.x answers ``None``.
15
- - **Once, in a ``LET``.** SurrealDB 3.2 and later give an inline uncorrelated sub-SELECT with ``ORDER BY`` and
16
- ``LIMIT`` its value for the first outer row only (surrealdb/surrealdb#7470). Bound once in a ``LET`` it is right
17
- on every line, and evaluated once instead of once per outer row.
15
+ - **Once, in a ``LET``.** SurrealDB 3.2.0 to 3.3.4 give an inline uncorrelated sub-SELECT with ``ORDER BY`` and
16
+ ``LIMIT`` its value for the first outer row only (surrealdb/surrealdb#7470, fixed in 3.3.5). Bound once in a
17
+ ``LET`` it is right on every release, and evaluated once instead of once per outer row.
18
18
  - **``_sqv``.** A subquery ordered by a field compiles to ``(SELECT <column> AS _sqv, <order columns> FROM … ORDER
19
19
  BY …)._sqv``: 2.x refuses ``SELECT VALUE x … ORDER BY y`` and orders wrongly by a column it selects only under
20
20
  an alias, while this form is right on every line. ``_sqv`` (:data:`VALUE_ALIAS`) and ``_sq<N>``