pirogue.SingleInheritance
- class pirogue.SingleInheritance(parent_table: str, child_table: str, pg_service: str | None = None, view_schema: str | None = None, view_name: str | None = None, pkey_default_value: bool = False, inner_defaults: dict = {})[source]
Creates a join view with associated triggers to edit for a single inheritance.
- __init__(parent_table: str, child_table: str, pg_service: str | None = None, view_schema: str | None = None, view_name: str | None = None, pkey_default_value: bool = False, inner_defaults: dict = {})[source]
Produces the SQL code of the join table and triggers
- Parameters:
pg_service – if not given, it is determined using environment variable PGSERVICE
parent_table – the parent table, can be schema specified
child_table – the child table, can be schema specified
view_schema – the schema where the view will written to
view_name – the name of the created view, defaults to vw_{parent_table}_{join_table}
pkey_default_value – the primary key column of the view will have a default value according to the child primary key table
inner_defaults – dictionary of other columns to default to in case the provided value is null or empty
Methods
__init__
(parent_table, child_table[, ...])Produces the SQL code of the join table and triggers
create
()Creates the merge view on the specified service Returns True in case of success