tdfs4ds.utils.manager_settings¶
tdfs4ds.utils.manager_settings
¶
Settings of a table of dates: FS_MANAGER_SETTINGS (0.3.7.31).
An optional key/value valid-time table, keyed on the TABLE OF DATES of a TimeManager (the soft
clones of a clock share that table, so what belongs to the dates belongs here). First setting:
CALENDAR, the JSON of the :class:tdfs4ds.utils.calendar.Calendar rule that produced the
dates. The data_domain_settings pattern: created at setup() / connect() when missing,
a failed CREATE is one warning remembered and not retried, every INSERT names its columns, reads
are fail-open (no table = no setting).
sql_literal
¶
Escape value for use inside a single-quoted SQL string literal.
For the DBC probes and catalog predicates that compare a name as data
(WHERE DatabaseName = '…'). The caller supplies the surrounding quotes.
manager_settings_creation
¶
Create FS_MANAGER_SETTINGS when missing. Never raises; returns whether it is usable.
available
¶
Whether the table exists in the primary store (checked once per store).
read_manager_settings
¶
{SETTING_NAME: SETTING_VALUE} of a table of dates. Fail-open: no table, no row or an
unreadable table is an empty dict.
set_manager_setting
¶
set_manager_setting(table_db: str, table: str, name: str, value: str, *, dry_run: bool = False) -> str
Record (or change) one setting of a table of dates; returns the SQL. dry_run=True writes nothing.
Raises RuntimeError when the table is missing and cannot be created.
delete_manager_setting
¶
delete_table_settings_sql
¶
Delete every setting of a table of dates (its calendar rule included).
delete_table_settings
¶
Forget every setting of a table of dates, for a table that is dropped (0.3.7.31). Fail-open: no settings table, or an error, deletes nothing and is only logged at debug level.