Bases: BaseEmitter
Safe v1 Neo4j executor: additive operations only.
Source code in graflo/migrate/emitters/neo4j.py
| class Neo4jEmitter(BaseEmitter):
"""Safe v1 Neo4j executor: additive operations only."""
@property
def backend_name(self) -> str:
return "neo4j"
def supports(self, operation: MigrationOperation) -> bool:
return operation.op_type in SUPPORTED_OPS
def dry_run_message(
self, operation: MigrationOperation, *, target_schema: Schema
) -> str:
_ = target_schema
return f"[neo4j] would apply {operation.op_type} on {operation.target}"
def execute(
self,
conn: Connection,
operation: MigrationOperation,
*,
target_schema: Schema,
) -> str:
if not self.supports(operation):
raise ValueError(
f"Operation not supported by neo4j v1 emitter: {operation.op_type}"
)
self._ensure_schema(conn, target_schema)
return f"[neo4j] applied {operation.op_type} on {operation.target}"
|