type-bridge 2.1.0__tar.gz → 2.2.1__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 (106) hide show
  1. {type_bridge-2.1.0 → type_bridge-2.2.1}/PKG-INFO +20 -10
  2. {type_bridge-2.1.0 → type_bridge-2.2.1}/README.md +15 -5
  3. {type_bridge-2.1.0 → type_bridge-2.2.1}/pyproject.toml +9 -5
  4. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/__init__.py +1 -1
  5. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/_backend.py +1 -1
  6. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/_runtime_projection.py +23 -0
  7. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/_rust_runtime.py +14 -0
  8. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/session.py +92 -28
  9. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typedb_driver.py +4 -4
  10. {type_bridge-2.1.0 → type_bridge-2.2.1}/.gitignore +0 -0
  11. {type_bridge-2.1.0 → type_bridge-2.2.1}/LICENSE +0 -0
  12. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/_rust.py +0 -0
  13. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/__init__.py +0 -0
  14. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/base.py +0 -0
  15. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/boolean.py +0 -0
  16. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/date.py +0 -0
  17. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/datetime.py +0 -0
  18. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/datetimetz.py +0 -0
  19. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/decimal.py +0 -0
  20. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/double.py +0 -0
  21. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/duration.py +0 -0
  22. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/flags.py +0 -0
  23. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/integer.py +0 -0
  24. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/numeric.py +0 -0
  25. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/attribute/string.py +0 -0
  26. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/coercion.py +0 -0
  27. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/__init__.py +0 -0
  28. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/aggregates.py +0 -0
  29. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/exceptions.py +0 -0
  30. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/formatting.py +0 -0
  31. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/has_lookup.py +0 -0
  32. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/hooks.py +0 -0
  33. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/lookup.py +0 -0
  34. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/patterns.py +0 -0
  35. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/role_lookup.py +0 -0
  36. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/role_players.py +0 -0
  37. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/rust_manager.py +0 -0
  38. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/strategies.py +0 -0
  39. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/typedb_manager.py +0 -0
  40. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/types.py +0 -0
  41. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/crud/utils.py +0 -0
  42. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/__init__.py +0 -0
  43. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/aggregate.py +0 -0
  44. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/arithmetic.py +0 -0
  45. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/base.py +0 -0
  46. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/boolean.py +0 -0
  47. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/builtin.py +0 -0
  48. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/comparison.py +0 -0
  49. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/functions.py +0 -0
  50. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/iid.py +0 -0
  51. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/role_player.py +0 -0
  52. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/string.py +0 -0
  53. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/expressions/utils.py +0 -0
  54. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/fields/__init__.py +0 -0
  55. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/fields/base.py +0 -0
  56. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/fields/role.py +0 -0
  57. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/__init__.py +0 -0
  58. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/__main__.py +0 -0
  59. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/_adoption_authority.py +0 -0
  60. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/_adoption_import.py +0 -0
  61. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/_archive_base.py +0 -0
  62. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/_archive_imports.py +0 -0
  63. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/_lower.py +0 -0
  64. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/_operations.py +0 -0
  65. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/_ref.py +0 -0
  66. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/exceptions.py +0 -0
  67. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/introspection.py +0 -0
  68. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/loader.py +0 -0
  69. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/sidecar.py +0 -0
  70. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/snapshots.py +0 -0
  71. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/state.py +0 -0
  72. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/state_schema.py +0 -0
  73. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/migration/utils.py +0 -0
  74. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/__init__.py +0 -0
  75. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/base.py +0 -0
  76. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/entity.py +0 -0
  77. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/registry.py +0 -0
  78. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/relation.py +0 -0
  79. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/role.py +0 -0
  80. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/schema_scanner.py +0 -0
  81. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/models/utils.py +0 -0
  82. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/proxy.py +0 -0
  83. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/py.typed +0 -0
  84. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/query/__init__.py +0 -0
  85. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/query/ast.py +0 -0
  86. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/query/compiler.py +0 -0
  87. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/query/parser.py +0 -0
  88. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/query_v2.py +0 -0
  89. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/reserved_words.py +0 -0
  90. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/rules.py +0 -0
  91. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/__init__.py +0 -0
  92. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/_descriptors.py +0 -0
  93. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/_remote_terminal.py +0 -0
  94. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/_terminal.py +0 -0
  95. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/page.py +0 -0
  96. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/query.py +0 -0
  97. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/references.py +0 -0
  98. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/remote_limits.py +0 -0
  99. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/remote_query.py +0 -0
  100. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/remote_session.py +0 -0
  101. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/results.py +0 -0
  102. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typed/session.py +0 -0
  103. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typeql/__init__.py +0 -0
  104. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/typeql/annotations.py +0 -0
  105. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/validation.py +0 -0
  106. {type_bridge-2.1.0 → type_bridge-2.2.1}/type_bridge/version.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: type-bridge
