Skip to content

Commit

Permalink
console: sync: "Add meta information" option
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Dec 17, 2024
1 parent 1016c3a commit 3761e55
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions webapps/console/components/SyncEditorPage/SyncEditorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,23 @@ function SyncEditor({
),
}
: undefined,
destinationType.usesBulker
? {
name: "Add meta information",
documentation: (
<>
Add additional fields with meta information to each record. Meta information includes:
<br />
<code>_jitsu_timestamp</code> - time when the record was updated
</>
),
component: (
<div className={"w-80"}>
<SwitchComponent value={syncOptions?.addMeta} onChange={e => updateOptions({ addMeta: e })} />
</div>
),
}
: undefined,
].filter(Boolean) as EditorItem[];
if (appConfig.syncs.scheduler.enabled) {
const disableScheduling =
Expand Down
1 change: 1 addition & 0 deletions webapps/console/lib/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export const SyncOptionsType = z.object({
namespace: z.string().optional(),
tableNamePrefix: z.string().optional(),
toSameCase: z.boolean().optional(),
addMeta: z.boolean().optional(),
schedule: z.union([z.string(), z.enum(["0 0 * * *", "0 * * * *", "*/15 * * * *", "*/5 * * * *", "* * * * *"])]),
timezone: z.string().optional(),
});
Expand Down
1 change: 1 addition & 0 deletions webapps/console/lib/server/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ export async function scheduleSync({
startedBy: JSON.stringify(startedBy),
namespace: typeof sync.data?.["namespace"] !== "undefined" ? sync.data?.["namespace"] : "${LEGACY}",
toSameCase: sync.data?.["toSameCase"] ? "true" : "false",
addMeta: sync.data?.["addMeta"] ? "true" : "false",
tableNamePrefix: sync.data?.["tableNamePrefix"] ?? "",
},
body: {
Expand Down

0 comments on commit 3761e55

Please sign in to comment.