neosqlite.collection.query_helper.schema_compiler module

SQL Compiler for JSON Schema validation. Translates MongoDB $jsonSchema rules into native SQLite SQL expressions.

neosqlite.collection.query_helper.schema_compiler.compile_schema_to_sql(schema: dict[str, Any], data_column: str = 'data', jsonb: bool = False) str[source]

Compile a JSON Schema into a SQL expression for use in a CHECK constraint.

neosqlite.collection.query_helper.schema_compiler._compile_node(schema: Any, data_column: str, json_func: str, path: str = '$') str[source]

Recursively compile schema nodes into SQL.

neosqlite.collection.query_helper.schema_compiler._compile_type_check(data_column: str, path: str, target_type: Any, json_func: str) str | None[source]

Compile type checks into SQL using json_type.