feat(ampsync): configurable destination table#1988
Open
matiasedgeandnode wants to merge 2 commits intomainfrom
Open
feat(ampsync): configurable destination table#1988matiasedgeandnode wants to merge 2 commits intomainfrom
matiasedgeandnode wants to merge 2 commits intomainfrom
Conversation
Adds two new config options for controlling PostgreSQL destination table names:
- TABLE_SUFFIX: appends a static suffix (e.g., "green" → usdc_transfers_green)
- TABLE_VERSION: appends sanitized dataset revision (e.g., 1.0.0 → usdc_transfers_v1_0_0)
Composition order: {table}_v{revision}_{suffix}. Both options are independent
and backward compatible — omitting both preserves existing behavior.
Introduces TableMapping (source → destination) to separate the dataset table name
used in streaming queries from the PostgreSQL table name used for writes.
7f8b975 to
b12ddc5
Compare
tmigone
reviewed
Mar 17, 2026
| /// | ||
| /// Replaces non-alphanumeric characters with underscores and prepends `v`. | ||
| /// Example: `1.0.0` → `v1_0_0`, `abc123...` → `vabc123...` | ||
| fn sanitize_revision(revision: &str) -> String { |
Member
There was a problem hiding this comment.
There might be collisions here for example 1.0.0 and 1-0-0 both resolve to 1_0_0. At least worth documenting imo.
tmigone
reviewed
Mar 17, 2026
| /// # Composition order | ||
| /// | ||
| /// `{source}_v{revision}_{suffix}` | ||
| pub fn build_table_mappings( |
Member
There was a problem hiding this comment.
we should probably throw if table_suffix = ""
Author
There was a problem hiding this comment.
actually defaulted to no prefix. Doesn't that make sense?
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.
Adds two new config options for controlling PostgreSQL destination table names:
Composition order: {table}v{revision}{suffix}. Both options are independent and backward compatible — omitting both preserves existing behavior.
Introduces TableMapping (source → destination) to separate the dataset table name used in streaming queries from the PostgreSQL table name used for writes.