lpgcast.write¶
Write a cast to a database through graflo's write_container.
The schema is defined on the target first (an existing definition is reused), edges whose endpoint is known only by a secondary identity are looked up, and the container is upserted by identity without an ingestion resource.
graflo's database layer is imported inside these functions: it loads drivers and dataframe libraries that a cast without a write never needs.
Attributes¶
LOOKUP_AMBIGUITY = 'skip'
module-attribute
¶
Classes¶
Functions:¶
__getattr__(name)
¶
Source code in lpgcast/write.py
load_connection(path)
¶
A graflo connection config from a YAML file (db_type plus its fields).
Source code in lpgcast/write.py
write_cast(result, conn_conf, *, recreate_schema=False)
async
¶
Write result to the database conn_conf points at.
Vertices and edges are upserted by identity, so writing the same cast twice leaves a database that upserts unchanged. graflo's file backend appends on every write instead; count distinct identities there.