Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peerdb columns to ui, fix for BQ #1654

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions flow/connectors/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,10 @@ func (c *BigQueryConnector) SetupNormalizedTable(

if softDeleteColName != "" {
columns = append(columns, &bigquery.FieldSchema{
Name: softDeleteColName,
Type: bigquery.BooleanFieldType,
Repeated: false,
Name: softDeleteColName,
Type: bigquery.BooleanFieldType,
Repeated: false,
DefaultValueExpression: "false",
})
}

Expand Down
2 changes: 1 addition & 1 deletion flow/e2e/bigquery/peer_flow_bq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ func (s PeerFlowE2ETestSuiteBQ) Test_Soft_Delete_UD_Same_Batch() {
s.bqHelper.Config.DatasetId, dstName)
numNewRows, err := s.bqHelper.RunInt64Query(newerSyncedAtQuery)
require.NoError(s.t, err)
require.Equal(s.t, int64(0), numNewRows)
require.Equal(s.t, int64(1), numNewRows)
}

func (s PeerFlowE2ETestSuiteBQ) Test_Soft_Delete_Insert_After_Delete() {
Expand Down
5 changes: 4 additions & 1 deletion ui/app/mirrors/create/cdc/cdc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export default function CDCConfigForm({
label.includes('snapshot'))) ||
((mirrorConfig.source?.type !== DBType.POSTGRES ||
mirrorConfig.destination?.type !== DBType.POSTGRES) &&
label.includes('type system'))
label.includes('type system')) ||
(mirrorConfig.destination?.type !== DBType.BIGQUERY &&
mirrorConfig.destination?.type !== DBType.SNOWFLAKE &&
label.includes('column name'))
) {
return false;
}
Expand Down
20 changes: 20 additions & 0 deletions ui/app/mirrors/create/helpers/cdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,24 @@ export const cdcSettings: MirrorSetting[] = [
tips: 'Decide if PeerDB should use native Postgres types directly',
advanced: true,
},
{
label: 'Synced-At Column Name',
stateHandler: (value, setter) =>
setter((curr: CDCConfig) => ({
...curr,
syncedAtColName: value as string | '',
})),
tips: 'A field to set the name of PeerDBs synced_at column. If not set, a default name will be set',
advanced: true,
},
{
label: 'Soft Delete Column Name',
stateHandler: (value, setter) =>
setter((curr: CDCConfig) => ({
...curr,
softDeleteColName: value as string | '',
})),
tips: 'A field to set the name of PeerDBs soft delete column.',
advanced: true,
},
];
Loading