normlite.txmodel.operations¶
Provide a protocol for commit operation and all proxy server operations.
Added in version 0.6.0.
Module Contents¶
- class normlite.txmodel.operations.Operation[source]¶
Bases:
ProtocolInterface for change requests that process data in the context of a transaction.
Change requests follow a well-defined protocol to accomplish their task of modifying data in a consistent way. Each operation must define:
stage(): These are the pre-commit activities to validate data prior to committing them.do_commit(): All activities to commit data to the database.do_rollback(): All activities to revert changes committed prior to this failed change.
- get_result() dict[source]¶
Return the result of the last executed
Operation.do_commit()orOperation.do_rollback().
- class normlite.txmodel.operations.StagedInsert(notion: normlite.notion_sdk.client.AbstractNotionClient, page_payload: dict, tx_id: str)[source]¶
Bases:
OperationOperation to create a new page in a Notion database.
- notion¶
- page_payload¶
- tx_id¶
- page_id = None¶
- _result = None¶
- get_result() dict[source]¶
Return the result of the last executed
Operation.do_commit()orOperation.do_rollback().
- class normlite.txmodel.operations.StagedSelect(notion: normlite.notion_sdk.client.AbstractNotionClient, payload: dict, tx_id: str)[source]¶
Bases:
OperationOperation to query the database.
- notion¶
- payload¶
- tx_id¶
- _result = None¶
- get_result() dict[source]¶
Return the result of the last executed
Operation.do_commit()orOperation.do_rollback().