Source: factory.core/ObjDataStore.py
Data store management class for schema operations and history management.
| Method | Signature | Description |
|---|---|---|
| schema_get_fields | schema_get_fields(table: str) -> List[str] |
Get all field names for a table in lowercase. |
| schema_get_primary | schema_get_primary(table: str) -> List[str] |
Get primary key column names for a table in lowercase. |
| schema_block_to_package | schema_block_to_package(def_tables: str, primary: List[str] | None = None) -> None |
Convert block column to package column in definition tables. |
| schema_add_package | schema_add_package(def_tables: str, primary: List[str] | None = None) -> None |
Add package column to a definition table. |
| schema_refactor_def | schema_refactor_def() -> None |
Refactor definition tables to include package column. |
| schema_validate_def | schema_validate_def() -> None |
Validate definition tables. |
| get_history_by_month | get_history_by_month(table: str, month_col: str = '', retained_months: int = 2) -> List[Dict[str, Any]] |
Get history blocks by month that are older than retained months. |
| trim_history_by_month | trim_history_by_month(table: str, month_col: str = '', retained_months: int = 2) -> None |
Trim history records older than retained months. |
| delete_buffer | delete_buffer(table: str, buffer: List[Any], keys: List[str], guid: str = '') -> None |
Delete records from table based on buffer of key values. |
| move_to_history_by_month | move_to_history_by_month(table: str, month_col: str = '', retained_months: int = 2) -> List[str] |
Move old records to history tables by month. |
| normalise_history | normalise_history() -> None |
Normalize history table names to standard format. |
| trim_history | trim_history() -> None |
Trim history based on configuration settings. |
| move_to_history | move_to_history() -> List[Dict[str, Any]] |
Move records to history tables based on configuration. |
| remove_redacted | remove_redacted() -> None |
Remove redacted tables based on configuration. |
| move_documents | move_documents() -> None |
Move files from local.documents to data.documents based on TTL. |
| get_table_size_mb | get_table_size_mb(table: str) -> float |
Get table size in megabytes. |
| get_existing_history_tables | get_existing_history_tables(table: str) -> List[str] |
Get list of existing history tables for a given table. |
| get_history_by_month_fast | get_history_by_month_fast(table: str, month_col: str = '', retained_months: int = 2) -> bool |
Check if there are records older than retained months. |
| history_check | history_check() -> None |
Check for actionable history records. |
| truncate_check | truncate_check() -> None |
Check for actionable truncate records. |
| get_history_estimate | get_history_estimate() -> List[Dict[str, Any]] |
Get estimated data moves for all configured history tables. |
CLI command to move old documents based on TTLs in def_document.
CLI command to check for actionable history.
CLI command to check for actionable truncates.
CLI command to display estimated data moves for history tables.