Skip to content

Commit e52d295

Browse files
committed
doc:Update README to be consistent with readme test
1 parent b49d9ab commit e52d295

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ CREATE TABLE legal_unit (
318318
-- Explicitly enable synchronization for the 'valid_to' column.
319319
SELECT sql_saga.add_era('legal_unit'::regclass, synchronize_valid_to_column := 'valid_to');
320320
-- Add temporal unique keys. A name is generated if the last argument is omitted.
321-
SELECT sql_saga.add_unique_key(table_oid => 'legal_unit'::regclass, column_names => ARRAY['id'], unique_key_name => 'legal_unit_id_valid');
322-
SELECT sql_saga.add_unique_key(table_oid => 'legal_unit'::regclass, column_names => ARRAY['legal_ident'], unique_key_name => 'legal_unit_legal_ident_valid');
321+
SELECT sql_saga.add_unique_key(table_oid => 'legal_unit'::regclass, column_names => ARRAY['id'], key_type => 'natural', unique_key_name => 'legal_unit_id_valid');
322+
SELECT sql_saga.add_unique_key(table_oid => 'legal_unit'::regclass, column_names => ARRAY['legal_ident'], key_type => 'natural', unique_key_name => 'legal_unit_legal_ident_valid');
323323
-- Add a predicated unique key (e.g., only active units must have a unique name).
324324
SELECT sql_saga.add_unique_key(
325325
table_oid => 'legal_unit'::regclass,
@@ -340,8 +340,8 @@ CREATE TABLE establishment (
340340
);
341341
342342
SELECT sql_saga.add_era(table_oid => 'establishment'::regclass);
343-
SELECT sql_saga.add_unique_key(table_oid => 'establishment'::regclass, column_names => ARRAY['id'], unique_key_name => 'establishment_id_valid');
344-
SELECT sql_saga.add_unique_key(table_oid => 'establishment'::regclass, column_names => ARRAY['name'], unique_key_name => 'establishment_name_valid');
343+
SELECT sql_saga.add_unique_key(table_oid => 'establishment'::regclass, column_names => ARRAY['id'], key_type => 'natural', unique_key_name => 'establishment_id_valid');
344+
SELECT sql_saga.add_unique_key(table_oid => 'establishment'::regclass, column_names => ARRAY['name'], key_type => 'natural', unique_key_name => 'establishment_name_valid');
345345
-- Add a temporal foreign key. It references a temporal unique key.
346346
SELECT sql_saga.add_foreign_key(
347347
fk_table_oid => 'establishment'::regclass,

todo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Keep a journal.md that tracks the state of the current ongoing task and relevant
1616
- [x] **Add validation for temporal primary keys:** Enhanced `add_unique_key` to validate that when `key_type` is `'primary'`, the target table does not have incompatible features like a `GENERATED ALWAYS` identity column or a simple (non-temporal) primary key. This moves the strict SCD Type 2 validation to where it belongs, allowing `add_era` to be more flexible.
1717
- [x] **Standardize API parameter naming:** Removed the `p_` prefix from all function parameters to align with PostgreSQL conventions and improve consistency. Updated all call sites and function bodies to use the new names, and standardized on `=>` for named argument syntax.
1818
- [ ] **Refactor tests to use `SAVEPOINT`s:** Modify regression tests to use `SAVEPOINT` and `ROLLBACK TO SAVEPOINT` to isolate test cases within a single transaction, instead of relying on `TRUNCATE` to reset state. This will make tests more robust and self-contained.
19+
- [ ] **Automate README.md example testing:** Investigate and implement a "literate programming" approach to ensure code examples in `README.md` are automatically tested. This could involve generating a test file from the README or creating a consistency checker script.
1920

2021
## Low Priority - Future Work & New Features
2122

0 commit comments

Comments
 (0)