The canonical data product for the Digital Core domain, copied unchanged from the blog repository's products/canonical-party (generated by /agent-product from data_model/data_products/canonical.md, 65 of 65 checks on the blog's stack on 2026-09-09). The next commit adapts it to the domain platform. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
63 lines
1.8 KiB
SQL
63 lines
1.8 KiB
SQL
-- Canonical Party: analytical replication into DuckLake (runs on the lakehouse service).
|
|
--
|
|
-- pg_duckpipe follows the ODS write-ahead log and maintains a DuckLake copy of each table as
|
|
-- Parquet in the digital-lake bucket. The platform-level sync group `digital_oltp` already
|
|
-- points at the ODS (see compose.yml); the product only registers its tables with it.
|
|
-- Trino reads the result as lake.canonical_party.<table>.
|
|
|
|
CREATE SCHEMA IF NOT EXISTS canonical_party;
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.party',
|
|
target_table => 'canonical_party.party',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.address',
|
|
target_table => 'canonical_party.address',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.person',
|
|
target_table => 'canonical_party.person',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.company',
|
|
target_table => 'canonical_party.company',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.party_role',
|
|
target_table => 'canonical_party.party_role',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.customer',
|
|
target_table => 'canonical_party.customer',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.contact_address',
|
|
target_table => 'canonical_party.contact_address',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.party_role_contact_address',
|
|
target_table => 'canonical_party.party_role_contact_address',
|
|
sync_group => 'digital_oltp'
|
|
);
|
|
|
|
SELECT duckpipe.add_table(
|
|
'canonical_party.party_association',
|
|
target_table => 'canonical_party.party_association',
|
|
sync_group => 'digital_oltp'
|
|
);
|