-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Copy link
Labels
DatabaseIssue that alters only configs of a database itselfIssue that alters only configs of a database itselfIngesterThe issue relates to the ingester tool, including the command itself and related functions.The issue relates to the ingester tool, including the command itself and related functions.
Description
In old kcidb ingestion we had certain limitations imposed, such as to not change checkout/build/test fields after they are set (we cannot update/delete non-null values).
Location(approx): kcidb/db/sql/schema.py:264-286
The INSERT statement uses ON CONFLICT ... DO UPDATE SET with COALESCE functions to preserve existing values:
ON CONFLICT (primary_key_columns) DO UPDATE SET
column_name = COALESCE(table.column_name, excluded.column_name)
The logic works as follows:
- Lines 264-269: Identifies primary key columns for the conflict resolution
- Lines 270-286: For non-primary-key columns, it uses COALESCE to decide which value to keep:
- If prio_db is True: COALESCE(table.column, excluded.column) - keeps existing DB values if not NULL
- If prio_db is False: COALESCE(excluded.column, table.column) - prefers new values if not NULL
- For columns with conflict_func (like timestamps): Uses a specific function (e.g., GREATEST) to resolve conflicts
(still need to check where and how prio_db used)
tales-aparecida
Metadata
Metadata
Assignees
Labels
DatabaseIssue that alters only configs of a database itselfIssue that alters only configs of a database itselfIngesterThe issue relates to the ingester tool, including the command itself and related functions.The issue relates to the ingester tool, including the command itself and related functions.
Type
Projects
Status
In Review