Skip to content

useCreateTableExportSync

useCreateTableExportSync(knowledgeBaseId): UseCreateTableExportSyncReturn

Hook for creating a table export sync configuration

ParameterType
knowledgeBaseIdstring

UseCreateTableExportSyncReturn

function CreateSyncForm({ kbId }: { kbId: string }) {
const { createSync, isLoading, error } = useCreateTableExportSync(kbId)
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
const config = await createSync({
schema_name: 'public',
table_name: 'users',
columns: ['id', 'name', 'email'],
sync_mode: 'automatic',
sync_on_insert: true,
sync_on_update: true,
})
if (config) {
console.log('Created sync config:', config.id)
}
}
return <form onSubmit={handleSubmit}>...</form>
}