Command Executors
Command node executors implements the business logic of the execution of a command node, the part or the full command that was produced by the command planner.
amsdal_glue.executors.SchemaCommandNodeExecutor ¶
Executes a node in the schema command tree produced by the schema command planner.
This class implements the business logic for executing a single node of a schema command tree.
Attributes:
Name | Type | Description |
---|---|---|
connection_manager |
ConnectionManager
|
Manages connections to the database. |
execute ¶
execute(command_node, transaction_id, lock_id)
Executes the given schema command node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command_node
|
SchemaCommandNode
|
The schema command node to be executed. |
required |
transaction_id
|
str | None
|
The transaction ID to be used during execution. |
required |
lock_id
|
str | None
|
The lock ID to be used during execution. |
required |
resolve_connection ¶
resolve_connection(mutations, transaction_id)
Resolves the connection for the given schema mutations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mutations
|
list[SchemaMutation]
|
The list of schema mutations to resolve the connection for. |
required |
transaction_id
|
str | None
|
The transaction ID to be used during execution. |
required |
Returns:
Name | Type | Description |
---|---|---|
ConnectionBase |
ConnectionBase
|
The resolved connection for the schema mutations. |
Raises:
Type | Description |
---|---|
ValueError
|
If no mutations are provided. |
amsdal_glue.executors.DataCommandNodeExecutor ¶
Executes a node in the data command tree.
This class implements the business logic for executing a single node of a data command tree.
Methods:
Name | Description |
---|---|
execute |
DataMutationNode, transaction_id: str | None, lock_id: str | None) -> None: Executes the given data mutation node. |
execute ¶
execute(mutation, transaction_id, lock_id)
Executes the given data mutation node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mutation
|
DataMutationNode
|
The data mutation node to be executed. |
required |
transaction_id
|
str | None
|
The transaction ID to be used during execution. |
required |
lock_id
|
str | None
|
The lock ID to be used during execution. |
required |
amsdal_glue.executors.TransactionNodeExecutor ¶
Executes a node in the transaction command tree.
This class implements the business logic for executing a single node of a transaction command tree.
Methods:
Name | Description |
---|---|
execute |
ExecutionTransactionCommandNode, transaction_id: str | None, lock_id: str | None) -> None: Executes the given transaction command node. |
execute ¶
execute(command_node, transaction_id, lock_id)
Executes the given transaction command node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command_node
|
ExecutionTransactionCommandNode
|
The transaction command node to be executed. |
required |
transaction_id
|
str | None
|
The transaction ID to be used during execution. |
required |
lock_id
|
str | None
|
The lock ID to be used during execution. |
required |
amsdal_glue.executors.LockCommandNodeExecutor ¶
Executes a node in the lock command tree.
This class implements the business logic for executing a single node of a lock command tree.
Methods:
Name | Description |
---|---|
execute |
ExecutionLockCommand, transaction_id: str | None, lock_id: str | None) -> None: Executes the given lock command node. |
execute ¶
execute(command, transaction_id, lock_id)
Executes the given lock command node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command
|
ExecutionLockCommand
|
The lock command node to be executed. |
required |
transaction_id
|
str | None
|
The transaction ID to be used during execution. |
required |
lock_id
|
str | None
|
The lock ID to be used during execution. |
required |