graflo.architecture.evolution.db_profile¶
Update :class:~graflo.architecture.database_features.DatabaseProfile after vertex changes.
apply_edge_id_removal_to_db_profile(profile, removed_edge_ids)
¶
Drop edge specs/default values for removed logical edge triples.
Source code in graflo/architecture/evolution/db_profile.py
apply_edge_property_removal_to_db_profile(profile, removals_by_relation)
¶
Remove edge property references from edge indexes/default values.
Source code in graflo/architecture/evolution/db_profile.py
apply_edge_property_rename_to_db_profile(profile, renames_by_relation)
¶
Rename edge property references in edge indexes/default values.
Source code in graflo/architecture/evolution/db_profile.py
apply_field_rename_to_db_profile(profile, renames, *, edge_vertex_lookup=None)
¶
Rewrite field names referenced by a :class:DatabaseProfile.
renames maps each vertex name to a per-vertex {old_field: new_field}
map. Updates:
profile.vertex_indexes[vertex_name]field tuples.profile.edge_specs[*].indexesfield tuples (using both source and target vertex renames; an explicitedge_vertex_lookupmay be passed to mapEdgeId -> (source, target)when source/target names changed).profile.default_property_values.vertices[vertex_name]keys.
Source code in graflo/architecture/evolution/db_profile.py
apply_inverse_edges_to_db_profile(profile, relation_map, edges)
¶
Append inverse edge_specs and default_property_values for directed forward edges.
Source code in graflo/architecture/evolution/db_profile.py
apply_relation_removal_to_db_profile(profile, removed_relations)
¶
Drop edge specs/default values for removed relation names.
Source code in graflo/architecture/evolution/db_profile.py
apply_relation_rename_to_db_profile(profile, relation_renames)
¶
Rename logical edge relation keys in edge specs/default edge values.
Source code in graflo/architecture/evolution/db_profile.py
apply_storage_name_sanitization_to_db_profile(profile, schema, reserved_words, *, db_flavor=None)
¶
Sanitize physical storage/relation names against a flavor's reserved words.
Walks schema.core_schema.vertex_config.vertices and rewrites
profile.vertex_storage_names[vertex.name] when the current effective
storage name collides with a reserved word.
Walks schema.core_schema.edge_config.edges and rewrites the variant
spec's relation_name (via :meth:DatabaseProfile.set_edge_name_spec)
when the current effective relation name collides with a reserved word or
an existing vertex storage name.
For TigerGraph, also replaces invalid identifier characters and forbidden prefixes using the same rules as DDL validation.
Mutates profile in place.
Source code in graflo/architecture/evolution/db_profile.py
apply_vertex_merge_to_db_profile(profile, from_vertices, into)
¶
Remap logical vertex keys in profile when merging from_vertices into into.
Source code in graflo/architecture/evolution/db_profile.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
apply_vertex_removal_to_db_profile(profile, removed)
¶
Drop logical vertex keys and edge entries that reference removed vertices.
Source code in graflo/architecture/evolution/db_profile.py
apply_vertex_rename_to_db_profile(profile, vertex_renames)
¶
Rename logical vertex keys in profile.
Source code in graflo/architecture/evolution/db_profile.py
merge_relation_entries_in_db_profile(profile)
¶
Merge duplicate edge-spec/default entries created by relation remaps.