docs: document primary key precedence in airbyte-protocol#62435
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
docs: document primary key precedence in airbyte-protocol#62435devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Add source_defined_primary_key field documentation to AirbyteStream - Add 'Logic for resolving Primary Key' section following cursor field pattern - Update ConfiguredAirbyteStream primary_key description with precedence reference - Document that source_defined_primary_key takes precedence over configured primary_key - Include validation logic: mismatches may or may not result in errors depending on context - Apply changes consistently across main and versioned documentation files This documents the existing behavior discovered through comprehensive codebase analysis where source-defined primary keys are treated as data integrity constraints that cannot be overridden by user configuration. Co-Authored-By: AJ Steers <aj@airbyte.io>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
Author
|
Original prompt from AJ Steers: |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
👋 Greetings, Contributor!Here are some helpful tips and reminders for your convenience. Helpful Resources
PR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
|
Aaron ("AJ") Steers (aaronsteers)
approved these changes
Jun 29, 2025
Contributor
Author
|
Closing due to inactivity for more than 7 days. Configure here. |
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.
source_defined_primary_keyin CatalogProvider airbyte-python-cdk#627source_defined_primary_keywhen defined (CDK bump) #62133Document primary key precedence in airbyte-protocol
Summary
This PR adds comprehensive documentation for primary key precedence behavior in the Airbyte protocol specification. Based on extensive codebase analysis across platform, CDK, and connector implementations, this documents the existing behavior where
source_defined_primary_keytakes precedence over user-configuredprimary_key.Key Changes:
source_defined_primary_keyfield documentation to theAirbyteStreamsectionConfiguredAirbyteStreamprimary_keyfield description to reference the new precedence rulesTechnical Context:
The investigation revealed that Airbyte intentionally prioritizes source-defined primary keys as immutable data integrity constraints rather than user-overridable defaults. This ensures data consistency by leveraging source expertise (e.g., actual database primary keys, API entity identifiers) over user preferences.
Review & Testing Checklist for Human
source_defined_primary_keyand user-configuredprimary_keyto confirm documented behavior matches actual system behaviorRecommended Test Plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TD MainDoc["docs/platform/understanding-airbyte/airbyte-protocol.md"]:::major-edit Version16["docusaurus/platform_versioned_docs/version-1.6/understanding-airbyte/airbyte-protocol.md"]:::major-edit Version17["docusaurus/platform_versioned_docs/version-1.7/understanding-airbyte/airbyte-protocol.md"]:::major-edit CatalogHelper["AirbyteCatalogHelper.kt<br/>(selectPrimaryKey method)"]:::context CDKCode["CDK Primary Key Logic"]:::context ConnectorImpls["Connector Implementations<br/>(JDBC, API sources)"]:::context MainDoc --> CatalogHelper Version16 --> CatalogHelper Version17 --> CatalogHelper CatalogHelper --> CDKCode CDKCode --> ConnectorImpls subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes