diepvries.hub module

A Hub.

class diepvries.hub.Hub(schema, name, fields, *_args, **_kwargs)

Bases: DataVaultTable

A hub.

property entity_name: str

Get entity name for current Hub.

Entity name corresponds to the name of the table, without the prefix.

Returns:

Name of the entity.

property loading_order: int

Get loading order (hubs are the first tables to be loaded).

Returns:

Table loading order.

property prefix: str

Get table prefix.

Returns:

Table prefix.

property sql_load_statement: str

Get the SQL query to populate current hub.

All needed placeholders are calculated, in order to match template SQL (check template_sql.hub_link_dml.sql).

Returns:

SQL query to load target hub.

property sql_placeholders: Dict[str, str]

Hub specific SQL placeholders.

These placeholders are used to format the hub loading query.

The results are joined with the results from super().sql_placeholders(), as all placeholders calculated in Table (parent class) are applicable in a Satellite.

Returns:

Satellite specific SQL placeholders.