3
- Version: 2.1.0
4
- Summary: Typed Python, TypeScript, and Rust application tooling for TypeDB
3
+ Version: 2.2.1
4
+ Summary: Typed Python, TypeScript, Rust, and C application tooling for TypeDB
5
5
  Project-URL: Homepage, https://github.com/ds1sqe/type-bridge
6
6
  Project-URL: Repository, https://github.com/ds1sqe/type-bridge
7
7
  Project-URL: Documentation, https://ds1sqe.github.io/type-bridge/
@@ -23,7 +23,7 @@ Requires-Python: <3.15,>=3.12
23
23
  Requires-Dist: isodate==0.7.2
24
24
  Requires-Dist: jinja2>=3.1.0
25
25
  Requires-Dist: pydantic>=2.12.4
26
- Requires-Dist: type-bridge-core==2.1.0
26
+ Requires-Dist: type-bridge-core==2.2.1
27
27
  Requires-Dist: typer>=0.15.0
28
28
  Requires-Dist: typing-extensions>=4.12
29
29
  Provides-Extra: dev
@@ -35,7 +35,7 @@ Requires-Dist: pytest-order>=1.2.0; extra == 'dev'
35
35
  Requires-Dist: pytest>=9.0.1; extra == 'dev'
36
36
  Requires-Dist: pyyaml>=6.0.3; extra == 'dev'
37
37
  Requires-Dist: ruff==0.15.21; extra == 'dev'
38
- Requires-Dist: typedb-driver==3.12.1; (python_version >= '3.14') and extra == 'dev'
38
+ Requires-Dist: typedb-driver==3.12.3; (python_version >= '3.14') and extra == 'dev'
39
39
  Requires-Dist: typedb-driver~=3.11.5; (python_version < '3.14') and extra == 'dev'
40
40
  Provides-Extra: docs
41
41
  Requires-Dist: mkdocs-gen-files>=0.5; extra == 'docs'
@@ -46,7 +46,7 @@ Requires-Dist: mkdocs>=1.6; extra == 'docs'
46
46
  Requires-Dist: mkdocstrings[python]>=0.27; extra == 'docs'
47
47
  Provides-Extra: typedb-driver
48
48
  Requires-Dist: typedb-driver<3.13,>=3.11; (python_version < '3.14') and extra == 'typedb-driver'
49
- Requires-Dist: typedb-driver==3.12.1; (python_version >= '3.14') and extra == 'typedb-driver'
49
+ Requires-Dist: typedb-driver==3.12.3; (python_version >= '3.14') and extra == 'typedb-driver'
50
50
  Description-Content-Type: text/markdown
51
51
 
52
52
  <p align="center">
@@ -64,17 +64,18 @@ Description-Content-Type: text/markdown
64
64
 
