MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / module_def

Function module_def

crates/expr/src/check.rs:240–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238 use super::{SchemaView, TypingResult};
239
240 fn module_def() -> ModuleDef {
241 build_module_def(vec![
242 (
243 "t",
244 ProductType::from([
245 ("ts", AlgebraicType::timestamp()),
246 ("i8", AlgebraicType::I8),
247 ("u8", AlgebraicType::U8),
248 ("i16", AlgebraicType::I16),
249 ("u16", AlgebraicType::U16),
250 ("i32", AlgebraicType::I32),
251 ("u32", AlgebraicType::U32),
252 ("i64", AlgebraicType::I64),
253 ("u64", AlgebraicType::U64),
254 ("int", AlgebraicType::U32),
255 ("f32", AlgebraicType::F32),
256 ("f64", AlgebraicType::F64),
257 ("i128", AlgebraicType::I128),
258 ("u128", AlgebraicType::U128),
259 ("i256", AlgebraicType::I256),
260 ("u256", AlgebraicType::U256),
261 ("str", AlgebraicType::String),
262 ("arr", AlgebraicType::array(AlgebraicType::String)),
263 ]),
264 ),
265 (
266 "s",
267 ProductType::from([
268 ("id", AlgebraicType::identity()),
269 ("u32", AlgebraicType::U32),
270 ("arr", AlgebraicType::array(AlgebraicType::String)),
271 ("bytes", AlgebraicType::bytes()),
272 ]),
273 ),
274 ])
275 }
276
277 /// A wrapper around [super::parse_and_type_sub] that takes a dummy [AuthCtx]
278 fn parse_and_type_sub(sql: &str, tx: &impl SchemaView) -> TypingResult<ProjectName> {

Callers 5

valid_literalsFunction · 0.70
valid_literals_for_typeFunction · 0.70
invalid_literalsFunction · 0.70
validFunction · 0.70
invalidFunction · 0.70

Calls 1

build_module_defFunction · 0.85

Tested by 5

valid_literalsFunction · 0.56
valid_literals_for_typeFunction · 0.56
invalid_literalsFunction · 0.56
validFunction · 0.56
invalidFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…