type-bridge-core 0.1.0.dev0__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.
- type_bridge_core-0.1.0.dev0/.cargo/config.toml +2 -0
- type_bridge_core-0.1.0.dev0/Cargo.lock +256 -0
- type_bridge_core-0.1.0.dev0/Cargo.toml +22 -0
- type_bridge_core-0.1.0.dev0/PKG-INFO +8 -0
- type_bridge_core-0.1.0.dev0/README.md +30 -0
- type_bridge_core-0.1.0.dev0/pyproject.toml +18 -0
- type_bridge_core-0.1.0.dev0/src/ast/mod.rs +890 -0
- type_bridge_core-0.1.0.dev0/src/core/ast.rs +152 -0
- type_bridge_core-0.1.0.dev0/src/core/compiler.rs +326 -0
- type_bridge_core-0.1.0.dev0/src/core/mod.rs +5 -0
- type_bridge_core-0.1.0.dev0/src/core/reserved_words.rs +110 -0
- type_bridge_core-0.1.0.dev0/src/core/schema.rs +43 -0
- type_bridge_core-0.1.0.dev0/src/core/validation.rs +297 -0
- type_bridge_core-0.1.0.dev0/src/lib.rs +135 -0
- type_bridge_core-0.1.0.dev0/src/test_clone.rs +8 -0
- type_bridge_core-0.1.0.dev0/src/test_manual_clone.rs +10 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.5.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "cfg-if"
|
|
13
|
+
version = "1.0.4"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "heck"
|
|
19
|
+
version = "0.5.0"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "indoc"
|
|
25
|
+
version = "2.0.7"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"rustversion",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[[package]]
|
|
33
|
+
name = "itoa"
|
|
34
|
+
version = "1.0.17"
|
|
35
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
36
|
+
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
|
37
|
+
|
|
38
|
+
[[package]]
|
|
39
|
+
name = "libc"
|
|
40
|
+
version = "0.2.180"
|
|
41
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
42
|
+
checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "memchr"
|
|
46
|
+
version = "2.8.0"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
49
|
+
|
|
50
|
+
[[package]]
|
|
51
|
+
name = "memoffset"
|
|
52
|
+
version = "0.9.1"
|
|
53
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
55
|
+
dependencies = [
|
|
56
|
+
"autocfg",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[[package]]
|
|
60
|
+
name = "once_cell"
|
|
61
|
+
version = "1.21.3"
|
|
62
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
63
|
+
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "portable-atomic"
|
|
67
|
+
version = "1.13.1"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|
70
|
+
|
|
71
|
+
[[package]]
|
|
72
|
+
name = "proc-macro2"
|
|
73
|
+
version = "1.0.106"
|
|
74
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
76
|
+
dependencies = [
|
|
77
|
+
"unicode-ident",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "pyo3"
|
|
82
|
+
version = "0.23.5"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
|
|
85
|
+
dependencies = [
|
|
86
|
+
"cfg-if",
|
|
87
|
+
"indoc",
|
|
88
|
+
"libc",
|
|
89
|
+
"memoffset",
|
|
90
|
+
"once_cell",
|
|
91
|
+
"portable-atomic",
|
|
92
|
+
"pyo3-build-config",
|
|
93
|
+
"pyo3-ffi",
|
|
94
|
+
"pyo3-macros",
|
|
95
|
+
"unindent",
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
[[package]]
|
|
99
|
+
name = "pyo3-build-config"
|
|
100
|
+
version = "0.23.5"
|
|
101
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
102
|
+
checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
|
|
103
|
+
dependencies = [
|
|
104
|
+
"once_cell",
|
|
105
|
+
"target-lexicon",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[[package]]
|
|
109
|
+
name = "pyo3-ffi"
|
|
110
|
+
version = "0.23.5"
|
|
111
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
+
checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
|
|
113
|
+
dependencies = [
|
|
114
|
+
"libc",
|
|
115
|
+
"pyo3-build-config",
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
[[package]]
|
|
119
|
+
name = "pyo3-macros"
|
|
120
|
+
version = "0.23.5"
|
|
121
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
122
|
+
checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
|
|
123
|
+
dependencies = [
|
|
124
|
+
"proc-macro2",
|
|
125
|
+
"pyo3-macros-backend",
|
|
126
|
+
"quote",
|
|
127
|
+
"syn",
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
[[package]]
|
|
131
|
+
name = "pyo3-macros-backend"
|
|
132
|
+
version = "0.23.5"
|
|
133
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
134
|
+
checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
|
|
135
|
+
dependencies = [
|
|
136
|
+
"heck",
|
|
137
|
+
"proc-macro2",
|
|
138
|
+
"pyo3-build-config",
|
|
139
|
+
"quote",
|
|
140
|
+
"syn",
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
[[package]]
|
|
144
|
+
name = "pythonize"
|
|
145
|
+
version = "0.23.0"
|
|
146
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
147
|
+
checksum = "91a6ee7a084f913f98d70cdc3ebec07e852b735ae3059a1500db2661265da9ff"
|
|
148
|
+
dependencies = [
|
|
149
|
+
"pyo3",
|
|
150
|
+
"serde",
|
|
151
|
+
]
|
|
152
|
+
|
|
153
|
+
[[package]]
|
|
154
|
+
name = "quote"
|
|
155
|
+
version = "1.0.44"
|
|
156
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
157
|
+
checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
|
|
158
|
+
dependencies = [
|
|
159
|
+
"proc-macro2",
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
[[package]]
|
|
163
|
+
name = "rustversion"
|
|
164
|
+
version = "1.0.22"
|
|
165
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
166
|
+
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
|
167
|
+
|
|
168
|
+
[[package]]
|
|
169
|
+
name = "serde"
|
|
170
|
+
version = "1.0.228"
|
|
171
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
173
|
+
dependencies = [
|
|
174
|
+
"serde_core",
|
|
175
|
+
"serde_derive",
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
[[package]]
|
|
179
|
+
name = "serde_core"
|
|
180
|
+
version = "1.0.228"
|
|
181
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
182
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
183
|
+
dependencies = [
|
|
184
|
+
"serde_derive",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[[package]]
|
|
188
|
+
name = "serde_derive"
|
|
189
|
+
version = "1.0.228"
|
|
190
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
192
|
+
dependencies = [
|
|
193
|
+
"proc-macro2",
|
|
194
|
+
"quote",
|
|
195
|
+
"syn",
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
[[package]]
|
|
199
|
+
name = "serde_json"
|
|
200
|
+
version = "1.0.149"
|
|
201
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
202
|
+
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
|
203
|
+
dependencies = [
|
|
204
|
+
"itoa",
|
|
205
|
+
"memchr",
|
|
206
|
+
"serde",
|
|
207
|
+
"serde_core",
|
|
208
|
+
"zmij",
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
[[package]]
|
|
212
|
+
name = "syn"
|
|
213
|
+
version = "2.0.114"
|
|
214
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
215
|
+
checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
|
|
216
|
+
dependencies = [
|
|
217
|
+
"proc-macro2",
|
|
218
|
+
"quote",
|
|
219
|
+
"unicode-ident",
|
|
220
|
+
]
|
|
221
|
+
|
|
222
|
+
[[package]]
|
|
223
|
+
name = "target-lexicon"
|
|
224
|
+
version = "0.12.16"
|
|
225
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
226
|
+
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
|
227
|
+
|
|
228
|
+
[[package]]
|
|
229
|
+
name = "type-bridge-core"
|
|
230
|
+
version = "0.1.0-dev.0"
|
|
231
|
+
dependencies = [
|
|
232
|
+
"once_cell",
|
|
233
|
+
"pyo3",
|
|
234
|
+
"pythonize",
|
|
235
|
+
"serde",
|
|
236
|
+
"serde_json",
|
|
237
|
+
"unicode-ident",
|
|
238
|
+
]
|
|
239
|
+
|
|
240
|
+
[[package]]
|
|
241
|
+
name = "unicode-ident"
|
|
242
|
+
version = "1.0.23"
|
|
243
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
244
|
+
checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e"
|
|
245
|
+
|
|
246
|
+
[[package]]
|
|
247
|
+
name = "unindent"
|
|
248
|
+
version = "0.2.4"
|
|
249
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
250
|
+
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
|
251
|
+
|
|
252
|
+
[[package]]
|
|
253
|
+
name = "zmij"
|
|
254
|
+
version = "1.0.20"
|
|
255
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
256
|
+
checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "type-bridge-core"
|
|
3
|
+
version = "0.1.0-dev.0"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
|
|
7
|
+
[lib]
|
|
8
|
+
name = "type_bridge_core"
|
|
9
|
+
crate-type = ["cdylib", "rlib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
|
|
13
|
+
pyo3 = { version = "0.23", features = ["extension-module"] }
|
|
14
|
+
|
|
15
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
16
|
+
|
|
17
|
+
serde_json = "1.0"
|
|
18
|
+
|
|
19
|
+
once_cell = "1.19"
|
|
20
|
+
|
|
21
|
+
unicode-ident = "1.0"
|
|
22
|
+
pythonize = "0.23"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: type-bridge-core
|
|
3
|
+
Version: 0.1.0.dev0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Summary: Rust core for type-bridge ORM
|
|
8
|
+
Requires-Python: >=3.13
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# type-bridge-core
|
|
2
|
+
|
|
3
|
+
Rust core for the `type-bridge` TypeDB ORM.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This crate provides a high-performance, shared type system and query engine for `type-bridge`. It enables:
|
|
8
|
+
|
|
9
|
+
- **Bidirectional Validation**: Define validation rules once in Rust and enforce them on both client (Python) and server (Rust/WASM).
|
|
10
|
+
- **Query Object Portability**: First-class AST objects that can be serialized and moved between runtimes.
|
|
11
|
+
- **Performance**: High-speed query compilation and schema parsing.
|
|
12
|
+
|
|
13
|
+
## Structure
|
|
14
|
+
|
|
15
|
+
- `src/core`: Pure Rust implementation of the AST, schema, and validation engine. This is runtime-agnostic.
|
|
16
|
+
- `src/ast`: PyO3 wrappers for the core AST nodes, providing an idiomatic Python API.
|
|
17
|
+
- `src/lib.rs`: PyO3 module definition.
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the Python extension:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd type-bridge-core
|
|
25
|
+
maturin develop
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Status
|
|
29
|
+
|
|
30
|
+
This is an initial implementation following the RFC in issue #95. Key structures are in place, with logic being ported from Python.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.5,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "type-bridge-core"
|
|
7
|
+
version = "0.1.0.dev0"
|
|
8
|
+
description = "Rust core for type-bridge ORM"
|
|
9
|
+
requires-python = ">=3.13"
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Rust",
|
|
12
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
13
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[tool.maturin]
|
|
17
|
+
features = ["pyo3/extension-module"]
|
|
18
|
+
module-name = "type_bridge_core"
|