65
65
  TypeBridge is a typed application toolkit for [TypeDB](https://typedb.com/).
66
66
  A versioned Split-YAML workspace is the schema authority. TypeBridge validates
67
- that workspace and generates Python, TypeScript/Node, and Rust bindings that
67
+ that workspace and generates Python, TypeScript/Node, Rust, and C bindings that
68
68
  share one Rust-owned schema, query, migration, validation, and ORM engine.
69
69
 
70
- ## One system, three generated SDKs
70
+ ## One system, four generated SDKs
71
71
 
72
72
  | Surface | Generated application API | Distribution |
73
73
  | --- | --- | --- |
74
74
  | Python | Value classes, model managers, transactions, direct/remote queries | [`type-bridge`](https://pypi.org/project/type-bridge/) |
75
75
  | TypeScript / Node | Branded values, model managers, native and remote queries | [`@type-bridge/node`](https://www.npmjs.com/package/@type-bridge/node) |
76
76
  | Rust | Schema-bound create/model types, async CRUD and immutable queries | [`type-bridge`](https://crates.io/crates/type-bridge) |
77
- | CLI | Split-YAML checks, migrations, and all three projections | Included with the Python package |
77
+ | C | Generated nominal models, transactions, direct/remote queries | [Ubuntu 24.04 x86_64 shared runtime](https://ds1sqe.github.io/type-bridge/guide/c/) |
78
+ | CLI | Split-YAML checks, migrations, and all four projections | Python package or standalone Linux archive |
78
79
  | Server | Remote V2 query execution over the same generated contract | `ghcr.io/ds1sqe/type-bridge-server` |
79
80
 
80
81
  TypeBridge preserves TypeDB concepts directly: independent attributes,
@@ -99,7 +100,7 @@ type-bridge --manifest typebridge.yaml migration make --name initial
99
100
  type-bridge --manifest typebridge.yaml migration apply --environment development
100
101
  ```
101
102
 
102
- One generation snapshot writes every configured Python, TypeScript, and Rust
103
+ One generation snapshot writes every configured Python, TypeScript, Rust, and C
103
104
  package. Generated packages privately embed the verified authority used by
104
105
  their managers and direct or remote queries, so ordinary applications never
105
106
  configure or read an external authority JSON. A workspace deploying the optional
@@ -178,6 +179,15 @@ type-bridge = "2"
178
179
  Follow the [Rust client guide](https://ds1sqe.github.io/type-bridge/guide/rust/)
179
180
  for generation, direct execution, transactions, and remote queries.
180
181
 
182
+ ## C
183
+
184
+ TypeBridge 2.2.0 ships a C ABI 1.6.0 shared runtime and standalone CLI for
185
+ Ubuntu 24.04 on x86_64 GNU/Linux. Generate an application schema package from
186
+ Split-YAML, then link C17 or C++17 consumers with CMake or pkg-config.
187
+
188
+ See the [C SDK guide](https://ds1sqe.github.io/type-bridge/guide/c/) for signed
189
+ archives, installation, generation, and the exact supported matrix.
190
+
181
191
  ## Documentation
182
192
 
183
193
  - [Install a surface](https://ds1sqe.github.io/type-bridge/getting-started/installation/)
@@ -191,7 +201,7 @@ for generation, direct execution, transactions, and remote queries.
191
201
  ## Development
192
202
 
193
203
  ```bash
194
- PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 uv sync --extra dev
204
+ uv sync --extra dev
195
205
  uv run pytest
196
206
  ./test.sh
197
207
  ./scripts/check.sh all
@@ -13,17 +13,18 @@
13
13
 
14
14
  TypeBridge is a typed application toolkit for [TypeDB](https://typedb.com/).
15
15
  A versioned Split-YAML workspace is the schema authority. TypeBridge validates
16
- that workspace and generates Python, TypeScript/Node, and Rust bindings that
16
+ that workspace and generates Python, TypeScript/Node, Rust, and C bindings that
17
17
  share one Rust-owned schema, query, migration, validation, and ORM engine.
18
18
 
19
- ## One system, three generated SDKs
19
+ ## One system, four generated SDKs
20
20
 
21
21
  | Surface | Generated application API | Distribution |
22
22
  | --- | --- | --- |
23
23
  | Python | Value classes, model managers, transactions, direct/remote queries | [`type-bridge`](https://pypi.org/project/type-bridge/) |
24
24
  | TypeScript / Node | Branded values, model managers, native and remote queries | [`@type-bridge/node`](https://www.npmjs.com/package/@type-bridge/node) |
25
25
  | Rust | Schema-bound create/model types, async CRUD and immutable queries | [`type-bridge`](https://crates.io/crates/type-bridge) |
26
- | CLI | Split-YAML checks, migrations, and all three projections | Included with the Python package |
26
+ | C | Generated nominal models, transactions, direct/remote queries | [Ubuntu 24.04 x86_64 shared runtime](https://ds1sqe.github.io/type-bridge/guide/c/) |
27
+ | CLI | Split-YAML checks, migrations, and all four projections | Python package or standalone Linux archive |
27
28
  | Server | Remote V2 query execution over the same generated contract | `ghcr.io/ds1sqe/type-bridge-server` |
28
29
 
29
30
  TypeBridge preserves TypeDB concepts directly: independent attributes,
@@ -48,7 +49,7 @@ type-bridge --manifest typebridge.yaml migration make --name initial
48
49
  type-bridge --manifest typebridge.yaml migration apply --environment development
49
50
  ```
50
51
 
51
- One generation snapshot writes every configured Python, TypeScript, and Rust
52
+ One generation snapshot writes every configured Python, TypeScript, Rust, and C
52
53
  package. Generated packages privately embed the verified authority used by
53
54
  their managers and direct or remote queries, so ordinary applications never
54
55
  configure or read an external authority JSON. A workspace deploying the optional
@@ -127,6 +128,15 @@ type-bridge = "2"
127
128
  Follow the [Rust client guide](https://ds1sqe.github.io/type-bridge/guide/rust/)
128
129
  for generation, direct execution, transactions, and remote queries.
129
130
 
131
+ ## C
132
+
133
+ TypeBridge 2.2.0 ships a C ABI 1.6.0 shared runtime and standalone CLI for
134
+ Ubuntu 24.04 on x86_64 GNU/Linux. Generate an application schema package from
135
+ Split-YAML, then link C17 or C++17 consumers with CMake or pkg-config.
136
+
137
+ See the [C SDK guide](https://ds1sqe.github.io/type-bridge/guide/c/) for signed
138
+ archives, installation, generation, and the exact supported matrix.
139
+
130
140
  ## Documentation
131
141
 
132
142
  - [Install a surface](https://ds1sqe.github.io/type-bridge/getting-started/installation/)
@@ -140,7 +150,7 @@ for generation, direct execution, transactions, and remote queries.
140
150
  ## Development
141
151
 
142
152
  ```bash
143
- PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 uv sync --extra dev
153
+ uv sync --extra dev
144
154
  uv run pytest
145
155
  ./test.sh
146
156
  ./scripts/check.sh all
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "type-bridge"
7
- version = "2.1.0"
8
- description = "Typed Python, TypeScript, and Rust application tooling for TypeDB"
7
+ version = "2.2.1"
8
+ description = "Typed Python, TypeScript, Rust, and C application tooling for TypeDB"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12,<3.15"
11
11
  license = {text = "MIT"}
@@ -30,7 +30,7 @@ dependencies = [
30
30
  "jinja2>=3.1.0",
31
31
  "typer>=0.15.0",
32
32
  # The facade and native semantic engine are one release unit.
33
- "type-bridge-core==2.1.0",
33
+ "type-bridge-core==2.2.1",
34
34
  "typing-extensions>=4.12",
35
35
  ]
36
36
 
@@ -58,7 +58,7 @@ dev = [
58
58
  # the embedded Rust runtime and serves TypeDB 3.11 and 3.12 on every
59
59
  # supported interpreter.
60
60
  "typedb-driver~=3.11.5; python_version < '3.14'",
61
- "typedb-driver==3.12.1; python_version >= '3.14'",
61
+ "typedb-driver==3.12.3; python_version >= '3.14'",
62
62
  "pytest>=9.0.1",
63
63
  "pytest-asyncio>=1.3.0",
64
64
  "pytest-order>=1.2.0",
@@ -81,7 +81,7 @@ docs = [
81
81
  ]
82
82
  typedb-driver = [
83
83
  "typedb-driver>=3.11,<3.13; python_version < '3.14'",
84
- "typedb-driver==3.12.1; python_version >= '3.14'",
84
+ "typedb-driver==3.12.3; python_version >= '3.14'",
85
85
  ]
86
86
 
87
87
  [tool.ty.environment]
@@ -165,6 +165,10 @@ precision = 2
165
165
  [tool.coverage.html]
166
166
  directory = "htmlcov"
167
167
 
168
+ [tool.uv]
169
+ # Keep mypy's wheel-only helper on a complete, verified release.
170
+ constraint-dependencies = ["ast-serialize==0.10.0"]
171
+
168
172
  [tool.uv.workspace]
169
173
  members = [
170
174
  "type-bridge-core",
@@ -24,7 +24,7 @@ if TYPE_CHECKING:
24
24
  from type_bridge.migration.exceptions import SchemaConflictError, SchemaValidationError
25
25
  from type_bridge.migration.introspection import SchemaIntrospector
26
26
 
27
- __version__ = "2.1.0"
27
+ __version__ = "2.2.1"
28
28
 
29
29
 
30
30
  _LAZY_EXPORTS: dict[str, tuple[str, str]] = {
@@ -13,7 +13,7 @@ RUST_BACKEND = "rust"
13
13
  def selected_backend() -> str:
14
14
  """Return the configured manager backend.
15
15
 
16
- The Python ORM backend was retired in #125 Phase 4. The environment
16
+ The Python ORM backend was retired in #125. The environment
17
17
  variable is retained only to reject stale transition settings clearly.
18
18
  """
19
19
  value = os.environ.get(BACKEND_ENV_VAR, RUST_BACKEND).strip().lower()
@@ -44,6 +44,29 @@ def install_runtime_projection(
44
44
  return installed
45
45
 
46
46
 
47
+ def install_runtime_projection_with_authority(
48
+ projection_json: str,
49
+ semantic_fingerprint_json: str,
50
+ projection_fingerprint_json: str,
51
+ models: Sequence[tuple[type[object], type[object] | None]],
52
+ schema_authority: bytes,
53
+ *,
54
+ structs: Sequence[type[object]] = (),
55
+ ) -> PyRuntimeProjection:
56
+ """Verify and install one ordered generated package with compiled authority."""
57
+ installed = rust_core().PyRuntimeProjection(
58
+ projection_json,
59
+ semantic_fingerprint_json,
60
+ projection_fingerprint_json,
61
+ list(models),
62
+ schema_authority,
63
+ list(structs),
64
+ )
65
+ for model, _reference in models:
66
+ _installed_projection_by_model[model] = installed
67
+ return installed
68
+
69
+
47
70
  def _installed_projection_for(model: type[object]) -> PyRuntimeProjection:
48
71
  try:
49
72
  return _installed_projection_by_model[model]
@@ -531,6 +531,20 @@ def rust_database_for(connection: Any) -> PyRustDatabase:
531
531
  return rust_db
532
532
 
533
533
 
534
+ def database_from_rust(
535
+ endpoint: str,
536
+ database_name: str,
537
+ rust_database: PyRustDatabase,
538
+ ) -> Any:
539
+ """Wrap one package-owned native database without reconnecting."""
540
+ from type_bridge.session import Database
541
+
542
+ database = Database(address=endpoint, database=database_name)
543
+ setattr(database, "_rust_backend_database", rust_database)
544
+ database._transport_committed = True
545
+ return database
546
+
547
+
534
548
  def state_reader_for(connection: Any) -> Any:
535
549
  """Return the native read-only frozen-ledger reader."""
536
550
  return rust_core().PyMigrationStateReader(rust_database_for(connection))
@@ -8,7 +8,7 @@ import threading
8
8
  import warnings
9
9
  from dataclasses import dataclass
10
10
  from enum import Enum
11
- from typing import TYPE_CHECKING, Any, cast, overload
11
+ from typing import TYPE_CHECKING, Any, Literal, cast, overload
12
12
 
13
13
  import type_bridge.typedb_driver as typedb_driver
14
14
  import type_bridge.version as version
@@ -637,45 +637,61 @@ class Database:
637
637
 
638
638
  def create_database(self) -> None:
639
639
  """Create the database if it doesn't exist."""
640
+ self.create_database_outcome()
641
+
642
+ def create_database_outcome(self) -> Literal["created", "already_exists"]:
643
+ """Create the bound database and return a race-normalized outcome."""
640
644
  if self._driver is not None:
641
- if not self.driver.databases.contains(self.database_name):
642
- logger.debug(f"Creating database: {self.database_name}")
643
- self.driver.databases.create(self.database_name)
644
- logger.info(f"Database created: {self.database_name}")
645
- else:
645
+ if self.driver.databases.contains(self.database_name):
646
646
  logger.debug(f"Database already exists: {self.database_name}")
647
- return
647
+ return "already_exists"
648
+ logger.debug(f"Creating database: {self.database_name}")
649
+ try:
650
+ self.driver.databases.create(self.database_name)
651
+ except Exception:
652
+ if self.driver.databases.contains(self.database_name):
653
+ return "already_exists"
654
+ raise
655
+ logger.info(f"Database created: {self.database_name}")
656
+ return "created"
648
657
 
649
658
  from type_bridge._rust_runtime import rust_database_for
650
659
 
651
- rust_db = rust_database_for(self)
652
- if not rust_db.database_exists():
653
- logger.debug(f"Creating database: {self.database_name}")
654
- rust_db.create_database()
655
- logger.info(f"Database created: {self.database_name}")
656
- else:
657
- logger.debug(f"Database already exists: {self.database_name}")
660
+ outcome = cast(
661
+ Literal["created", "already_exists"],
662
+ rust_database_for(self).create_database_outcome(),
663
+ )
664
+ logger.debug(f"Database create outcome for '{self.database_name}': {outcome}")
665
+ return outcome
658
666
 
659
667
  def delete_database(self) -> None:
660
668
  """Delete the database."""
669
+ self.delete_database_outcome()
670
+
671
+ def delete_database_outcome(self) -> Literal["deleted", "already_absent"]:
672
+ """Delete the bound database and return a race-normalized outcome."""
661
673
  if self._driver is not None:
662
- if self.driver.databases.contains(self.database_name):
663
- logger.debug(f"Deleting database: {self.database_name}")
664
- self.driver.databases.get(self.database_name).delete()
665
- logger.info(f"Database deleted: {self.database_name}")
666
- else:
674
+ if not self.driver.databases.contains(self.database_name):
667
675
  logger.debug(f"Database does not exist, skipping delete: {self.database_name}")
668
- return
676
+ return "already_absent"
677
+ logger.debug(f"Deleting database: {self.database_name}")
678
+ try:
679
+ self.driver.databases.get(self.database_name).delete()
680
+ except Exception:
681
+ if not self.driver.databases.contains(self.database_name):
682
+ return "deleted"
683
+ raise
684
+ logger.info(f"Database deleted: {self.database_name}")
685
+ return "deleted"
669
686
 
670
687
  from type_bridge._rust_runtime import rust_database_for
671
688
 
672
- rust_db = rust_database_for(self)
673
- if rust_db.database_exists():
674
- logger.debug(f"Deleting database: {self.database_name}")
675
- rust_db.delete_database()
676
- logger.info(f"Database deleted: {self.database_name}")
677
- else:
678
- logger.debug(f"Database does not exist, skipping delete: {self.database_name}")
689
+ outcome = cast(
690
+ Literal["deleted", "already_absent"],
691
+ rust_database_for(self).delete_database_outcome(),
692
+ )
693
+ logger.debug(f"Database delete outcome for '{self.database_name}': {outcome}")
694
+ return outcome
679
695
 
680
696
  def database_exists(self) -> bool:
681
697
  """Check if database exists."""
@@ -688,6 +704,54 @@ class Database:
688
704
  logger.debug(f"Database exists check for '{self.database_name}': {exists}")
689
705
  return exists
690
706
 
707
+ def inspect_database_pair(
708
+ self,
709
+ ) -> Literal["absent", "standalone_managed", "owned_pair", "owned_journal_orphan"]:
710
+ """Inspect the managed database and its package-owned journal as one pair."""
711
+ from type_bridge._rust_runtime import rust_database_for
712
+
713
+ return cast(
714
+ Literal["absent", "standalone_managed", "owned_pair", "owned_journal_orphan"],
715
+ rust_database_for(self).inspect_database_pair(),
716
+ )
717
+
718
+ def inspect_database_pair_controlled(
719
+ self,
720
+ *,
721
+ timeout_milliseconds: int | None = None,
722
+ cancellation: Any | None = None,
723
+ ) -> Literal["absent", "standalone_managed", "owned_pair", "owned_journal_orphan"]:
724
+ """Inspect the managed database pair under explicit execution controls."""
725
+ from type_bridge._rust_runtime import rust_database_for
726
+
727
+ return cast(
728
+ Literal["absent", "standalone_managed", "owned_pair", "owned_journal_orphan"],
729
+ rust_database_for(self).inspect_database_pair_controlled(
730
+ timeout_milliseconds=timeout_milliseconds,
731
+ cancellation=cancellation,
732
+ ),
733
+ )
734
+
735
+ def plan_database_delete(self) -> Any:
736
+ """Create a single-use, pair-aware managed database deletion plan."""
737
+ from type_bridge._rust_runtime import rust_database_for
738
+
739
+ return rust_database_for(self).plan_database_delete()
740
+
741
+ def plan_database_delete_controlled(
742
+ self,
743
+ *,
744
+ timeout_milliseconds: int | None = None,
745
+ cancellation: Any | None = None,
746
+ ) -> Any:
747
+ """Create a managed deletion plan under explicit execution controls."""
748
+ from type_bridge._rust_runtime import rust_database_for
749
+
750
+ return rust_database_for(self).plan_database_delete_controlled(
751
+ timeout_milliseconds=timeout_milliseconds,
752
+ cancellation=cancellation,
753
+ )
754
+
691
755
  @overload
692
756
  def transaction(self, transaction_type: Enum) -> TransactionContext: ...
693
757
 
@@ -747,7 +811,7 @@ class Database:
747
811
  def detected_server_version(self) -> str | None:
748
812
  """The server version detected by the connect-time version gate.
749
813
 
750
- Returns the version string (e.g. ``"3.12.1"``) when known. ``None``
814
+ Returns the version string (e.g. ``"3.12.3"``) when known. ``None``
751
815
  means the negotiated connection path produced no authoritative server
752
816
  identity; supply ``server_version=`` at construction when strict
753
817
  identity validation is required.
@@ -102,7 +102,7 @@ def _ensure_driver_interpreter_supported(installed: str) -> int | None:
102
102
  raise _version.UnsupportedVersionError(
103
103
  f"Installed typedb-driver {installed!r} has no compatible native wheel "
104
104
  "for CPython 3.14. Install `type-bridge[typedb-driver]` "
105
- "(driver 3.12.1) and target TypeDB 3.12."
105
+ "(driver 3.12.3) and target TypeDB 3.12."
106
106
  )
107
107
  return driver_band
108
108
 
@@ -166,7 +166,7 @@ def create_driver_options(
166
166
  max_l = _version.max_supported_line()
167
167
  if sys.version_info >= (3, 14):
168
168
  remediation = (
169
- "Install `type-bridge[typedb-driver]` (driver 3.12.1 on "
169
+ "Install `type-bridge[typedb-driver]` (driver 3.12.3 on "
170
170
  "CPython 3.14) and target TypeDB 3.12."
171
171
  )
172
172
  else:
@@ -209,7 +209,7 @@ def embedded_driver_versions() -> dict[int, str]:
209
209
  """Return all driver versions compiled into the Rust runtime, keyed by band.
210
210
 
211
211
  Delegates to ``type_bridge_core.embedded_driver_versions``. The default
212
- build returns ``{8: "3.11.5", 9: "3.12.1"}``; a
212
+ build returns ``{8: "3.11.5", 9: "3.12.3"}``; a
213
213
  single-band build returns only the one entry for its compiled band.
214
214
  """
215
215
  return _core.embedded_driver_versions()
@@ -236,7 +236,7 @@ def server_version(
236
236
  probe. The root path does not enable TLS implicitly.
237
237
 
238
238
  Returns:
239
- Version string reported by the server (e.g. ``"3.12.1"``).
239
+ Version string reported by the server (e.g. ``"3.12.3"``).
240
240
 
241
241
  Raises:
242
242
  type_bridge_core.VersionError: When the endpoint is unreachable or the
File without changes
File without changes