graflo.db.nebula.util¶
NebulaGraph utility functions.
Type mapping, filter rendering, value escaping, and schema-propagation helpers.
escape_nebula_string(value)
¶
field_type_from_nebula(declared)
¶
Map a DESCRIBE TAG / DESCRIBE EDGE type back to a FieldType.
Returns None for a type this mapping does not cover, so the caller can
leave the field untyped rather than assert a wrong one.
Source code in graflo/db/nebula/util.py
make_vid(doc, match_keys)
¶
Derive a VID string from a document's match-key values.
When a single match key is used the raw value is taken. When multiple keys
are present the values are joined with :: so the VID is deterministic
and unique for the combination.
Source code in graflo/db/nebula/util.py
nebula_type(ft)
¶
Map a scalar graflo FieldType to the corresponding NebulaGraph type name.
LIST is not storable as a Nebula property — use :func:nebula_type_for_field.
Source code in graflo/db/nebula/util.py
nebula_type_for_field(field)
¶
Map a Field to a NebulaGraph DDL type, raising for unsupported types.
render_filters_cypher(filters, doc_name)
¶
Render a FilterExpression as a Cypher WHERE clause (without the keyword).
Source code in graflo/db/nebula/util.py
render_filters_ngql(filters, doc_name)
¶
Render a FilterExpression as an nGQL WHERE clause (without the keyword).
Source code in graflo/db/nebula/util.py
serialize_nebula_value(value)
¶
Serialise a Python value into an nGQL literal string.
Source code in graflo/db/nebula/util.py
wait_for_schema_propagation(adapter, check_statement, *, max_retries=30, interval=1.0)
¶
Poll check_statement until it succeeds or retries are exhausted.
NebulaGraph propagates schema changes asynchronously across the cluster.
After CREATE SPACE / CREATE TAG / CREATE EDGE, subsequent
statements may fail until propagation completes (typically within two
heartbeat cycles, ~20 s for default settings).
Source code in graflo/db/nebula/util.py
wait_for_space_ready(adapter, space_name, *, max_retries=30, interval=1.0)
¶
Wait until `USEspace_name``` succeeds.