type-bridge-core-lib 2.3.1

TypeQL AST, schema parser, query compiler, and validation engine for type-bridge
Documentation

type-bridge-core-lib

Pure-Rust TypeQL AST, schema parser, query compiler, validation engine, and value coercer for type-bridge.

This is a supporting engine crate. Most applications should consume generated models through type-bridge instead.

[dependencies]
type-bridge-core-lib = "2.3.1"

Modules

Module Purpose
ast TypeQL Abstract Syntax Tree — patterns, statements, clauses, and values
validation Schema-aware query validation plus a portable JSON validation-rule DSL
compiler Compiles an AST back into a TypeQL query string
query_parser Official parsing with checked projection onto compatibility nodes
value_coercion Coerces raw values into TypeDB value-types and formats TypeQL literals
reserved_words TypeQL reserved-word detection

Usage

use type_bridge_core_lib::query_parser::parse_typeql_query_checked;
use type_bridge_core_lib::compiler::QueryCompiler;

// Parse a TypeQL query into AST clauses
let clauses = parse_typeql_query_checked(r#"match $p isa person, has name "Alice";"#).unwrap();

// Compile back to TypeQL
let compiler = QueryCompiler::new();
let typeql = compiler.try_compile(&clauses).unwrap();
assert_eq!(
    typeql,
    r#"match $p isa person, has name "Alice";"#,
);

Canonical Split-YAML schema loading and resolution live in type-bridge-schema. The hidden frozen parser/schema modules in this crate are compatibility machinery, not an application schema-authoring API.

Feature flags

Feature Default Effect
pyo3 no Enables #[derive(FromPyObject)] on AST types for PyO3 interop

Testing

cargo test -p type-bridge-core-lib

Compatibility

This crate is released in lockstep with TypeBridge 2.3.1 and requires Rust 1.88+. Database-facing TypeBridge components support TypeDB 3.11.x–3.14.x, with 3.13.6 as the V2 semantic baseline.

API documentation · Repository

License

MIT