useCreateTableExportSync
useCreateTableExportSync(
knowledgeBaseId):UseCreateTableExportSyncReturn
Hook for creating a table export sync configuration
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
knowledgeBaseId | string |
Returns
Section titled “Returns”UseCreateTableExportSyncReturn
Example
Section titled “Example”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>}