Repository navigation
feat(postgres): append and upsert - #76
Merged
Merged
Conversation
carolsimone
force-pushed
the
feat/write-modes-engine-port
branch
2 times, most recently
from
October 10, 2026 12:43
1161ec3 to
28b6402
Compare
load now writes through _insert_rows and _transaction, which append and upsert will share: batched execute_values inserts naming the data's columns, with the existing percent escaping, inside an explicit BEGIN and COMMIT that rolls back on error. No behavior change. Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw
PostgresAdapter declares TableIntrospection and reports each column's name and nullability, raising LookupError for a missing table. The engine-contract conformance suite runs against the postgres stack from here on. Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw
PostgresAdapter declares AppendCapable: one explicit transaction of batched inserts through the shared insert helper; zero rows write nothing. Passes the append conformance cases, including atomicity across insert pages, quoted names and a different column order. Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw
A primary_key passed to ensure_table becomes the created table's enforced, indexed PRIMARY KEY; a key on an undeclared column is rejected before any DDL. Without a key the CREATE TABLE is byte-identical to before. Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw
PostgresAdapter declares UpsertCapable: one transaction of batched inserts with ON CONFLICT (key) DO UPDATE SET each non-key column from EXCLUDED, or DO NOTHING when every column is in the key. A table without the key constraint fails instead of collecting duplicates. Passes the upsert conformance cases. Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw
carolsimone
force-pushed
the
feat/write-modes-postgres
branch
from
October 10, 2026 14:28
fdd7a69 to
efbe27b
Compare
The engine-contract conformance suite moved to continuo_engine_contract.testing.conformance in #75; the postgres integration test still imported the pre-move path and failed collection once #75 merged to main. Signed-off-by: Simone Carolini <simonecarolini.sc@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third runtime PR of the write-modes series (spec R3). Stacked on #75 (engine port, contract 0.8.0) — base is
feat/write-modes-engine-port; retarget tomainas the stack merges._insert_rowsand_transactionare the one insert path and transaction shape behindload,appendand_upsert;loadis unchanged in behavior.PostgresAdapter(WarehouseAdapter, AppendCapable, UpsertCapable):table_columns(information_schema,LookupErrorwhen absent),append,_upsert(INSERT ... ON CONFLICT (key) DO UPDATE SET c = EXCLUDED.c,DO NOTHINGwhen every column is in the key). Zero rows open no transaction.ensure_table(..., primary_key=...)declares the key asPRIMARY KEYin theCREATE TABLE; without a key the DDL is unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_0137E9XmyUXhwPTRrtNfivDw