Skip to content

Commit 84ab853

Browse files
authored
[1/3] RawModuleDefV10 definition and validation. (#4098)
# Description of Changes Patch: 1. `crates/lib/src/db/raw_def/v10.rs` - a definition as per clockworklabs/SpacetimeDBPrivate#2412. 2. Refactors `RawModuleDefV9` validation code to dedup some of the core validation logic, No functionality should change there. 3. Validation logic for new `RawModuleDefV10`. 4. Modify `crates::schema::def::ModuleDef` : - To include `raw_module_def_version` - `visibility` field to existing `RedcuerDef` and `ProcedureDef` 5. It deprecates RLS in favour of Views, If anyoine feel otherwise, let me know. Lot of code is duplicated from `RawModuleDefV9` includng tests. # API and ABI breaking changes NA, `RawModuleDefV10` is not yet exported by modules. # Expected complexity level and risk 3? close analyses of structure is important to ensure future extensibility. # Testing For code motion in `RawModuleDefV9` validation: Existing unit tests seems to cover any functionality change. For `RawModuleDefV10`: V9 test has been repeated with more `assert`s to check on `visibility`
1 parent 2044a53 commit 84ab853

9 files changed

Lines changed: 2907 additions & 172 deletions

File tree

crates/bindings/tests/ui/tables.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ error[E0277]: `&'a Alpha` cannot appear as an argument to an index filtering ope
127127
= note: The allowed set of types are limited to integers, bool, strings, `Identity`, `Uuid`, `ConnectionId`, `Hash` and no-payload enums which derive `SpacetimeType`,
128128
= help: the following other types implement trait `FilterableValue`:
129129
&ConnectionId
130+
&FunctionVisibility
130131
&Identity
131132
&Lifecycle
132133
&TableAccess
133134
&TableType
134135
&bool
135136
&ethnum::int::I256
136-
&ethnum::uint::U256
137137
and $N others
138138
note: required by a bound in `UniqueColumn::<Tbl, <Col as spacetimedb::table::Column>::ColType, Col>::find`
139139
--> src/table.rs
@@ -154,13 +154,13 @@ error[E0277]: the trait bound `Alpha: IndexScanRangeBounds<(Alpha,), SingleBound
154154
|
155155
= help: the following other types implement trait `FilterableValue`:
156156
&ConnectionId
157+
&FunctionVisibility
157158
&Identity
158159
&Lifecycle
159160
&TableAccess
160161
&TableType
161162
&bool
162163
&ethnum::int::I256
163-
&ethnum::uint::U256
164164
and $N others
165165
= note: required for `Alpha` to implement `IndexScanRangeBounds<(Alpha,), SingleBound>`
166166
note: required by a bound in `RangedIndex::<Tbl, IndexType, Idx>::filter`

crates/lib/src/db/raw_def.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ pub mod v8;
1414
pub use v8::*;
1515

1616
pub mod v9;
17+
18+
pub mod v10;

0 commit comments

Comments
 (0)