src/dirbs/listgen/generator.py
def _create_operator_partitions(self, conn, *, parent_tbl_name, child_name_fn,
                                    fillfactor=100, allow_existing=False, is_unlogged=True):
        """Helper function to DRY out adding child partitions to a parent table."""
        with conn.cursor() as cursor:
            for op in self._operators:
                op_shard_name = child_name_fn(op.id)
                if allow_existing:
                    cursor.execute(table_exists_sql(), [op_shard_name])
                    if cursor.fetchone().exists:
                        continue

                partition_utils.create_per_mno_lists_partition(conn,
                                                               operator_id=op.id,
                                                               parent_tbl_name=parent_tbl_name,
                                                               tbl_name=op_shard_name,
                                                               unlogged=is_unlogged,
                                                               fillfactor=fillfactor)
Helper function to DRY out adding child partitions to a parent table.
Helper function to DRY out adding child partitions to a parent table.
Helper function to DRY out adding child partitions to a parent table .
def _create_operator_partitions(self, conn, *, parent_tbl_name, child_name_fn,
                                    fillfactor=100, allow_existing=False, is_unlogged=True):
        with conn.cursor() as cursor:
            for op in self._operators:
                op_shard_name = child_name_fn(op.id)
                if allow_existing:
                    cursor.execute(table_exists_sql(), [op_shard_name])
                    if cursor.fetchone().exists:
                        continue
                partition_utils.create_per_mno_lists_partition(conn,
                                                               operator_id=op.id,
                                                               parent_tbl_name=parent_tbl_name,
                                                               tbl_name=op_shard_name,
                                                               unlogged=is_unlogged,
                                                               fillfactor=fillfactor)
def _create_operator_partitions ( self , conn , * , parent_tbl_name , child_name_fn , fillfactor = 100 , allow_existing = False , is_unlogged = True ) : with conn . cursor ( ) as cursor : for op in self . _operators : op_shard_name = child_name_fn ( op . id ) if allow_existing : cursor . execute ( table_exists_sql ( ) , [ op_shard_name ] ) if cursor . fetchone ( ) . exists : continue partition_utils . create_per_mno_lists_partition ( conn , operator_id = op . id , parent_tbl_name = parent_tbl_name , tbl_name = op_shard_name , unlogged = is_unlogged , fillfactor = fillfactor )
Helper function to DRY out adding child partitions to a parent table.
Helper function to DRY out adding child partitions to a parent table .
"""Helper function to DRY out adding child partitions to a parent table."""
self
conn
parent_tbl_name
child_name_fn
fillfactor
allow_existing
is_unlogged