Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

refactor(studio): use v2 replication publication APIs (#49844)

Danny White8dd97d75aaba
diff --git a/apps/studio/components/interfaces/Database/Replication/BatchRestartDialog.tsx b/apps/studio/components/interfaces/Database/Replication/BatchRestartDialog.tsx
index 1c9948cb6e0..765b929e4c7 100644
--- a/apps/studio/components/interfaces/Database/Replication/BatchRestartDialog.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/BatchRestartDialog.tsx
@@ -26,7 +26,7 @@ interface BatchRestartDialogProps {
tables: ReplicationPipelineTableStatus[]
sourceId?: number
publicationName?: string
- tableSyncCopy?: TableSyncCopyConfig
+ tableSyncCopy?: TableSyncCopyConfig | null
pipelineStatusName?: PipelineStatusName
onRestartStart?: (tableIds: number[]) => void
onRestartComplete?: (tableIds: number[]) => void
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.test.ts b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.test.ts
index 1d5cf152e3a..2b5b503f439 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.test.ts
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.test.ts
@@ -15,7 +15,7 @@ import {
import { getDucklakeValidationIssues } from './DuckLake/DuckLake.utils'
import { getSnowflakeValidationIssues } from './Snowflake/Snowflake.utils'
import type { ReplicationPipelineByIdData } from '@/data/replication/pipeline-by-id-query'
-import type { ReplicationPublication } from '@/data/replication/publications-query'
+import type { ReplicationPublicationData } from '@/data/replication/publication-query'
const baseDucklakeFormData = {
name: 'DuckLake Destination',
@@ -169,30 +169,58 @@ describe('DestinationForm.utils table copy selection', () => {
})
it('drops selected ids that are no longer in the publication', () => {
- const publications = [
- { name: 'analytics', tables: [{ id: 101, schema: 'public', name: 'orders' }] },
- ] as ReplicationPublication[]
+ const publication: ReplicationPublicationData = {
+ name: 'analytics',
+ config: {
+ type: 'all_tables',
+ operations: ['insert'],
+ publish_via_partition_root: false,
+ },
+ tables: [
+ {
+ id: 101,
+ schema: 'public',
+ name: 'orders',
+ kind: 'table',
+ partition_parent_id: null,
+ },
+ ],
+ }
expect(
pruneStaleSelectedTableIds({
mode: 'include_tables',
selectedTableIds: ['101', '202'],
- publications,
+ publication,
publicationName: 'analytics',
})
).toEqual(['101'])
})
it('leaves selected ids untouched for non-selective modes', () => {
- const publications = [
- { name: 'analytics', tables: [{ id: 101, schema: 'public', name: 'orders' }] },
- ] as ReplicationPublication[]
+ const publication: ReplicationPublicationData = {
+ name: 'analytics',
+ config: {
+ type: 'all_tables',
+ operations: ['insert'],
+ publish_via_partition_root: false,
+ },
+ tables: [
+ {
+ id: 101,
+ schema: 'public',
+ name: 'orders',
+ kind: 'table',
+ partition_parent_id: null,
+ },
+ ],
+ }
expect(
pruneStaleSelectedTableIds({
mode: 'include_all_tables',
selectedTableIds: ['202'],
- publications,
+ publication,
publicationName: 'analytics',
})
).toEqual(['202'])
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.ts b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.ts
index 3ed2cb9a00b..4c7da8776cf 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.ts
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.ts
@@ -26,7 +26,7 @@ import { type DucklakeApiConfig } from './DuckLake/DuckLake.utils'
import { type SnowflakeApiConfig } from './Snowflake/Snowflake.utils'
import { type ReplicationDestinationByIdData } from '@/data/replication/destination-by-id-query'
import { type ReplicationPipelineByIdData } from '@/data/replication/pipeline-by-id-query'
-import { type ReplicationPublication } from '@/data/replication/publications-query'
+import { type ReplicationPublicationData } from '@/data/replication/publication-query'
import type {
BatchConfig,
BigQueryDestinationConfig,
@@ -203,15 +203,15 @@ export const buildBatchConfig = ({
}
// The set of table ids (as strings, matching form state) currently in the
-// selected publication. Selective table-copy only ever offers/keeps ids that
-// are in this set; ids selected previously that fall out of it are dropped at
-// submit time rather than resolved or displayed.
+// selected publication. Selective table-copy only ever offers ids in this set;
+// previously selected ids that fall out of it are highlighted in the form and
+// dropped at submit time.
export const getPublicationTableIds = (
- publications: ReplicationPublication[],
+ publication: ReplicationPublicationData,
publicationName: string
): Set<string> => {
- const publication = publications.find(({ name }) => name === publicationName)
- return new Set((publication?.tables ?? []).map(({ id }) => String(id)))
+ if (publication.name !== publicationName) return new Set()
+ return new Set(publication.tables.map(({ id }) => String(id)))
}
// Drops selected table ids that are no longer in the current publication.
@@ -220,17 +220,17 @@ export const getPublicationTableIds = (
export const pruneStaleSelectedTableIds = ({
mode,
selectedTableIds,
- publications,
+ publication,
publicationName,
}: {
mode: DestinationPanelSchemaType['tableSyncCopyMode']
selectedTableIds: string[]
- publications: ReplicationPublication[]
+ publication: ReplicationPublicationData
publicationName: string
}): string[] => {
if (mode === 'include_all_tables' || mode === 'skip_all_tables') return selectedTableIds
- const publicationTableIds = getPublicationTableIds(publications, publicationName)
+ const publicationTableIds = getPublicationTableIds(publication, publicationName)
return selectedTableIds.filter((id) => publicationTableIds.has(id))
}
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/NewPublicationPanel.test.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/NewPublicationPanel.test.tsx
new file mode 100644
index 00000000000..0268d7180cb
--- /dev/null
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/NewPublicationPanel.test.tsx
@@ -0,0 +1,118 @@
+import { fireEvent, screen, waitFor, within } from '@testing-library/react'
+import type { components } from 'api-types'
+import { HttpResponse } from 'msw'
+import { describe, expect, it, vi } from 'vitest'
+
+import { NewPublicationPanel } from './NewPublicationPanel'
+import { customRender } from '@/tests/lib/custom-render'
+import { addAPIMock } from '@/tests/lib/msw'
+
+type ReplicationSourcesResponse = components['schemas']['SourcesResponse_Output']
+type ReadTablesResponse = components['schemas']['ReadTablesResponse_Output']
+type PublicationDetailsResponse = components['schemas']['PublicationDetailsResponse_Output']
+
+const mockSources: ReplicationSourcesResponse = {
+ sources: [
+ {
+ id: 1,
+ name: 'default',
+ tenant_id: 'tenant',
+ config: { host: 'db.internal', name: 'main-db', port: 5432, username: 'etl_user' },
+ },
+ ],
+}
+
+const mockTables: ReadTablesResponse = {
+ tables: [
+ {
+ id: 17487,
+ schema: 'CamelSchema',
+ name: 'MixedCaseTable',
+ kind: 'table',
+ partition_parent_id: null,
+ },
+ ],
+}
+
+const mockPublication: PublicationDetailsResponse = {
+ name: 'MixedCasePublication',
+ config: {
+ type: 'tables',
+ tables: [
+ {
+ id: 17487,
+ schema: 'CamelSchema',
+ name: 'MixedCaseTable',
+ columns: null,
+ row_filter: null,
+ },
+ ],
+ operations: ['insert', 'update', 'delete', 'truncate'],
+ publish_via_partition_root: true,
+ },
+ tables: [
+ {
+ id: 17487,
+ schema: 'CamelSchema',
+ name: 'MixedCaseTable',
+ kind: 'table',
+ partition_parent_id: null,
+ },
+ ],
+}
+
+const mockQueries = () => {
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/:ref/sources',
+ response: mockSources,
+ })
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/v2/:ref/sources/:source_id/tables',
+ response: mockTables,
+ })
+}
+
+describe('NewPublicationPanel', () => {
+ it('shows table names but submits table ids and hides empty-state guidance after selection', async () => {
+ mockQueries()
+ let requestBody: unknown
+ addAPIMock({
+ method: 'put',
+ path: '/platform/replication/v2/:ref/sources/:source_id/publications/:publication_name',
+ response: async ({ request }) => {
+ requestBody = await request.json()
+ return HttpResponse.json<PublicationDetailsResponse>(mockPublication)
+ },
+ })
+
+ customRender(<NewPublicationPanel visible onClose={vi.fn()} />)
+
+ expect(
+ await screen.findByText('Select at least one table to include in the publication.')
+ ).toBeInTheDocument()
+
+ const trigger = screen.getAllByRole('combobox').find((element) => element.tagName === 'BUTTON')!
+ fireEvent.click(trigger)
+ fireEvent.click(await screen.findByText('CamelSchema.MixedCaseTable'))
+
+ expect(within(trigger).getByText('CamelSchema.MixedCaseTable')).toBeInTheDocument()
+ expect(trigger).not.toHaveTextContent('17487')
+ expect(
+ screen.queryByText('Select at least one table to include in the publication.')
+ ).not.toBeInTheDocument()
+
+ fireEvent.change(screen.getByPlaceholderText('Name'), {
+ target: { value: 'MixedCasePublication' },
+ })
+ fireEvent.click(screen.getByRole('button', { name: 'Create publication' }))
+
+ await waitFor(() =>
+ expect(requestBody).toMatchObject({
+ tables: [{ id: 17487 }],
+ publish_via_partition_root: true,
+ })
+ )
+ })
+})
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/NewPublicationPanel.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/NewPublicationPanel.tsx
index 57991eda2e6..5d2335cbe2f 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/NewPublicationPanel.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/NewPublicationPanel.tsx
@@ -1,5 +1,6 @@
import { zodResolver } from '@hookform/resolvers/zod'
import { useParams } from 'common'
+import { useState } from 'react'
import { useForm } from 'react-hook-form'
import { toast } from 'sonner'
import {
@@ -20,11 +21,15 @@ import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { MultiSelector } from 'ui-patterns/multi-select'
import { z } from 'zod'
+import {
+ isMetadataListErrorVisible,
+ isMetadataListLoading,
+ useRefreshOnOpen,
+} from './useRefreshOnOpen'
import { DiscardChangesConfirmationDialog } from '@/components/ui-patterns/Dialogs/DiscardChangesConfirmationDialog'
import { useCreatePublicationMutation } from '@/data/replication/publication-create-mutation'
import { useReplicationSourceId } from '@/data/replication/sources-query'
import { useReplicationTablesQuery } from '@/data/replication/tables-query'
-import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
import { useConfirmOnClose } from '@/hooks/ui/useConfirmOnClose'
interface NewPublicationPanelProps {
@@ -32,23 +37,41 @@ interface NewPublicationPanelProps {
onClose: (newPublication?: string) => void
}
+const FORM_ID = 'publication-editor'
+
+const FormSchema = z.object({
+ name: z.string().min(1, 'Name is required'),
+ tableIds: z.array(z.string()).min(1, 'At least one table is required'),
+})
+type FormValues = z.infer<typeof FormSchema>
+
+const defaultValues: FormValues = {
+ name: '',
+ tableIds: [],
+}
+
export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelProps) => {
const { ref: projectRef } = useParams()
- const { data: project } = useSelectedProjectQuery()
const sourceId = useReplicationSourceId({ projectRef })
+ const [shouldLoadTables, setShouldLoadTables] = useState(false)
- const { data: tables } = useReplicationTablesQuery({ projectRef, sourceId }, { enabled: visible })
-
- const formId = 'publication-editor'
- const FormSchema = z.object({
- name: z.string().min(1, 'Name is required'),
- tables: z.array(z.string()).min(1, 'At least one table is required'),
+ const {
+ data: tables = [],
+ isPending,
+ isFetching,
+ isError,
+ refetch: refetchTables,
+ } = useReplicationTablesQuery({ projectRef, sourceId }, { enabled: visible && shouldLoadTables })
+ const isLoadingTables = isMetadataListLoading(isPending || isFetching, tables.length)
+ const { handleOpenChange: handleRefreshTablesOnOpen } = useRefreshOnOpen({
+ isEnabled: shouldLoadTables,
+ refetch: refetchTables,
})
- const defaultValues: z.infer<typeof FormSchema> = {
- name: '',
- tables: [],
- }
- const form = useForm<z.infer<typeof FormSchema>>({
+ const tableLabelsById = new Map(
+ tables.map((table) => [String(table.id), `${table.schema}.${table.name}`] as const)
+ )
+
+ const form = useForm<FormValues>({
mode: 'onBlur',
reValidateMode: 'onBlur',
resolver: zodResolver(FormSchema),
@@ -60,6 +83,7 @@ export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelPro
const { isDirty } = form.formState
const closePanel = (newPublication?: string) => {
+ setShouldLoadTables(false)
form.reset(defaultValues)
onClose(newPublication)
}
@@ -69,7 +93,7 @@ export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelPro
onClose: () => closePanel(),
})
- const { mutate: createPublication, isPending: creatingPublication } =
+ const { mutate: createPublication, isPending: isCreatingPublication } =
useCreatePublicationMutation({
onSuccess: (_, vars) => {
toast.success('Successfully created publication')
@@ -77,22 +101,15 @@ export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelPro
},
})
- const onSubmit = async (data: z.infer<typeof FormSchema>) => {
+ const onSubmit = async (data: FormValues) => {
if (!projectRef) return console.error('Project ref is required')
- if (!project) return console.error('Project is required')
if (!sourceId) return console.error('Source id is required')
- const tables = data.tables.map((table) => {
- const [schema, name] = table.split('.')
- return { schema, name }
- })
-
createPublication({
projectRef,
sourceId,
name: data.name,
- tables,
- connectionString: project.connectionString,
+ tableIds: data.tableIds.map(Number),
})
}
@@ -108,7 +125,7 @@ export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelPro
<SheetSection className="grow overflow-auto">
<Form {...form}>
<form
- id={formId}
+ id={FORM_ID}
onSubmit={form.handleSubmit(onSubmit)}
className="flex flex-col gap-y-4"
>
@@ -116,7 +133,7 @@ export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelPro
control={form.control}
name="name"
render={({ field }) => (
- <FormItemLayout label="Name" layout="vertical">
+ <FormItemLayout label="Name" layout="horizontal">
<FormControl>
<Input {...field} placeholder="Name" />
</FormControl>
@@ -125,30 +142,46 @@ export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelPro
/>
<FormField
control={form.control}
- name="tables"
+ name="tableIds"
render={({ field }) => (
<FormItemLayout
label="Tables"
- description="Select at least one table to include in the publication."
+ layout="horizontal"
+ description={
+ field.value.length === 0
+ ? 'Select at least one table to include in the publication.'
+ : undefined
+ }
>
<FormControl>
<MultiSelector
values={field.value}
onValuesChange={field.onChange}
- disabled={creatingPublication}
+ disabled={isCreatingPublication}
+ onOpenChange={(isOpen) => {
+ if (isOpen && !shouldLoadTables) {
+ setShouldLoadTables(true)
+ return
+ }
+ handleRefreshTablesOnOpen(isOpen)
+ }}
>
<MultiSelector.Trigger
+ aria-label="Select publication tables"
badgeLimit="wrap"
label="Select tables..."
- mode="inline-combobox"
+ renderValue={(id) => tableLabelsById.get(id) ?? 'Unavailable table'}
/>
<MultiSelector.Content>
- <MultiSelector.List>
- {tables?.map((table) => (
- <MultiSelector.Item
- key={`${table.schema}.${table.name}`}
- value={`${table.schema}.${table.name}`}
- >
+ <MultiSelector.Input placeholder="Search tables..." />
+ <MultiSelector.List
+ emptyLabel="No tables available"
+ error={isMetadataListErrorVisible(isError, tables.length)}
+ errorLabel="Unable to load tables"
+ loading={isLoadingTables}
+ >
+ {tables.map((table) => (
+ <MultiSelector.Item key={table.id} value={String(table.id)}>
{`${table.schema}.${table.name}`}
</MultiSelector.Item>
))}
@@ -163,10 +196,15 @@ export const NewPublicationPanel = ({ visible, onClose }: NewPublicationPanelPro
</Form>
</SheetSection>
<SheetFooter>
- <Button variant="default" disabled={creatingPublication} onClick={confirmOnClose}>
+ <Button variant="default" disabled={isCreatingPublication} onClick={confirmOnClose}>
Cancel
</Button>
- <Button variant="primary" loading={creatingPublication} form={formId} type="submit">
+ <Button
+ variant="primary"
+ loading={isCreatingPublication}
+ form={FORM_ID}
+ type="submit"
+ >
Create publication
</Button>
</SheetFooter>
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PipelineCostDialog.test.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PipelineCostDialog.test.tsx
index d7020cc3ec4..a050d8128ca 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PipelineCostDialog.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PipelineCostDialog.test.tsx
@@ -7,8 +7,8 @@ import { PipelineCostDialog } from './PipelineCostDialog'
import { customRender } from '@/tests/lib/custom-render'
import { addAPIMock } from '@/tests/lib/msw'
-type CostEstimateResponse = components['schemas']['CostEstimateResponse']
-type ReplicationSourcesResponse = components['schemas']['ReplicationSourcesResponse']
+type CostEstimateResponse = components['schemas']['CostEstimateResponse_Output']
+type ReplicationSourcesResponse = components['schemas']['SourcesResponse_Output']
const tables = [
{
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationSelection.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationSelection.tsx
index e0ac6818d71..d8005623ba0 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationSelection.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationSelection.tsx
@@ -1,5 +1,4 @@
import { useParams } from 'common'
-import { useMemo } from 'react'
import { useWatch, type UseFormReturn } from 'react-hook-form'
import { FormControl, FormField } from 'ui'
import { Admonition } from 'ui-patterns/Admonition'
@@ -7,7 +6,7 @@ import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import type { DestinationPanelSchemaType } from './DestinationForm.schema'
import { PublicationsComboBox } from './PublicationsComboBox'
-import { useReplicationPublicationsQuery } from '@/data/replication/publications-query'
+import { useReplicationPublicationNamesQuery } from '@/data/replication/publication-names-query'
import { useReplicationSourceId } from '@/data/replication/sources-query'
type PublicationSelectionProps = {
@@ -24,14 +23,13 @@ export const PublicationSelection = ({
const sourceId = useReplicationSourceId({ projectRef })
- const { data: publications, isSuccess: isSuccessPublications } = useReplicationPublicationsQuery({
- projectRef,
- sourceId,
- })
+ const { data: publications, isSuccess: isSuccessPublications } =
+ useReplicationPublicationNamesQuery({ projectRef, sourceId })
- const publicationNames = useMemo(() => publications?.map((pub) => pub.name) ?? [], [publications])
const isSelectedPublicationMissing =
- isSuccessPublications && !!publicationName && !publicationNames.includes(publicationName)
+ isSuccessPublications &&
+ !!publicationName &&
+ !(publications ?? []).some((publication) => publication.name === publicationName)
return (
<FormField
@@ -49,6 +47,14 @@ export const PublicationSelection = ({
...field,
onChange: (value) => {
if (value !== field.value) {
+ // Every per-table selection is scoped to the previously selected
+ // publication's table list, so none of it carries over cleanly to a
+ // different publication — reset it all rather than risk a stale or
+ // coincidentally-matching table id sticking around.
+ form.setValue('tableSyncCopyMode', 'include_all_tables', {
+ shouldDirty: true,
+ shouldValidate: true,
+ })
form.setValue('tableSyncCopyTableIds', [], {
shouldDirty: true,
shouldValidate: true,
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationsComboBox.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationsComboBox.tsx
index 2e6e8f70144..85ce0544d12 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationsComboBox.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationsComboBox.tsx
@@ -1,9 +1,8 @@
import { useParams } from 'common'
-import { Check, ChevronsUpDown, Loader2, Plus } from 'lucide-react'
-import { useEffect, useState } from 'react'
+import { Check, ChevronsUpDown, Plus } from 'lucide-react'
+import { useState } from 'react'
import { ControllerRenderProps } from 'react-hook-form'
import {
- Badge,
Button,
cn,
Command,
@@ -18,10 +17,15 @@ import {
PopoverTrigger,
ScrollArea,
} from 'ui'
-import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
+import { SelectionListState } from 'ui-patterns/SelectionListState'
import type { DestinationPanelSchemaType } from './DestinationForm.schema'
-import { useReplicationPublicationsQuery } from '@/data/replication/publications-query'
+import {
+ isMetadataListErrorVisible,
+ isMetadataListLoading,
+ useRefreshOnOpen,
+} from './useRefreshOnOpen'
+import { useReplicationPublicationNamesQuery } from '@/data/replication/publication-names-query'
interface PublicationsComboBoxProps {
sourceId?: number
@@ -37,41 +41,38 @@ export const PublicationsComboBox = ({
const { ref: projectRef } = useParams()
const [searchTerm, setSearchTerm] = useState('')
- const [dropdownOpen, setDropdownOpen] = useState(false)
- const [selectedPublication, setSelectedPublication] = useState<string>(field?.value || '')
+ const [isDropdownOpen, setIsDropdownOpen] = useState(false)
+ const selectedPublication = field.value || ''
const {
data: publications = [],
isPending,
isFetching,
+ isError,
+ refetch: refetchPublications,
+ } = useReplicationPublicationNamesQuery({ projectRef, sourceId })
+ const isLoadingStateVisible = isMetadataListLoading(isPending || isFetching, publications.length)
+ const isErrorStateVisible = isMetadataListErrorVisible(isError, publications.length)
+ const { handleOpenChange: handleRefreshPublicationsOnOpen } = useRefreshOnOpen({
+ isEnabled: projectRef !== undefined && sourceId !== undefined,
refetch: refetchPublications,
- } = useReplicationPublicationsQuery({ projectRef, sourceId })
- const isLoadingPublications = isPending || isFetching
- const showLoadingState = isLoadingPublications && publications.length === 0
+ })
function handlePublicationSelect(pub: string) {
- setSelectedPublication(pub)
- setDropdownOpen(false)
+ setIsDropdownOpen(false)
field.onChange(pub)
}
- useEffect(() => {
- setSelectedPublication(field?.value || '')
- }, [field?.value])
-
return (
<Popover
modal={false}
- open={dropdownOpen}
+ open={isDropdownOpen}
onOpenChange={(open) => {
- setDropdownOpen(open)
- if (open) {
- if (typeof projectRef !== 'undefined' && typeof sourceId !== 'undefined') {
- refetchPublications()
- }
- }
+ setIsDropdownOpen(open)
+ handleRefreshPublicationsOnOpen(open)
if (!open && field?.onBlur) {
+ setSearchTerm('')
field.onBlur()
}
}}
@@ -79,19 +80,25 @@ export const PublicationsComboBox = ({
<PopoverTrigger asChild>
<Button
variant="default"
- size="medium"
+ size="small"
className={cn(
'w-full [&>span]:w-full text-left',
!selectedPublication && 'text-foreground-muted'
)}
- iconRight={showLoadingState ? <Loader2 className="animate-spin" /> : <ChevronsUpDown />}
+ iconRight={<ChevronsUpDown />}
name={field.name}
onBlur={field.onBlur}
>
{selectedPublication || 'Select publication'}
</Button>
</PopoverTrigger>
- <PopoverContent sameWidthAsTrigger className="p-0" align="start">
+ <PopoverContent
+ sameWidthAsTrigger
+ className="p-0"
+ align="start"
+ side="bottom"
+ collisionPadding={16}
+ >
<Command>
<CommandInput
placeholder="Find publication..."
@@ -100,52 +107,41 @@ export const PublicationsComboBox = ({
onValueChange={setSearchTerm}
/>
<CommandList>
- <CommandEmpty>No publications found</CommandEmpty>
-
- {showLoadingState && (
- <div className="flex items-center gap-2 p-2 pb-0 text-center justify-center">
- <GenericSkeletonLoader className="w-full" />
- </div>
+ {!isLoadingStateVisible && !isErrorStateVisible && publications.length > 0 && (
+ <CommandEmpty>No publications found</CommandEmpty>
)}
- <CommandGroup>
- {publications.length === 0 && !showLoadingState && (
- <div className="text-foreground-lighter text-xs py-3 px-2 space-y-0.5">
- <p>No publications available</p>
- <p className="text-foreground-muted">Publications with no tables are hidden</p>
- </div>
- )}
- <ScrollArea
- className={publications.length > 7 ? 'h-[210px]' : ''}
- onWheel={(e) => e.stopPropagation()}
- >
- {publications.map((pub) => (
- <CommandItem
- key={pub.name}
- className="cursor-pointer flex items-center justify-between space-x-2 w-full"
- onSelect={() => {
- handlePublicationSelect(pub.name)
- }}
- onClick={() => {
- handlePublicationSelect(pub.name)
- }}
- >
- <span>{pub.name}</span>
- <div className="flex items-center gap-2">
- <Badge
- variant="default"
- className="rounded-full px-2 py-0.5 text-[10px] font-normal border border-border bg-surface-100"
- >
- {pub.tables.length} {pub.tables.length === 1 ? 'table' : 'tables'}
- </Badge>
+ <SelectionListState
+ isLoading={isLoadingStateVisible}
+ isError={isErrorStateVisible}
+ isEmpty={!isLoadingStateVisible && !isErrorStateVisible && publications.length === 0}
+ emptyLabel="No publications available"
+ errorLabel="Unable to load publications"
+ skeletonVariant="command"
+ />
+
+ {publications.length > 0 && (
+ <CommandGroup>
+ <ScrollArea
+ className={publications.length > 7 ? 'h-[210px]' : ''}
+ onWheel={(e) => e.stopPropagation()}
+ >
+ {publications.map((pub) => (
+ <CommandItem
+ key={pub.name}
+ className="cursor-pointer flex items-center justify-between space-x-2 w-full"
+ onSelect={() => handlePublicationSelect(pub.name)}
+ onClick={() => handlePublicationSelect(pub.name)}
+ >
+ <span>{pub.name}</span>
{selectedPublication === pub.name && (
<Check className="text-brand" strokeWidth={2} size={13} />
)}
- </div>
- </CommandItem>
- ))}
- </ScrollArea>
- </CommandGroup>
+ </CommandItem>
+ ))}
+ </ScrollArea>
+ </CommandGroup>
+ )}
<CommandSeparator />
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.test.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.test.tsx
index 4fdb27d3371..d02cb02066d 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.test.tsx
@@ -1,4 +1,4 @@
-import { screen } from '@testing-library/react'
+import { fireEvent, screen, waitFor } from '@testing-library/react'
import type { components } from 'api-types'
import { HttpResponse } from 'msw'
import { useForm } from 'react-hook-form'
@@ -10,8 +10,9 @@ import { TableCopySelection } from './TableCopySelection'
import { customRender } from '@/tests/lib/custom-render'
import { addAPIMock, type APIErrorBody } from '@/tests/lib/msw'
-type ReplicationSourcesResponse = components['schemas']['ReplicationSourcesResponse']
-type ReplicationPublicationsResponse = components['schemas']['ReplicationPublicationsResponse']
+type ReplicationSourcesResponse = components['schemas']['SourcesResponse_Output']
+type PublicationDetailsResponse = components['schemas']['PublicationDetailsResponse_Output']
+type ReadTablesResponse = components['schemas']['ReadTablesResponse_Output']
const mockSources: ReplicationSourcesResponse = {
sources: [
@@ -24,15 +25,20 @@ const mockSources: ReplicationSourcesResponse = {
],
}
-const mockPublications: ReplicationPublicationsResponse = {
- publications: [
- {
- name: 'analytics',
- tables: [
- { id: 101, schema: 'public', name: 'orders' },
- { id: 202, schema: 'billing', name: 'invoices' },
- ],
- },
+const mockPublicationDetails: PublicationDetailsResponse = {
+ name: 'analytics',
+ config: {
+ type: 'tables',
+ tables: [
+ { id: 101, schema: 'public', name: 'orders', columns: null, row_filter: null },
+ { id: 202, schema: 'billing', name: 'invoices', columns: null, row_filter: null },
+ ],
+ operations: ['insert'],
+ publish_via_partition_root: false,
+ },
+ tables: [
+ { id: 101, schema: 'public', name: 'orders', kind: 'table', partition_parent_id: null },
+ { id: 202, schema: 'billing', name: 'invoices', kind: 'table', partition_parent_id: null },
],
}
@@ -47,15 +53,15 @@ const mockSourcesEndpoint = () => {
const mockPublicationsSuccess = () => {
addAPIMock({
method: 'get',
- path: '/platform/replication/:ref/sources/:source_id/publications',
- response: () => HttpResponse.json<ReplicationPublicationsResponse>(mockPublications),
+ path: '/platform/replication/v2/:ref/sources/:source_id/publications/:publication_name',
+ response: () => HttpResponse.json<PublicationDetailsResponse>(mockPublicationDetails),
})
}
const mockPublicationsError = () => {
addAPIMock({
method: 'get',
- path: '/platform/replication/:ref/sources/:source_id/publications',
+ path: '/platform/replication/v2/:ref/sources/:source_id/publications/:publication_name',
response: () => HttpResponse.json<APIErrorBody>({ message: 'Boom' }, { status: 500 }),
})
}
@@ -63,11 +69,19 @@ const mockPublicationsError = () => {
const mockPublicationsPending = () => {
addAPIMock({
method: 'get',
- path: '/platform/replication/:ref/sources/:source_id/publications',
+ path: '/platform/replication/v2/:ref/sources/:source_id/publications/:publication_name',
response: () => new Promise<never>(() => {}),
})
}
+const mockTables = (tables: ReadTablesResponse['tables']) => {
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/v2/:ref/sources/:source_id/tables',
+ response: () => HttpResponse.json<ReadTablesResponse>({ tables }),
+ })
+}
+
const TableCopySelectionHarness = ({
editMode,
mode = 'include_all_tables',
@@ -98,11 +112,14 @@ describe('TableCopySelection', () => {
mockSourcesEndpoint()
mockPublicationsSuccess()
- customRender(<TableCopySelectionHarness editMode />)
+ customRender(
+ <TableCopySelectionHarness editMode mode="include_tables" selectedTableIds={['101']} />
+ )
expect(
- await screen.findByText(/will not sync existing rows again unless you restart them/)
+ await screen.findByText(/Changes only affect tables whose initial sync/)
).toBeInTheDocument()
+ expect(screen.getByText('Tables to include*')).toBeInTheDocument()
})
it('does not show the edit-mode explanation while creating a pipeline', async () => {
@@ -113,7 +130,7 @@ describe('TableCopySelection', () => {
await screen.findByText('All tables')
expect(
- screen.queryByText(/will not sync existing rows again unless you restart them/)
+ screen.queryByText(/Changes only affect tables whose initial sync/)
).not.toBeInTheDocument()
})
@@ -134,6 +151,38 @@ describe('TableCopySelection', () => {
'1 of 2 publication tables will run initial sync. Ongoing replication will still include every publication table.'
)
).toBeInTheDocument()
+ const trigger = screen
+ .getAllByRole('combobox')
+ .find((element) => element.textContent?.includes('public.orders'))!
+ expect(trigger).toHaveTextContent('public.orders')
+ expect(trigger).not.toHaveTextContent('101')
+ })
+
+ it('highlights configured initial-sync tables that left the publication without showing ids', async () => {
+ mockSourcesEndpoint()
+ mockPublicationsSuccess()
+ mockTables([
+ ...mockPublicationDetails.tables,
+ {
+ id: 999,
+ schema: 'Legacy',
+ name: 'ArchivedOrders',
+ kind: 'table',
+ partition_parent_id: null,
+ },
+ ])
+
+ customRender(
+ <TableCopySelectionHarness editMode mode="include_tables" selectedTableIds={['101', '999']} />
+ )
+
+ expect(await screen.findByText('Legacy.ArchivedOrders')).toBeInTheDocument()
+ expect(screen.getByText('Legacy.ArchivedOrders')).toHaveClass('text-destructive-600')
+ expect(screen.getByText('Some tables are no longer in the publication.')).toHaveClass(
+ 'text-destructive-600'
+ )
+ expect(screen.queryByText('No longer in publication')).not.toBeInTheDocument()
+ expect(document.body).not.toHaveTextContent('999')
})
it('blocks selection and explains when publication tables cannot be loaded', async () => {
@@ -148,7 +197,7 @@ describe('TableCopySelection', () => {
expect(screen.queryByText(/previously selected table/)).not.toBeInTheDocument()
})
- it('disables selective table choices while publication tables are loading', async () => {
+ it('shows a skeleton in the open selector while publication tables are loading', async () => {
mockSourcesEndpoint()
mockPublicationsPending()
@@ -156,9 +205,12 @@ describe('TableCopySelection', () => {
<TableCopySelectionHarness editMode mode="include_tables" selectedTableIds={['101', '999']} />
)
- const loadingLabel = await screen.findByText('Loading publication tables...')
- expect(loadingLabel).toBeInTheDocument()
- expect(loadingLabel.closest('button')).toBeDisabled()
+ const trigger = screen.getByRole('combobox', { name: 'Select initial sync tables' })
+ expect(trigger).toBeEnabled()
+ expect(trigger).not.toHaveTextContent(/loading/i)
+
+ fireEvent.click(trigger)
+ await waitFor(() => expect(document.querySelector('.shimmering-loader')).toBeInTheDocument())
expect(screen.queryByText(/previously selected table/)).not.toBeInTheDocument()
})
})
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.tsx
index 3aff0d660c3..1bd47525563 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.tsx
@@ -1,5 +1,4 @@
import { useParams } from 'common'
-import { useMemo } from 'react'
import { useWatch, type UseFormReturn } from 'react-hook-form'
import { FormControl, FormField, Select, SelectContent, SelectItem, SelectTrigger } from 'ui'
import { Admonition } from 'ui-patterns/Admonition'
@@ -7,9 +6,15 @@ import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { MultiSelector } from 'ui-patterns/multi-select'
import type { DestinationPanelSchemaType } from './DestinationForm.schema'
-import { getPublicationTableIds } from './DestinationForm.utils'
-import { useReplicationPublicationsQuery } from '@/data/replication/publications-query'
+import {
+ isMetadataListErrorVisible,
+ isMetadataListLoading,
+ isMetadataValueLoading,
+ useRefreshOnOpen,
+} from './useRefreshOnOpen'
+import { useReplicationPublicationQuery } from '@/data/replication/publication-query'
import { useReplicationSourceId } from '@/data/replication/sources-query'
+import { useReplicationTablesQuery } from '@/data/replication/tables-query'
interface TableCopySelectionProps {
form: UseFormReturn<DestinationPanelSchemaType>
@@ -38,25 +43,25 @@ export const TableCopySelection = ({ form, editMode }: TableCopySelectionProps)
})
const {
- data: publications = [],
- isPending: isLoadingPublications,
+ data: selectedPublication,
+ isPending,
+ isFetching,
isError: isErrorPublications,
- } = useReplicationPublicationsQuery({ projectRef, sourceId })
-
- // Only publication tables are ever selectable or displayed by name. A table
- // id is never resolved outside of the publication response — there's no
- // other source for a name to come from without a separate, source-wide
- // catalog fetch, which selective table-copy doesn't need.
- const publicationTables = useMemo(() => {
- const publication = publications.find(({ name }) => name === publicationName)
- return [...(publication?.tables ?? [])].sort((a, b) =>
- tableLabel(a).localeCompare(tableLabel(b))
- )
- }, [publicationName, publications])
+ isSuccess: isSuccessPublication,
+ refetch: refetchPublication,
+ } = useReplicationPublicationQuery({ projectRef, sourceId, publicationName })
+ const isLoadingPublicationTables =
+ !!publicationName && isMetadataValueLoading(isPending || isFetching, selectedPublication)
+ const { handleOpenChange: handleRefreshPublicationOnOpen } = useRefreshOnOpen({
+ isEnabled: !!publicationName,
+ refetch: refetchPublication,
+ })
- const publicationTableIds = useMemo(
- () => getPublicationTableIds(publications, publicationName),
- [publications, publicationName]
+ const publicationTables = [...(selectedPublication?.tables ?? [])].sort((a, b) =>
+ tableLabel(a).localeCompare(tableLabel(b))
+ )
+ const publicationTableIds = new Set(
+ (selectedPublication?.tables ?? []).map(({ id }) => String(id))
)
const tableLabelsById = new Map(
publicationTables.map((table) => [String(table.id), tableLabel(table)])
@@ -65,9 +70,16 @@ export const TableCopySelection = ({ form, editMode }: TableCopySelectionProps)
publicationTableIds.has(id)
).length
const staleSelectedCount =
- isLoadingPublications || isErrorPublications
+ !isSuccessPublication || isLoadingPublicationTables || isErrorPublications
? 0
: tableSyncCopyTableIds.filter((id) => !publicationTableIds.has(id)).length
+ const { data: sourceTables = [] } = useReplicationTablesQuery(
+ { projectRef, sourceId },
+ { enabled: staleSelectedCount > 0 }
+ )
+ const sourceTableLabelsById = new Map(
+ sourceTables.map((table) => [String(table.id), tableLabel(table)])
+ )
const tableCount = publicationTables.length
return (
@@ -84,7 +96,7 @@ export const TableCopySelection = ({ form, editMode }: TableCopySelectionProps)
<FormControl>
<Select value={field.value} onValueChange={field.onChange}>
<SelectTrigger>{INITIAL_SYNC_LABELS[field.value]}</SelectTrigger>
- <SelectContent>
+ <SelectContent side="bottom" collisionPadding={16}>
<SelectItem value="include_all_tables" className="[&>span]:top-2.5">
<p>All tables</p>
<p className="text-foreground-lighter">
@@ -116,15 +128,6 @@ export const TableCopySelection = ({ form, editMode }: TableCopySelectionProps)
)}
/>
- {editMode && (
- <Admonition type="note" title="Changes apply only before initial sync completes">
- <p className="leading-normal!">
- Tables that have completed initial sync will not sync existing rows again unless you
- restart them.
- </p>
- </Admonition>
- )}
-
{isErrorPublications && (
<Admonition type="warning" title="Publication tables could not be loaded">
<p className="leading-normal!">
@@ -140,9 +143,9 @@ export const TableCopySelection = ({ form, editMode }: TableCopySelectionProps)
render={({ field }) => (
<FormItemLayout
layout="horizontal"
- label={
- tableSyncCopyMode === 'skip_tables' ? 'Tables to exclude' : 'Tables to include'
- }
+ label={`${tableSyncCopyMode === 'skip_tables' ? 'Tables to exclude' : 'Tables to include'}${
+ editMode ? '*' : ''
+ }`}
description={
tableSyncCopyMode === 'skip_tables'
? `${selectedPublicationCount} of ${tableCount} publication tables will skip initial sync. Ongoing replication will still include every publication table.`
@@ -156,25 +159,36 @@ export const TableCopySelection = ({ form, editMode }: TableCopySelectionProps)
field.onChange(x)
}}
disabled={
- isLoadingPublications ||
- isErrorPublications ||
!publicationName ||
- tableCount === 0
+ (!isLoadingPublicationTables && !isErrorPublications && tableCount === 0)
}
+ onOpenChange={handleRefreshPublicationOnOpen}
>
<MultiSelector.Trigger
+ aria-label="Select initial sync tables"
badgeLimit={3}
- renderValue={(id) => tableLabelsById.get(id) ?? `Table ${id}`}
- label={
- isLoadingPublications
- ? 'Loading publication tables...'
- : publicationName
- ? 'Select tables...'
- : 'Select a publication first'
+ renderValue={(id) =>
+ tableLabelsById.get(id) ?? (
+ <span className="text-destructive-600">
+ {sourceTableLabelsById.get(id) ?? 'Previously selected table'}
+ </span>
+ )
}
+ label={publicationName ? 'Select tables...' : 'Select a publication first'}
/>
<MultiSelector.Content>
- <MultiSelector.List>
+ <MultiSelector.List
+ emptyLabel="No tables available"
+ error={isMetadataListErrorVisible(
+ isErrorPublications,
+ publicationTables.length
+ )}
+ errorLabel="Unable to load tables"
+ loading={isMetadataListLoading(
+ isPending || isFetching,
+ publicationTables.length
+ )}
+ >
{publicationTables.map((table) => (
<MultiSelector.Item key={table.id} value={String(table.id)}>
{tableLabel(table)}
@@ -186,26 +200,21 @@ export const TableCopySelection = ({ form, editMode }: TableCopySelectionProps)
</FormControl>
{staleSelectedCount > 0 && (
- <Admonition
- type="warning"
- className="mt-2"
- title={`${
- staleSelectedCount === 1
- ? 'A previously selected table is'
- : `${staleSelectedCount} previously selected tables are`
- }{' '}
- no longer in this publication.`}
- >
- <p className="leading-normal!">
- {staleSelectedCount === 1 ? 'It' : 'They'} will be excluded from this pipeline's
- initial sync settings when you save.
- </p>
- </Admonition>
+ <p className="mt-2 text-sm text-destructive-600">
+ Some tables are no longer in the publication.
+ </p>
)}
</FormItemLayout>
)}
/>
)}
+
+ {editMode && isSelectiveMode(tableSyncCopyMode) && (
+ <p className="text-sm text-foreground-lighter leading-normal">
+ * Changes only affect tables whose initial sync has not completed. Use Reset table to sync
+ existing rows again.
+ </p>
+ )}
</div>
)
}
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.test.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.test.tsx
index d6313a5772d..df407d369c8 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.test.tsx
@@ -1,13 +1,23 @@
-import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { fireEvent, screen, waitFor } from '@testing-library/react'
+import type { components } from 'api-types'
+import { HttpResponse } from 'msw'
import type { ButtonHTMLAttributes, PropsWithChildren } from 'react'
import type { UseFormReturn } from 'react-hook-form'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { DestinationPanelSchemaType } from './DestinationForm.schema'
import { DestinationForm } from './index'
+import { customRender } from '@/tests/lib/custom-render'
+import { addAPIMock } from '@/tests/lib/msw'
+
+type DestinationResponse = components['schemas']['DestinationResponse_Output']
+type PipelineResponse = components['schemas']['PipelineResponse_Output']
+type PublicationDetailsResponse = components['schemas']['PublicationDetailsResponse_Output']
+type PublicationNamesResponse = components['schemas']['ReadPublicationsResponse_Output']
+type ProjectSettingsResponse = components['schemas']['ProjectSettingsResponse']
+type SourcesResponse = components['schemas']['SourcesResponse_Output']
const mocks = vi.hoisted(() => ({
- refetchPublications: vi.fn(),
resetValidation: vi.fn(),
submitPipeline: vi.fn(),
validateConfiguration: vi.fn(),
@@ -26,14 +36,55 @@ const existingDestination = {
statusName: 'started',
}
-const sourcesData = { sources: [{ id: 42, name: 'project-ref' }] }
-const publications = [
- {
- name: 'analytics',
- tables: [{ id: 101, schema: 'public', name: 'orders' }],
+const sourcesData: SourcesResponse = {
+ sources: [
+ {
+ id: 42,
+ name: 'project-ref',
+ tenant_id: 'tenant',
+ config: { host: 'db.internal', name: 'postgres', port: 5432, username: 'postgres' },
+ },
+ ],
+}
+const publication: PublicationDetailsResponse = {
+ name: 'analytics',
+ config: {
+ type: 'tables',
+ tables: [{ id: 101, schema: 'public', name: 'orders', columns: null, row_filter: null }],
+ operations: ['insert', 'update', 'delete', 'truncate'],
+ publish_via_partition_root: false,
},
-]
-const destinationData = {
+ tables: [
+ {
+ id: 101,
+ schema: 'public',
+ name: 'orders',
+ kind: 'table',
+ partition_parent_id: null,
+ },
+ ],
+}
+const secondaryPublication: PublicationDetailsResponse = {
+ name: 'reporting',
+ config: {
+ type: 'tables',
+ tables: [{ id: 202, schema: 'public', name: 'invoices', columns: null, row_filter: null }],
+ operations: ['insert'],
+ publish_via_partition_root: false,
+ },
+ tables: [
+ {
+ id: 202,
+ schema: 'public',
+ name: 'invoices',
+ kind: 'table',
+ partition_parent_id: null,
+ },
+ ],
+}
+const destinationData: DestinationResponse = {
+ id: 7,
+ tenant_id: 'tenant',
name: 'Analytics',
config: {
big_query: {
@@ -43,48 +94,82 @@ const destinationData = {
},
},
}
-const pipelineData = {
+let pipelineTableIds = [101, 999]
+const getPipelineData = (): PipelineResponse => ({
+ id: 8,
+ tenant_id: 'tenant',
+ source_id: 42,
+ source_name: 'postgres',
+ destination_id: 7,
+ destination_name: 'Analytics',
+ replicator_id: 9,
config: {
publication_name: 'analytics',
- table_sync_copy: { type: 'include_tables' as const, table_ids: [101, 999] },
+ table_sync_copy: { type: 'include_tables', table_ids: pipelineTableIds },
batch: existingBatch,
max_table_sync_workers: 4,
max_copy_connections_per_table: 1,
},
+})
+const projectSettings: ProjectSettingsResponse = {
+ app_config: {
+ db_schema: 'public',
+ endpoint: 'project-ref.supabase.co',
+ storage_endpoint: 'project-ref.supabase.co/storage/v1',
+ },
+ cloud_provider: 'AWS',
+ db_dns_name: 'db.project-ref.supabase.co',
+ db_host: 'db.project-ref.supabase.co',
+ db_ip_addr_config: 'ipv4',
+ db_name: 'postgres',
+ db_port: 5432,
+ db_user: 'postgres',
+ inserted_at: '2026-08-28T00:00:00Z',
+ name: 'project-ref',
+ ref: 'project-ref',
+ region: 'ap-southeast-1',
+ ssl_enforced: true,
+ status: 'ACTIVE_HEALTHY',
}
-const projectSettings = { region: 'ap-southeast-1' }
-vi.mock('common', () => ({ useParams: () => ({ ref: 'project-ref' }) }))
+vi.mock('common', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('common')>()
+ return { ...actual, useParams: () => ({ ref: 'project-ref' }) }
+})
vi.mock('framer-motion', () => ({
AnimatePresence: ({ children }: PropsWithChildren) => children,
motion: { div: ({ children }: PropsWithChildren) => <div>{children}</div> },
}))
-vi.mock('ui', () => ({
- Button: ({
- children,
- loading: _loading,
- ...props
- }: ButtonHTMLAttributes<HTMLButtonElement> & { loading?: boolean }) => (
- <button tabIndex={0} {...props}>
- {children}
- </button>
- ),
- cn: (...args: unknown[]) => args.filter(Boolean).join(' '),
- DialogSectionSeparator: () => null,
- Form: ({ children }: PropsWithChildren) => children,
- Select: ({ children }: PropsWithChildren) => <div>{children}</div>,
- SelectContent: ({ children }: PropsWithChildren) => <div>{children}</div>,
- SelectItem: ({ children }: PropsWithChildren) => <div>{children}</div>,
- SelectTrigger: ({ children }: PropsWithChildren) => <div>{children}</div>,
- SelectValue: () => null,
- SheetFooter: ({ children }: PropsWithChildren) => <div>{children}</div>,
- SheetSection: ({ children }: PropsWithChildren) => <div>{children}</div>,
- Tooltip: ({ children }: PropsWithChildren) => <div>{children}</div>,
- TooltipContent: ({ children }: PropsWithChildren) => <div>{children}</div>,
- TooltipTrigger: ({ children }: PropsWithChildren) => <span>{children}</span>,
-}))
+vi.mock('ui', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('ui')>()
+
+ return {
+ ...actual,
+ Button: ({
+ children,
+ loading: _loading,
+ ...props
+ }: ButtonHTMLAttributes<HTMLButtonElement> & { loading?: boolean }) => (
+ <button tabIndex={0} {...props}>
+ {children}
+ </button>
+ ),
+ DialogSectionSeparator: () => null,
+ Form: ({ children }: PropsWithChildren) => children,
+ Select: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ SelectContent: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ SelectItem: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ SelectTrigger: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ SelectValue: () => null,
+ SheetFooter: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ SheetSection: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ Tooltip: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ TooltipContent: ({ children }: PropsWithChildren) => <div>{children}</div>,
+ TooltipTrigger: ({ children }: PropsWithChildren) => <span>{children}</span>,
+ }
+})
vi.mock('ui-patterns/Admonition', () => ({
Admonition: ({ children }: PropsWithChildren) => <div>{children}</div>,
@@ -119,45 +204,31 @@ vi.mock('@/hooks/misc/useCheckPermissions', () => ({
useAsyncCheckPermissions: () => ({ can: false }),
}))
-vi.mock('@/data/api-keys/api-keys-query', () => ({ useAPIKeys: () => ({ data: undefined }) }))
-
-vi.mock('@/data/config/project-settings-v2-query', () => ({
- useProjectSettingsV2Query: () => ({ data: projectSettings }),
-}))
-
-vi.mock('@/data/replication/sources-query', () => ({
- useReplicationSourcesQuery: () => ({ data: sourcesData }),
- useReplicationSourceId: () => sourcesData.sources[0]?.id,
-}))
-
-vi.mock('@/data/replication/publications-query', () => ({
- useReplicationPublicationsQuery: () => ({
- data: publications,
- isPending: false,
- isError: false,
- isSuccess: true,
- refetch: mocks.refetchPublications,
- }),
-}))
-
-vi.mock('@/data/replication/destination-by-id-query', () => ({
- useReplicationDestinationByIdQuery: () => ({
- data: destinationData,
- isError: false,
- isSuccess: true,
- }),
-}))
-
-vi.mock('@/data/replication/pipeline-by-id-query', () => ({
- useReplicationPipelineByIdQuery: () => ({
- data: pipelineData,
- isError: false,
- isSuccess: true,
- }),
-}))
-
vi.mock('./DestinationNameInput', () => ({ DestinationNameInput: () => null }))
-vi.mock('./PublicationSelection', () => ({ PublicationSelection: () => null }))
+vi.mock('./PublicationSelection', () => ({
+ PublicationSelection: ({ form }: { form: UseFormReturn<DestinationPanelSchemaType> }) => (
+ <button
+ type="button"
+ tabIndex={0}
+ onClick={() => {
+ form.setValue('publicationName', 'reporting', {
+ shouldDirty: true,
+ shouldValidate: true,
+ })
+ form.setValue('tableSyncCopyMode', 'include_tables', {
+ shouldDirty: true,
+ shouldValidate: true,
+ })
+ form.setValue('tableSyncCopyTableIds', ['202'], {
+ shouldDirty: true,
+ shouldValidate: true,
+ })
+ }}
+ >
+ Switch publication and select table
+ </button>
+ ),
+}))
vi.mock('./TableCopySelection', () => ({
TableCopySelection: ({ form }: { form: UseFormReturn<DestinationPanelSchemaType> }) => (
<div>{form.formState.errors.tableSyncCopyTableIds?.message}</div>
@@ -181,15 +252,52 @@ vi.mock('@/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketS
describe('DestinationForm edit submission', () => {
beforeEach(() => {
vi.clearAllMocks()
- pipelineData.config.table_sync_copy.table_ids = [101, 999]
+ pipelineTableIds = [101, 999]
mocks.submitPipeline.mockResolvedValue(undefined)
mocks.validateConfiguration.mockResolvedValue({ canContinue: true, warnings: [] })
+
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/:ref/sources',
+ response: () => HttpResponse.json<SourcesResponse>(sourcesData),
+ })
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/v2/:ref/sources/:source_id/publications',
+ response: () =>
+ HttpResponse.json<PublicationNamesResponse>({
+ publications: [{ name: publication.name }, { name: secondaryPublication.name }],
+ }),
+ })
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/v2/:ref/sources/:source_id/publications/:publication_name',
+ response: ({ params }) =>
+ HttpResponse.json<PublicationDetailsResponse>(
+ params.publication_name === secondaryPublication.name ? secondaryPublication : publication
+ ),
+ })
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/:ref/destinations/:destination_id',
+ response: () => HttpResponse.json<DestinationResponse>(destinationData),
+ })
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/:ref/pipelines/:pipeline_id',
+ response: () => HttpResponse.json<PipelineResponse>(getPipelineData()),
+ })
+ addAPIMock({
+ method: 'get',
+ path: '/platform/projects/:ref/settings',
+ response: () => HttpResponse.json<ProjectSettingsResponse>(projectSettings),
+ })
})
it('bypasses create validation and submits the pruned table policy with the existing batch', async () => {
const onClose = vi.fn()
- render(
+ customRender(
<DestinationForm
selectedType="BigQuery"
visible
@@ -198,7 +306,9 @@ describe('DestinationForm edit submission', () => {
/>
)
- fireEvent.click(screen.getByRole('button', { name: 'Apply and restart pipeline' }))
+ const submitButton = screen.getByRole('button', { name: 'Apply and restart pipeline' })
+ await waitFor(() => expect(submitButton).toBeEnabled())
+ fireEvent.click(submitButton)
await waitFor(() => expect(mocks.submitPipeline).toHaveBeenCalledOnce())
@@ -216,9 +326,9 @@ describe('DestinationForm edit submission', () => {
})
it('rejects an edit when every selected table has left the publication', async () => {
- pipelineData.config.table_sync_copy.table_ids = [999]
+ pipelineTableIds = [999]
- render(
+ customRender(
<DestinationForm
selectedType="BigQuery"
visible
@@ -227,10 +337,47 @@ describe('DestinationForm edit submission', () => {
/>
)
- fireEvent.click(screen.getByRole('button', { name: 'Apply and restart pipeline' }))
+ const submitButton = screen.getByRole('button', { name: 'Apply and restart pipeline' })
+ await waitFor(() => expect(submitButton).toBeEnabled())
+ fireEvent.click(submitButton)
expect(await screen.findByText('Select at least one table')).toBeInTheDocument()
expect(mocks.validateConfiguration).not.toHaveBeenCalled()
expect(mocks.submitPipeline).not.toHaveBeenCalled()
})
+
+ it('submits against the newly loaded publication immediately after switching', async () => {
+ const onClose = vi.fn()
+
+ customRender(
+ <DestinationForm
+ selectedType="BigQuery"
+ visible
+ existingDestination={existingDestination}
+ onClose={onClose}
+ />
+ )
+
+ await waitFor(() =>
+ expect(screen.getByRole('button', { name: 'Apply and restart pipeline' })).toBeEnabled()
+ )
+ fireEvent.click(screen.getByRole('button', { name: 'Switch publication and select table' }))
+
+ const submitButton = screen.getByRole('button', { name: 'Apply and restart pipeline' })
+ await waitFor(() => expect(submitButton).toBeEnabled())
+ fireEvent.click(submitButton)
+
+ await waitFor(() => expect(mocks.submitPipeline).toHaveBeenCalledOnce())
+ expect(mocks.submitPipeline).toHaveBeenCalledWith({
+ data: expect.objectContaining({
+ publicationName: 'reporting',
+ tableSyncCopyMode: 'include_tables',
+ tableSyncCopyTableIds: ['202'],
+ }),
+ existingDestination,
+ existingBatch,
+ onSuccess: expect.any(Function),
+ onClose,
+ })
+ })
})
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx
index b4f8f25a13f..7f6202b1423 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx
@@ -54,7 +54,8 @@ import { useAPIKeys } from '@/data/api-keys/api-keys-query'
import { useProjectSettingsV2Query } from '@/data/config/project-settings-v2-query'
import { useReplicationDestinationByIdQuery } from '@/data/replication/destination-by-id-query'
import { useReplicationPipelineByIdQuery } from '@/data/replication/pipeline-by-id-query'
-import { useReplicationPublicationsQuery } from '@/data/replication/publications-query'
+import { useReplicationPublicationNamesQuery } from '@/data/replication/publication-names-query'
+import { useReplicationPublicationQuery } from '@/data/replication/publication-query'
import { useReplicationSourceId } from '@/data/replication/sources-query'
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
@@ -121,11 +122,8 @@ export const DestinationForm = ({
const sourceId = useReplicationSourceId({ projectRef })
- const {
- data: publications = [],
- isSuccess: isSuccessPublications,
- refetch: refetchPublications,
- } = useReplicationPublicationsQuery({ projectRef, sourceId })
+ const { data: publicationNames = [], isSuccess: isSuccessPublicationNames } =
+ useReplicationPublicationNamesQuery({ projectRef, sourceId })
const {
data: destinationData,
@@ -182,9 +180,8 @@ export const DestinationForm = ({
}),
[destinationData, pipelineData, catalogToken, projectSettings, projectRef, editMode]
)
-
const form = useForm<z.infer<typeof FormSchema>>({
- mode: 'onChange',
+ mode: 'onSubmit',
reValidateMode: 'onChange',
resolver: zodResolver(
FormSchema.superRefine((data, ctx) => {
@@ -196,18 +193,10 @@ export const DestinationForm = ({
})
}
- const selectedPublicationTableIds = pruneStaleSelectedTableIds({
- mode: data.tableSyncCopyMode,
- selectedTableIds: data.tableSyncCopyTableIds,
- publications,
- publicationName: data.publicationName,
- })
-
if (
- isSuccessPublications &&
(data.tableSyncCopyMode === 'include_tables' ||
data.tableSyncCopyMode === 'skip_tables') &&
- selectedPublicationTableIds.length === 0
+ data.tableSyncCopyTableIds.length === 0
) {
addRequiredFieldError('tableSyncCopyTableIds', 'Select at least one table')
}
@@ -253,10 +242,13 @@ export const DestinationForm = ({
const { isDirty } = form.formState
const publicationName = useWatch({ control: form.control, name: 'publicationName' })
+ const { data: selectedPublication, isSuccess: isSuccessPublication } =
+ useReplicationPublicationQuery({ projectRef, sourceId, publicationName })
- const publicationNames = useMemo(() => publications?.map((pub) => pub.name) ?? [], [publications])
const isSelectedPublicationMissing =
- isSuccessPublications && !!publicationName && !publicationNames.includes(publicationName)
+ isSuccessPublicationNames &&
+ !!publicationName &&
+ !publicationNames.some(({ name }) => name === publicationName)
const allValidationFailures = [...destinationValidationFailures, ...pipelineValidationFailures]
const hasValidationFailures = allValidationFailures.some((f) => f.failure_type === 'critical')
@@ -272,16 +264,16 @@ export const DestinationForm = ({
}),
[pendingFormValues]
)
- const pendingPublicationTables = useMemo(
- () =>
- publications.find(({ name }) => name === pendingFormValues?.publicationName)?.tables ?? [],
- [pendingFormValues?.publicationName, publications]
- )
+ const pendingPublicationTables =
+ selectedPublication && selectedPublication.name === pendingFormValues?.publicationName
+ ? selectedPublication.tables
+ : []
const isSubmitDisabled =
isSaving ||
!isExistingConfigReady ||
- !isSuccessPublications ||
+ !isSuccessPublicationNames ||
+ (!!publicationName && !isSuccessPublication) ||
isSelectedPublicationMissing ||
(!editMode && hasNoAvailableDestinations)
@@ -307,7 +299,7 @@ export const DestinationForm = ({
}
const onSubmit = async (rawData: z.infer<typeof FormSchema>) => {
- if (!isSuccessPublications) {
+ if (!isSuccessPublication || !selectedPublication) {
toast.error('Publication tables are unavailable. Refresh and try again.')
return
}
@@ -319,11 +311,19 @@ export const DestinationForm = ({
tableSyncCopyTableIds: pruneStaleSelectedTableIds({
mode: rawData.tableSyncCopyMode,
selectedTableIds: rawData.tableSyncCopyTableIds,
- publications,
+ publication: selectedPublication,
publicationName: rawData.publicationName,
}),
}
+ if (
+ (data.tableSyncCopyMode === 'include_tables' || data.tableSyncCopyMode === 'skip_tables') &&
+ data.tableSyncCopyTableIds.length === 0
+ ) {
+ form.setError('tableSyncCopyTableIds', { message: 'Select at least one table' })
+ return
+ }
+
if (selectedType === 'BigQuery') {
const jsonIssue = getBigQueryValidationIssues(data, { secretsOptional: editMode }).find(
(issue) => issue.message === BIGQUERY_SERVICE_ACCOUNT_JSON_MESSAGE
@@ -427,12 +427,6 @@ export const DestinationForm = ({
}
}, [visible, defaultValues, form, isDirty, resetValidation])
- useEffect(() => {
- if (visible && projectRef && sourceId) {
- refetchPublications()
- }
- }, [visible, projectRef, sourceId, refetchPublications])
-
return (
<>
<SheetSection className="grow overflow-auto px-0 py-0">
@@ -544,6 +538,10 @@ export const DestinationForm = ({
visible={publicationPanelVisible}
onClose={(newPublication?: string) => {
if (newPublication) {
+ form.setValue('tableSyncCopyMode', 'include_all_tables', {
+ shouldDirty: true,
+ shouldValidate: true,
+ })
form.setValue('tableSyncCopyTableIds', [], {
shouldDirty: true,
shouldValidate: true,
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx
index a84bf5b1ae4..178ddfbab7d 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx
@@ -8,9 +8,9 @@ import { DestinationTypeSelection } from './DestinationTypeSelection'
import { customRender } from '@/tests/lib/custom-render'
import { addAPIMock } from '@/tests/lib/msw'
-type ReplicationSourcesResponse = components['schemas']['ReplicationSourcesResponse']
-type ReplicationPipelinesResponse = components['schemas']['ReplicationPipelinesResponse']
-type ReplicationDestinationResponse = components['schemas']['ReplicationDestinationResponse']
+type ReplicationSourcesResponse = components['schemas']['SourcesResponse_Output']
+type ReplicationPipelinesResponse = components['schemas']['PipelinesResponse_Output']
+type ReplicationDestinationResponse = components['schemas']['DestinationResponse_Output']
mockAnimationsApi()
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
index 9c7c902b7b7..8ce8a4b5167 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
@@ -157,7 +157,7 @@ export const DestinationTypeSelection = () => {
>
<Select
disabled={editMode}
- value={destinationType ?? undefined}
+ value={destinationType ?? ''}
onValueChange={(value) => setDestinationType(value as DestinationType)}
>
<SelectTrigger className="h-auto py-2">
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationRow.test.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationRow.test.tsx
index f0c81baf936..0ea932a1868 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationRow.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationRow.test.tsx
@@ -8,14 +8,13 @@ import { DestinationRow } from './DestinationRow'
import { customRender } from '@/tests/lib/custom-render'
import { addAPIMock, type APIErrorBody } from '@/tests/lib/msw'
-type ReplicationPipelinesResponse = components['schemas']['ReplicationPipelinesResponse']
-type ReplicationDestinationResponse = components['schemas']['ReplicationDestinationResponse']
-type ReplicationSourcesResponse = components['schemas']['ReplicationSourcesResponse']
-type ReplicationPipelineStatusResponse = components['schemas']['ReplicationPipelineStatusResponse']
+type ReplicationPipelinesResponse = components['schemas']['PipelinesResponse_Output']
+type ReplicationDestinationResponse = components['schemas']['DestinationResponse_Output']
+type ReplicationSourcesResponse = components['schemas']['SourcesResponse_Output']
+type ReplicationPipelineStatusResponse = components['schemas']['PipelineStatusResponse_Output']
type ReplicationPipelineReplicationStatusResponse =
- components['schemas']['ReplicationPipelineReplicationStatusResponse']
-type ReplicationPipelineVersionResponse =
- components['schemas']['ReplicationPipelineVersionResponse']
+ components['schemas']['PipelineReplicationStatusResponse_Output']
+type ReplicationPipelineVersionResponse = components['schemas']['PipelineVersionResponse_Output']
// Tooltip/Popover descendants use Web Animations
mockAnimationsApi()
diff --git a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
index 50155052125..44ebfb4f35b 100644
--- a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
@@ -139,7 +139,6 @@ export const Destinations = () => {
destinations.length === 0 &&
pipelines.length === 0
- const isLoading = isDestinationsLoading
const isLocalETLNotSetUp = checkLocalETLNotSetUp(destinationsError)
const hasErrorsFetchingData = !isLocalETLNotSetUp && isDestinationsError
@@ -275,7 +274,7 @@ export const Destinations = () => {
<AlertError error={destinationsError} subject="Failed to retrieve destinations" />
)}
- {isLoading ? (
+ {isDestinationsLoading ? (
<GenericSkeletonLoader />
) : hasDestinations ? (
<Card>
@@ -302,22 +301,24 @@ export const Destinations = () => {
<DestinationRow key={destination.id} destinationId={destination.id} />
))}
- {!isLoading && filteredDestinations.length === 0 && hasDestinations && (
- <TableRow>
- <TableCell colSpan={6}>
- <p>No results found</p>
- <p className="text-foreground-light">
- Your search for "{filterString}" did not return any results.
- </p>
- </TableCell>
- </TableRow>
- )}
+ {!isDestinationsLoading &&
+ filteredDestinations.length === 0 &&
+ hasDestinations && (
+ <TableRow>
+ <TableCell colSpan={6}>
+ <p>No results found</p>
+ <p className="text-foreground-light">
+ Your search for "{filterString}" did not return any results.
+ </p>
+ </TableCell>
+ </TableRow>
+ )}
</TableBody>
</Table>
</CardContent>
</Card>
) : (
- !isLoading &&
+ !isDestinationsLoading &&
!hasErrorsFetchingData && (
<EmptyStatePresentational
icon={Workflow}
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx
index 4077877df22..8d1b9ed8111 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx
@@ -486,7 +486,9 @@ export const ReplicationPipelineStatus = () => {
const errorReason =
isErrorState && 'reason' in table.state ? table.state.reason : undefined
const errorSolution =
- isErrorState && 'solution' in table.state ? table.state.solution : undefined
+ isErrorState && 'solution' in table.state
+ ? (table.state.solution ?? undefined)
+ : undefined
return (
<TableReplicationRow
key={table.id}
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.types.ts b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.types.ts
index 6b9a80dc8a5..6ecd8904f36 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.types.ts
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.types.ts
@@ -9,15 +9,15 @@ export type SlotWalStatus = 'reserved' | 'extended' | 'unreserved' | 'lost' | 'u
export type SlotLagMetrics = {
active: boolean
- wal_status?: SlotWalStatus
+ wal_status?: SlotWalStatus | null
restart_lsn_bytes: number
confirmed_flush_lsn_bytes: number
// null means Postgres reports unlimited slot WAL retention.
- safe_wal_size_bytes: number | null
- write_lag?: number
- flush_lag?: number
+ safe_wal_size_bytes?: number | null
+ write_lag?: number | null
+ flush_lag?: number | null
// Milliseconds since the destination last sent feedback. Present even when write/flush lag are not.
- reply_time_lag?: number
+ reply_time_lag?: number | null
}
// Numeric metrics rendered as value tiles (kept separate from the non-numeric slot fields above).
@@ -41,6 +41,6 @@ export type TableState = {
| { name: 'copying_table' }
| { name: 'copied_table' }
| { name: 'following_wal'; lag: number }
- | { name: 'error'; reason: string; solution?: string; retry_policy: RetryPolicy }
- table_sync_lag?: SlotLagMetrics
+ | { name: 'error'; reason: string; solution?: string | null; retry_policy: RetryPolicy }
+ table_sync_lag?: SlotLagMetrics | null
}
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.utils.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.utils.tsx
index 293251ae5da..6d7dfb5edf7 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.utils.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/ReplicationPipelineStatus.utils.tsx
@@ -190,7 +190,7 @@ export const WAL_STATUS_META: Record<SlotWalStatus, WalStatusMeta> = {
}
// Postgres reports no WAL status (restart_lsn is null) as "unknown" too, so fall back to it.
-export const getWalStatusMeta = (status?: SlotWalStatus): WalStatusMeta =>
+export const getWalStatusMeta = (status?: SlotWalStatus | null): WalStatusMeta =>
WAL_STATUS_META[status ?? 'unknown']
// Legend entries from healthiest to most severe, ending with the unknown/unavailable case.
@@ -202,7 +202,7 @@ export const WAL_STATUS_LEGEND: WalStatusMeta[] = [
WAL_STATUS_META.unknown,
]
-export const getWalStatusSeverity = (status?: SlotWalStatus): LagSeverity =>
+export const getWalStatusSeverity = (status?: SlotWalStatus | null): LagSeverity =>
getWalStatusMeta(status).severity
// Slot-loss risk from how much of the slot's WAL budget has been consumed, rather than fixed byte
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotLagMetrics.test.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotLagMetrics.test.tsx
new file mode 100644
index 00000000000..859a6454129
--- /dev/null
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotLagMetrics.test.tsx
@@ -0,0 +1,27 @@
+import { screen } from '@testing-library/react'
+import { describe, expect, it } from 'vitest'
+
+import { SlotLagMetricsList } from './SlotLagMetrics'
+import { customRender } from '@/tests/lib/custom-render'
+
+const baseMetrics = {
+ active: true,
+ confirmed_flush_lsn_bytes: 0,
+ restart_lsn_bytes: 0,
+ reply_time_lag: 0,
+}
+
+describe('SlotLagMetricsList', () => {
+ it('renders null safe WAL size as unlimited retention', () => {
+ customRender(<SlotLagMetricsList metrics={{ ...baseMetrics, safe_wal_size_bytes: null }} />)
+
+ expect(screen.getByText('WAL retention remaining')).toBeInTheDocument()
+ expect(screen.getByText('Unlimited')).toBeInTheDocument()
+ })
+
+ it('formats a numeric safe WAL size normally', () => {
+ customRender(<SlotLagMetricsList metrics={{ ...baseMetrics, safe_wal_size_bytes: 1024 }} />)
+
+ expect(screen.getByText('1 KB')).toBeInTheDocument()
+ })
+})
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotStatus.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotStatus.tsx
index 3bbeada6407..bd2a54f913d 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotStatus.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotStatus.tsx
@@ -36,7 +36,7 @@ export const SlotStatusBadge = ({
status,
context = 'pipeline',
}: {
- status?: SlotWalStatus
+ status?: SlotWalStatus | null
context?: SlotStatusContext
}) => {
const meta = getWalStatusMeta(status)
diff --git a/apps/studio/components/interfaces/Database/Replication/RestartCostEstimate.render.test.tsx b/apps/studio/components/interfaces/Database/Replication/RestartCostEstimate.render.test.tsx
index e9ce2deb6ce..e7ba0420927 100644
--- a/apps/studio/components/interfaces/Database/Replication/RestartCostEstimate.render.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/RestartCostEstimate.render.test.tsx
@@ -7,7 +7,7 @@ import { RestartCostEstimate } from './RestartCostEstimate'
import { customRender } from '@/tests/lib/custom-render'
import { addAPIMock } from '@/tests/lib/msw'
-type CostEstimateResponse = components['schemas']['CostEstimateResponse']
+type CostEstimateResponse = components['schemas']['CostEstimateResponse_Output']
describe('RestartCostEstimate', () => {
it('does not request an estimate when every target skips initial sync', () => {
diff --git a/apps/studio/components/interfaces/Database/Replication/RestartTableDialog.tsx b/apps/studio/components/interfaces/Database/Replication/RestartTableDialog.tsx
index 771e6eb034c..c9cb1f8b4c5 100644
--- a/apps/studio/components/interfaces/Database/Replication/RestartTableDialog.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/RestartTableDialog.tsx
@@ -21,7 +21,7 @@ interface RestartTableDialogProps {
open: boolean
onOpenChange: (open: boolean) => void
table: ReplicationTableIdentity
- tableSyncCopy?: TableSyncCopyConfig
+ tableSyncCopy?: TableSyncCopyConfig | null
sourceId?: number
publicationName?: string
pipelineStatusName?: PipelineStatusName
diff --git a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/NamespaceWithTables.utils.ts b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/NamespaceWithTables.utils.ts
index be1c876dc6e..1d88e707d40 100644
--- a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/NamespaceWithTables.utils.ts
+++ b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/NamespaceWithTables.utils.ts
@@ -1,12 +1,12 @@
import { snakeCase } from 'lodash'
-import { ReplicationPublication } from '@/data/replication/publications-query'
+import { ReplicationPublicationData } from '@/data/replication/publication-query'
export const inferPostgresTableFromNamespaceTable = ({
publication,
tableName,
}: {
- publication?: ReplicationPublication
+ publication?: ReplicationPublicationData
tableName: string
}) => {
return publication?.tables.find((x) => tableName === snakeCase(`${x.schema}.${x.name}_changelog`))
diff --git a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/TableRowComponent.tsx b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/TableRowComponent.tsx
index 7b68b016af4..c0fcf501e1c 100644
--- a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/TableRowComponent.tsx
+++ b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/NamespaceWithTables/TableRowComponent.tsx
@@ -1,3 +1,4 @@
+import { components } from 'api-types'
import { useParams } from 'common'
import { SqlEditor, TableEditor } from 'icons'
import { uniq } from 'lodash'
@@ -120,18 +121,23 @@ export const TableRowComponent = ({ table, schema, namespace }: TableRowComponen
if (!publication) return toast.error('Unable to find existing publication')
if (!pipeline) return toast.error('Unable to find existing pipeline')
+ if (publication.config.type !== 'tables') {
+ return toast.error('Publication is not configured with an explicit table list')
+ }
+
try {
setIsUpdatingReplication(true)
// [Joshen ALPHA] Assumption here is that all the namespace tables have _changelog as suffix
// May need to update if that assumption falls short (e.g for those dealing with iceberg APIs directly)
- const updatedTables = publication.tables
- .filter((x) => table.name !== getNamespaceTableNameFromPostgresTableName(x))
- .map(({ schema, name }) => ({ schema, name }))
+ const removedTableId = publication.tables.find(
+ (x) => table.name === getNamespaceTableNameFromPostgresTableName(x)
+ )?.id
+ const updatedTables = publication.config.tables.filter((x) => x.id !== removedTableId)
await updatePublication({
projectRef,
sourceId,
publicationName: publication.name,
- tables: updatedTables,
+ config: { ...publication.config, tables: updatedTables },
})
await startPipeline({ projectRef, pipelineId: pipeline.id })
setShowStopReplicationModal(false)
@@ -155,17 +161,26 @@ export const TableRowComponent = ({ table, schema, namespace }: TableRowComponen
(t) => getNamespaceTableNameFromPostgresTableName(t) === table.name
)
if (!pgTable) return toast.error('Unable to find corresponding Postgres table')
+ if (publication.config.type !== 'tables') {
+ return toast.error('Publication is not configured with an explicit table list')
+ }
try {
setIsUpdatingReplication(true)
- const updatedTables = publication.tables
- .map(({ schema, name }) => ({ schema, name }))
- .concat([{ schema: pgTable.schema, name: pgTable.name }])
+ const currentTables: Extract<
+ components['schemas']['PutPublicationBody'],
+ { type: 'tables' }
+ >['tables'] = publication.config.tables.map(({ id, columns, row_filter }) => ({
+ id,
+ columns,
+ row_filter,
+ }))
+ const updatedTables = currentTables.concat([{ id: pgTable.id }])
await updatePublication({
projectRef,
sourceId,
publicationName: publication.name,
- tables: updatedTables,
+ config: { ...publication.config, tables: updatedTables },
})
await startPipeline({ projectRef, pipelineId: pipeline.id })
setShowStartReplicationModal(false)
diff --git a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/useAnalyticsBucketAssociatedEntities.tsx b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/useAnalyticsBucketAssociatedEntities.tsx
index aeb766bfbb3..bcf9737d16b 100644
--- a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/useAnalyticsBucketAssociatedEntities.tsx
+++ b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/useAnalyticsBucketAssociatedEntities.tsx
@@ -11,7 +11,7 @@ import { useDeleteDestinationPipelineMutation } from '@/data/replication/delete-
import { useReplicationDestinationsQuery } from '@/data/replication/destinations-query'
import { useReplicationPipelinesQuery } from '@/data/replication/pipelines-query'
import { useDeletePublicationMutation } from '@/data/replication/publication-delete-mutation'
-import { useReplicationPublicationsQuery } from '@/data/replication/publications-query'
+import { useReplicationPublicationQuery } from '@/data/replication/publication-query'
import { useReplicationSourcesQuery } from '@/data/replication/sources-query'
import { useS3AccessKeyDeleteMutation } from '@/data/storage/s3-access-key-delete-mutation'
import { useStorageCredentialsQuery } from '@/data/storage/s3-access-key-query'
@@ -51,12 +51,10 @@ export const useAnalyticsBucketAssociatedEntities = (
)
const sourceId = sourcesData?.sources.find((s) => s.name === projectRef)?.id
- const { data: publications = [] } = useReplicationPublicationsQuery(
- { projectRef, sourceId },
- { enabled: options.enabled }
- )
- const publication = publications.find(
- (p) => p.name === getAnalyticsBucketPublicationName(bucketId ?? '')
+ const publicationName = bucketId ? getAnalyticsBucketPublicationName(bucketId) : undefined
+ const { data: publication } = useReplicationPublicationQuery(
+ { projectRef, sourceId, publicationName },
+ { enabled: options.enabled && publicationName !== undefined }
)
const { data: destinationsData } = useReplicationDestinationsQuery({ projectRef })
@@ -66,7 +64,9 @@ export const useAnalyticsBucketAssociatedEntities = (
)
const { data: pipelines } = useReplicationPipelinesQuery({ projectRef })
- const pipeline = pipelines?.pipelines.find((x) => x.config.publication_name === publication?.name)
+ const pipeline = pipelines?.pipelines.find(
+ (pipeline) => pipeline.config.publication_name === publicationName
+ )
return {
icebergWrapper,
diff --git a/apps/studio/data/replication/constants.ts b/apps/studio/data/replication/constants.ts
new file mode 100644
index 00000000000..4467142fe03
--- /dev/null
+++ b/apps/studio/data/replication/constants.ts
@@ -0,0 +1 @@
+export const REPLICATION_METADATA_FRESHNESS_MS = 5 * 60 * 1000
diff --git a/apps/studio/data/replication/destination-by-id-query.ts b/apps/studio/data/replication/destination-by-id-query.ts
index 214a7eba453..ee7567d6b2b 100644
--- a/apps/studio/data/replication/destination-by-id-query.ts
+++ b/apps/studio/data/replication/destination-by-id-query.ts
@@ -24,7 +24,7 @@ async function fetchReplicationDestinationById(
return data
}
-export type ReplicationDestinationByIdData = components['schemas']['ReplicationDestinationResponse']
+export type ReplicationDestinationByIdData = components['schemas']['DestinationResponse_Output']
export const useReplicationDestinationByIdQuery = <TData = ReplicationDestinationByIdData>(
{ projectRef, destinationId }: ReplicationDestinationByIdParams,
diff --git a/apps/studio/data/replication/keys.ts b/apps/studio/data/replication/keys.ts
index c61f4d1a589..172d161b336 100644
--- a/apps/studio/data/replication/keys.ts
+++ b/apps/studio/data/replication/keys.ts
@@ -4,8 +4,26 @@ export const replicationKeys = {
['projects', projectRef, 'destinations'] as const,
destinationById: (projectRef: string | undefined, destinationId: number | undefined | null) =>
['projects', projectRef, 'destinations', destinationId] as const,
+ // Prefix shared by publicationNames, publication details, and cost-estimate keys.
+ // Publication create/update/delete invalidate this so all three refresh together.
publications: (projectRef: string | undefined, source_id: number | undefined) =>
['projects', projectRef, 'sources', source_id, 'publications'] as const,
+ publicationNames: (projectRef: string | undefined, source_id: number | undefined) =>
+ ['projects', projectRef, 'sources', source_id, 'publications', 'list'] as const,
+ publication: (
+ projectRef: string | undefined,
+ source_id: number | undefined,
+ publicationName: string | undefined
+ ) =>
+ [
+ 'projects',
+ projectRef,
+ 'sources',
+ source_id,
+ 'publications',
+ 'detail',
+ publicationName,
+ ] as const,
tables: (projectRef: string | undefined, source_id: number | undefined) =>
['projects', projectRef, 'sources', source_id, 'tables'] as const,
costEstimate: (
diff --git a/apps/studio/data/replication/pipeline-by-id-query.ts b/apps/studio/data/replication/pipeline-by-id-query.ts
index d48b8fe23d6..01dd77c6f24 100644
--- a/apps/studio/data/replication/pipeline-by-id-query.ts
+++ b/apps/studio/data/replication/pipeline-by-id-query.ts
@@ -24,7 +24,7 @@ async function fetchReplicationPipelineById(
return data
}
-export type ReplicationPipelineByIdData = components['schemas']['ReplicationPipelineResponse']
+export type ReplicationPipelineByIdData = components['schemas']['PipelineResponse_Output']
export const useReplicationPipelineByIdQuery = <TData = ReplicationPipelineByIdData>(
{ projectRef, pipelineId }: ReplicationPipelineByIdParams,
diff --git a/apps/studio/data/replication/pipeline-replication-status-query.ts b/apps/studio/data/replication/pipeline-replication-status-query.ts
index 438cdcbbd1b..9f82b8bab0b 100644
--- a/apps/studio/data/replication/pipeline-replication-status-query.ts
+++ b/apps/studio/data/replication/pipeline-replication-status-query.ts
@@ -8,7 +8,7 @@ import type { ResponseError, UseCustomQueryOptions } from '@/types'
type ReplicationPipelineReplicationStatusParams = { projectRef?: string; pipelineId?: number }
export type ReplicationPipelineTableStatus =
- components['schemas']['ReplicationPipelineReplicationStatusResponse']['table_statuses'][number]
+ components['schemas']['PipelineReplicationStatusResponse_Output']['table_statuses'][number]
async function fetchReplicationPipelineReplicationStatus(
{ projectRef, pipelineId }: ReplicationPipelineReplicationStatusParams,
diff --git a/apps/studio/data/replication/pipeline-status-query.ts b/apps/studio/data/replication/pipeline-status-query.ts
index 251cf223b95..c398a15ab22 100644
--- a/apps/studio/data/replication/pipeline-status-query.ts
+++ b/apps/studio/data/replication/pipeline-status-query.ts
@@ -7,7 +7,7 @@ import type { ResponseError, UseCustomQueryOptions } from '@/types'
type ReplicationPipelinesStatusParams = { projectRef?: string; pipelineId?: number }
export type ReplicationPipelineStatusResponse =
- components['schemas']['ReplicationPipelineStatusResponse']
+ components['schemas']['PipelineStatusResponse_Output']
export type ReplicationPipelineStatus = ReplicationPipelineStatusResponse['status']['name']
async function fetchReplicationPipelineStatus(
diff --git a/apps/studio/data/replication/pipeline-version-query.ts b/apps/studio/data/replication/pipeline-version-query.ts
index 3db8ec6a3d0..d95f92fb3f4 100644
--- a/apps/studio/data/replication/pipeline-version-query.ts
+++ b/apps/studio/data/replication/pipeline-version-query.ts
@@ -6,8 +6,7 @@ import { get, handleError } from '@/data/fetchers'
import type { ResponseError, UseCustomQueryOptions } from '@/types'
type ReplicationPipelineVersionParams = { projectRef?: string; pipelineId?: number }
-type ReplicationPipelineVersionResponse =
- components['schemas']['ReplicationPipelineVersionResponse']
+type ReplicationPipelineVersionResponse = components['schemas']['PipelineVersionResponse_Output']
export async function fetchReplicationPipelineVersion(
{ projectRef, pipelineId }: ReplicationPipelineVersionParams,
diff --git a/apps/studio/data/replication/publication-create-mutation.ts b/apps/studio/data/replication/publication-create-mutation.ts
index 2b0dbbe96a2..8095d2382c8 100644
--- a/apps/studio/data/replication/publication-create-mutation.ts
+++ b/apps/studio/data/replication/publication-create-mutation.ts
@@ -1,29 +1,41 @@
-import { getCreatePublicationSQL } from '@supabase/pg-meta'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
-import { executeSql } from '../sql/execute-sql-mutation'
import { replicationKeys } from './keys'
+import { handleError, put } from '@/data/fetchers'
import type { ResponseError, UseCustomMutationOptions } from '@/types'
export type CreatePublicationParams = {
projectRef: string
sourceId: number
name: string
- tables: { schema: string; name: string }[]
- connectionString?: string | null
+ tableIds: number[]
}
async function createPublication(
- { projectRef, connectionString, name, tables }: CreatePublicationParams,
+ { projectRef, sourceId, name, tableIds }: CreatePublicationParams,
signal?: AbortSignal
) {
if (!projectRef) throw new Error('projectRef is required')
- const sql = getCreatePublicationSQL({ name, tables })
- const { result } = await executeSql({ projectRef, connectionString, sql }, signal)
+ const { data, error } = await put(
+ '/platform/replication/v2/{ref}/sources/{source_id}/publications/{publication_name}',
+ {
+ params: { path: { ref: projectRef, source_id: sourceId, publication_name: name } },
+ body: {
+ type: 'tables',
+ tables: tableIds.map((id) => ({ id })),
+ operations: ['insert', 'update', 'delete', 'truncate'],
+ publish_via_partition_root: true,
+ },
+ signal,
+ }
+ )
+ if (error) {
+ handleError(error)
+ }
- return result
+ return data
}
type CreatePublicationData = Awaited<ReturnType<typeof createPublication>>
diff --git a/apps/studio/data/replication/publication-delete-mutation.ts b/apps/studio/data/replication/publication-delete-mutation.ts
index 7ed2a6977af..8adb67142be 100644
--- a/apps/studio/data/replication/publication-delete-mutation.ts
+++ b/apps/studio/data/replication/publication-delete-mutation.ts
@@ -18,7 +18,7 @@ async function deletePublication(
if (!projectRef) throw new Error('projectRef is required')
const { data, error } = await del(
- '/platform/replication/{ref}/sources/{source_id}/publications/{publication_name}',
+ '/platform/replication/v2/{ref}/sources/{source_id}/publications/{publication_name}',
{
params: {
path: {
diff --git a/apps/studio/data/replication/publication-names-query.ts b/apps/studio/data/replication/publication-names-query.ts
new file mode 100644
index 00000000000..e658944fa25
--- /dev/null
+++ b/apps/studio/data/replication/publication-names-query.ts
@@ -0,0 +1,55 @@
+import { queryOptions, useQuery } from '@tanstack/react-query'
+
+import { REPLICATION_METADATA_FRESHNESS_MS } from './constants'
+import { replicationKeys } from './keys'
+import { get, handleError } from '@/data/fetchers'
+import type { ResponseError, UseCustomQueryOptions } from '@/types'
+
+type ReplicationPublicationNamesParams = { projectRef?: string; sourceId?: number }
+
+async function fetchReplicationPublicationNames(
+ { projectRef, sourceId }: ReplicationPublicationNamesParams,
+ signal?: AbortSignal
+) {
+ if (!projectRef) throw new Error('projectRef is required')
+ if (!sourceId) throw new Error('sourceId is required')
+
+ const { data, error } = await get(
+ '/platform/replication/v2/{ref}/sources/{source_id}/publications',
+ {
+ params: { path: { ref: projectRef, source_id: sourceId } },
+ signal,
+ }
+ )
+ if (error) handleError(error)
+
+ return data.publications
+ .filter(({ name }) => name !== 'supabase_realtime')
+ .sort((a, b) => a.name.localeCompare(b.name))
+}
+
+export type ReplicationPublicationNamesData = Awaited<
+ ReturnType<typeof fetchReplicationPublicationNames>
+>
+
+type ReplicationPublicationNamesQueryOptions<TData> = Omit<
+ UseCustomQueryOptions<ReplicationPublicationNamesData, ResponseError, TData>,
+ 'enabled'
+> & { enabled?: boolean }
+
+export const replicationPublicationNamesQueryOptions = <TData = ReplicationPublicationNamesData>(
+ { projectRef, sourceId }: ReplicationPublicationNamesParams,
+ { enabled = true, ...options }: ReplicationPublicationNamesQueryOptions<TData> = {}
+) =>
+ queryOptions<ReplicationPublicationNamesData, ResponseError, TData>({
+ queryKey: replicationKeys.publicationNames(projectRef, sourceId),
+ queryFn: ({ signal }) => fetchReplicationPublicationNames({ projectRef, sourceId }, signal),
+ enabled: enabled && typeof projectRef !== 'undefined' && typeof sourceId !== 'undefined',
+ staleTime: REPLICATION_METADATA_FRESHNESS_MS,
+ ...options,
+ })
+
+export const useReplicationPublicationNamesQuery = <TData = ReplicationPublicationNamesData>(
+ { projectRef, sourceId }: ReplicationPublicationNamesParams,
+ options: ReplicationPublicationNamesQueryOptions<TData> = {}
+) => useQuery(replicationPublicationNamesQueryOptions({ projectRef, sourceId }, options))
diff --git a/apps/studio/data/replication/publication-query.ts b/apps/studio/data/replication/publication-query.ts
new file mode 100644
index 00000000000..e72e25db380
--- /dev/null
+++ b/apps/studio/data/replication/publication-query.ts
@@ -0,0 +1,66 @@
+import { queryOptions, useQuery } from '@tanstack/react-query'
+import type { components } from 'api-types'
+
+import { REPLICATION_METADATA_FRESHNESS_MS } from './constants'
+import { replicationKeys } from './keys'
+import { get, handleError } from '@/data/fetchers'
+import type { ResponseError, UseCustomQueryOptions } from '@/types'
+
+type ReplicationPublicationParams = {
+ projectRef?: string
+ sourceId?: number
+ publicationName?: string
+}
+
+async function fetchReplicationPublication(
+ { projectRef, sourceId, publicationName }: ReplicationPublicationParams,
+ signal?: AbortSignal
+): Promise<components['schemas']['PublicationDetailsResponse_Output']> {
+ if (!projectRef) throw new Error('projectRef is required')
+ if (!sourceId) throw new Error('sourceId is required')
+ if (!publicationName) throw new Error('publicationName is required')
+
+ const { data, error } = await get(
+ '/platform/replication/v2/{ref}/sources/{source_id}/publications/{publication_name}',
+ {
+ params: {
+ path: { ref: projectRef, source_id: sourceId, publication_name: publicationName },
+ },
+ signal,
+ }
+ )
+ if (error) handleError(error)
+
+ return data
+}
+
+export type ReplicationPublicationData = Awaited<ReturnType<typeof fetchReplicationPublication>>
+
+type ReplicationPublicationQueryOptions<TData> = Omit<
+ UseCustomQueryOptions<ReplicationPublicationData, ResponseError, TData>,
+ 'enabled'
+> & { enabled?: boolean }
+
+export const replicationPublicationQueryOptions = <TData = ReplicationPublicationData>(
+ { projectRef, sourceId, publicationName }: ReplicationPublicationParams,
+ { enabled = true, ...options }: ReplicationPublicationQueryOptions<TData> = {}
+) =>
+ queryOptions<ReplicationPublicationData, ResponseError, TData>({
+ queryKey: replicationKeys.publication(projectRef, sourceId, publicationName),
+ queryFn: ({ signal }) =>
+ fetchReplicationPublication({ projectRef, sourceId, publicationName }, signal),
+ enabled:
+ enabled &&
+ typeof projectRef !== 'undefined' &&
+ typeof sourceId !== 'undefined' &&
+ typeof publicationName !== 'undefined' &&
+ publicationName.length > 0,
+ staleTime: REPLICATION_METADATA_FRESHNESS_MS,
+ ...options,
+ })
+
+export const useReplicationPublicationQuery = <TData = ReplicationPublicationData>(
+ { projectRef, sourceId, publicationName }: ReplicationPublicationParams,
+ options: ReplicationPublicationQueryOptions<TData> = {}
+) =>
+ useQuery(replicationPublicationQueryOptions({ projectRef, sourceId, publicationName }, options))
diff --git a/apps/studio/data/replication/publication-update-mutation.ts b/apps/studio/data/replication/publication-update-mutation.ts
index e6ae588cf03..7fd295ec7e6 100644
--- a/apps/studio/data/replication/publication-update-mutation.ts
+++ b/apps/studio/data/replication/publication-update-mutation.ts
@@ -1,28 +1,29 @@
import { useMutation, useQueryClient } from '@tanstack/react-query'
+import { components } from 'api-types'
import { toast } from 'sonner'
import { replicationKeys } from './keys'
-import { handleError, post } from '@/data/fetchers'
+import { handleError, put } from '@/data/fetchers'
import type { ResponseError, UseCustomMutationOptions } from '@/types'
export type UpdatePublicationParams = {
projectRef: string
sourceId: number
publicationName: string
- tables: { schema: string; name: string }[]
+ config: components['schemas']['PutPublicationBody']
}
async function updatePublication(
- { projectRef, sourceId, publicationName, tables }: UpdatePublicationParams,
+ { projectRef, sourceId, publicationName, config }: UpdatePublicationParams,
signal?: AbortSignal
) {
if (!projectRef) throw new Error('projectRef is required')
- const { data, error } = await post(
- '/platform/replication/{ref}/sources/{source_id}/publications/{publication_name}',
+ const { data, error } = await put(
+ '/platform/replication/v2/{ref}/sources/{source_id}/publications/{publication_name}',
{
params: { path: { ref: projectRef, source_id: sourceId, publication_name: publicationName } },
- body: { tables },
+ body: config,
signal,
}
)
diff --git a/apps/studio/data/replication/publications-query.ts b/apps/studio/data/replication/publications-query.ts
deleted file mode 100644
index e71133add7a..00000000000
--- a/apps/studio/data/replication/publications-query.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { useQuery } from '@tanstack/react-query'
-import { components } from 'api-types'
-
-import { replicationKeys } from './keys'
-import { get, handleError } from '@/data/fetchers'
-import type { ResponseError, UseCustomQueryOptions } from '@/types'
-
-type ReplicationPublicationsParams = { projectRef?: string; sourceId?: number }
-
-export type ReplicationPublication =
- components['schemas']['ReplicationPublicationsResponse']['publications'][number]
-
-async function fetchReplicationPublications(
- { projectRef, sourceId }: ReplicationPublicationsParams,
- signal?: AbortSignal
-) {
- if (!projectRef) throw new Error('projectRef is required')
-
- if (!sourceId) throw new Error('sourceId is required')
-
- const { data, error } = await get(
- '/platform/replication/{ref}/sources/{source_id}/publications',
- {
- params: { path: { ref: projectRef, source_id: sourceId } },
- signal,
- }
- )
- if (error) {
- handleError(error)
- }
-
- // Filter out:
- // 1. supabase_realtime (internal publication)
- // 2. Publications with no tables (would cause validation to fail)
- const filteredPublications = data.publications.filter(
- (pub) => pub.name !== 'supabase_realtime' && pub.tables.length > 0
- )
-
- // Sort publications alphabetically by name
- return filteredPublications.sort((a, b) => a.name.localeCompare(b.name))
-}
-
-export type ReplicationPublicationsData = Awaited<ReturnType<typeof fetchReplicationPublications>>
-
-export const useReplicationPublicationsQuery = <TData = ReplicationPublicationsData>(
- { projectRef, sourceId }: ReplicationPublicationsParams,
- {
- enabled = true,
- ...options
- }: UseCustomQueryOptions<ReplicationPublicationsData, ResponseError, TData> = {}
-) =>
- useQuery<ReplicationPublicationsData, ResponseError, TData>({
- queryKey: replicationKeys.publications(projectRef, sourceId),
- queryFn: ({ signal }) => fetchReplicationPublications({ projectRef, sourceId }, signal),
- enabled: enabled && typeof projectRef !== 'undefined' && typeof sourceId !== 'undefined',
- ...options,
- })
diff --git a/apps/studio/data/replication/tables-query.ts b/apps/studio/data/replication/tables-query.ts
index 27083a17bc7..963724d6ad2 100644
--- a/apps/studio/data/replication/tables-query.ts
+++ b/apps/studio/data/replication/tables-query.ts
@@ -1,5 +1,6 @@
-import { useQuery } from '@tanstack/react-query'
+import { queryOptions, useQuery } from '@tanstack/react-query'
+import { REPLICATION_METADATA_FRESHNESS_MS } from './constants'
import { replicationKeys } from './keys'
import { get, handleError } from '@/data/fetchers'
import type { ResponseError, UseCustomQueryOptions } from '@/types'
@@ -13,7 +14,7 @@ async function fetchReplicationTables(
if (!projectRef) throw new Error('projectRef is required')
if (!sourceId) throw new Error('sourceId is required')
- const { data, error } = await get('/platform/replication/{ref}/sources/{source_id}/tables', {
+ const { data, error } = await get('/platform/replication/v2/{ref}/sources/{source_id}/tables', {
params: { path: { ref: projectRef, source_id: sourceId } },
signal,
})
@@ -26,16 +27,24 @@ async function fetchReplicationTables(
export type ReplicationTablesData = Awaited<ReturnType<typeof fetchReplicationTables>>
-export const useReplicationTablesQuery = <TData = ReplicationTablesData>(
+type ReplicationTablesQueryOptions<TData> = Omit<
+ UseCustomQueryOptions<ReplicationTablesData, ResponseError, TData>,
+ 'enabled'
+> & { enabled?: boolean }
+
+export const replicationTablesQueryOptions = <TData = ReplicationTablesData>(
{ projectRef, sourceId }: ReplicationTablesParams,
- {
- enabled = true,
- ...options
- }: UseCustomQueryOptions<ReplicationTablesData, ResponseError, TData> = {}
+ { enabled = true, ...options }: ReplicationTablesQueryOptions<TData> = {}
) =>
- useQuery<ReplicationTablesData, ResponseError, TData>({
+ queryOptions<ReplicationTablesData, ResponseError, TData>({
queryKey: replicationKeys.tables(projectRef, sourceId),
queryFn: ({ signal }) => fetchReplicationTables({ projectRef, sourceId }, signal),
enabled: enabled && typeof projectRef !== 'undefined' && typeof sourceId !== 'undefined',
+ staleTime: REPLICATION_METADATA_FRESHNESS_MS,
...options,
})
+
+export const useReplicationTablesQuery = <TData = ReplicationTablesData>(
+ { projectRef, sourceId }: ReplicationTablesParams,
+ options: ReplicationTablesQueryOptions<TData> = {}
+) => useQuery(replicationTablesQueryOptions({ projectRef, sourceId }, options))
diff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.ts
index 507bbc4ac76..4f0f82e4971 100644
--- a/packages/api-types/types/platform.d.ts
+++ b/packages/api-types/types/platform.d.ts
@@ -3705,13 +3705,13 @@ export interface paths {
* List replication destinations
* @description List all destinations for the project. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationDestinationsController_getDestinations']
+ get: operations['DestinationsController_getDestinations']
put?: never
/**
* Create replication destination
* @description Create a destination for the project. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationDestinationsController_createDestination']
+ post: operations['DestinationsController_createDestination']
delete?: never
options?: never
head?: never
@@ -3731,7 +3731,7 @@ export interface paths {
* Create destination and pipeline
* @description Create a destination and pipeline in one call. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationDestinationsPipelinesController_createDestinationPipeline']
+ post: operations['DestinationsPipelinesController_createDestinationPipeline']
delete?: never
options?: never
head?: never
@@ -3751,12 +3751,12 @@ export interface paths {
* Update destination and pipeline
* @description Update a destination and pipeline in one call. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationDestinationsPipelinesController_updateDestinationPipeline']
+ post: operations['DestinationsPipelinesController_updateDestinationPipeline']
/**
* Delete destination and pipeline
* @description Delete a destination and pipeline. Requires bearer auth and an active, healthy project.
*/
- delete: operations['ReplicationDestinationsPipelinesController_deleteDestinationPipeline']
+ delete: operations['DestinationsPipelinesController_deleteDestinationPipeline']
options?: never
head?: never
patch?: never
@@ -3773,18 +3773,18 @@ export interface paths {
* Get replication destination
* @description Get a destination by id. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationDestinationsController_getDestination']
+ get: operations['DestinationsController_getDestination']
put?: never
/**
* Update replication destination
* @description Update a destination for the project. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationDestinationsController_updateDestination']
+ post: operations['DestinationsController_updateDestination']
/**
* Delete replication destination
* @description Delete a destination from the project. Requires bearer auth and an active, healthy project.
*/
- delete: operations['ReplicationDestinationsController_deleteDestination']
+ delete: operations['DestinationsController_deleteDestination']
options?: never
head?: never
patch?: never
@@ -3803,7 +3803,7 @@ export interface paths {
* Validate destination configuration
* @description Validates that the destination is accessible and properly configured. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationDestinationsController_validateDestination']
+ post: operations['DestinationsController_validateDestination']
delete?: never
options?: never
head?: never
@@ -3821,13 +3821,13 @@ export interface paths {
* List replication pipelines
* @description List all pipelines for the project. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationPipelinesController_getPipelines']
+ get: operations['PipelinesController_getPipelines']
put?: never
/**
* Create replication pipeline
* @description Create a pipeline for the project. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationPipelinesController_createPipeline']
+ post: operations['PipelinesController_createPipeline']
delete?: never
options?: never
head?: never
@@ -3845,18 +3845,18 @@ export interface paths {
* Get replication pipeline
* @description Get a pipeline by id. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationPipelinesController_getPipeline']
+ get: operations['PipelinesController_getPipeline']
put?: never
/**
* Update replication pipeline
* @description Update a pipeline. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationPipelinesController_updatePipeline']
+ post: operations['PipelinesController_updatePipeline']
/**
* Delete replication pipeline
* @description Delete a pipeline from the project. Requires bearer auth and an active, healthy project.
*/
- delete: operations['ReplicationPipelinesController_deletePipeline']
+ delete: operations['PipelinesController_deletePipeline']
options?: never
head?: never
patch?: never
@@ -3873,7 +3873,7 @@ export interface paths {
* Get pipeline replication status
* @description Get the pipeline replication status. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationPipelinesController_getPipelineReplicationStatus']
+ get: operations['PipelinesController_getPipelineReplicationStatus']
put?: never
post?: never
delete?: never
@@ -3895,7 +3895,7 @@ export interface paths {
* Restart pipeline
* @description Restart the pipeline. Requires bearer auth and an active, healthy project. Fails with a conflict if the pipeline is not currently running.
*/
- post: operations['ReplicationPipelinesController_restartPipeline']
+ post: operations['PipelinesController_restartPipeline']
delete?: never
options?: never
head?: never
@@ -3915,7 +3915,7 @@ export interface paths {
* Rollback pipeline tables
* @description Rollback the replication state of tables in the pipeline. Supports rolling back a single table, all errored tables or all tables. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationPipelinesController_rollbackTables']
+ post: operations['PipelinesController_rollbackTables']
delete?: never
options?: never
head?: never
@@ -3935,7 +3935,7 @@ export interface paths {
* Start pipeline
* @description Start the pipeline. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationPipelinesController_startPipeline']
+ post: operations['PipelinesController_startPipeline']
delete?: never
options?: never
head?: never
@@ -3953,7 +3953,7 @@ export interface paths {
* Get pipeline status
* @description Get the current pipeline status. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationPipelinesController_getPipelineStatus']
+ get: operations['PipelinesController_getPipelineStatus']
put?: never
post?: never
delete?: never
@@ -3975,7 +3975,7 @@ export interface paths {
* Stop pipeline
* @description Stop the pipeline. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationPipelinesController_stopPipeline']
+ post: operations['PipelinesController_stopPipeline']
delete?: never
options?: never
head?: never
@@ -3993,13 +3993,13 @@ export interface paths {
* Get pipeline version
* @description Get the current pipeline version. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationPipelinesController_getPipelineVersion']
+ get: operations['PipelinesController_getPipelineVersion']
put?: never
/**
* Update pipeline version
* @description Update the pipeline to a new version. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationPipelinesController_updatePipelineVersion']
+ post: operations['PipelinesController_updatePipelineVersion']
delete?: never
options?: never
head?: never
@@ -4019,7 +4019,7 @@ export interface paths {
* Validate pipeline configuration
* @description Validates pipeline prerequisites against the source database. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationPipelinesController_validatePipeline']
+ post: operations['PipelinesController_validatePipeline']
delete?: never
options?: never
head?: never
@@ -4037,13 +4037,13 @@ export interface paths {
* List replication sources
* @description List all sources for the project. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationSourcesController_getSources']
+ get: operations['SourcesController_getSources']
put?: never
/**
* Create replication source
* @description Create a source for the project. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationSourcesController_createSource']
+ post: operations['SourcesController_createSource']
delete?: never
options?: never
head?: never
@@ -4061,13 +4061,13 @@ export interface paths {
* List publications for source
* @description List publications for a source. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationSourcesController_getPublications']
+ get: operations['SourcesController_getPublications']
put?: never
/**
* Create publication for source
* @description Create a publication for a source. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationSourcesController_createPublication']
+ post: operations['SourcesController_createPublication']
delete?: never
options?: never
head?: never
@@ -4087,12 +4087,12 @@ export interface paths {
* Update publication for source
* @description Update a publication for a source. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationSourcesController_updatePublication']
+ post: operations['SourcesController_updatePublication']
/**
* Delete publication for source
* @description Delete a publication for a source. Requires bearer auth and an active, healthy project.
*/
- delete: operations['ReplicationSourcesController_deletePublication']
+ delete: operations['SourcesController_deletePublication']
options?: never
head?: never
patch?: never
@@ -4109,7 +4109,7 @@ export interface paths {
* Estimate replication cost for a publication
* @description Estimate the cost of replicating a publication's tables. Returns the hourly (and projected monthly) per-pipeline fee, a per-table breakdown of the one-time initial-copy cost derived from the tables’ on-disk size, and the usage-based streaming rate. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationSourcesController_getCostEstimate']
+ get: operations['SourcesController_getCostEstimate']
put?: never
post?: never
delete?: never
@@ -4129,7 +4129,7 @@ export interface paths {
* List tables for source
* @description List tables available for a source. Requires bearer auth and an active, healthy project.
*/
- get: operations['ReplicationSourcesController_getTables']
+ get: operations['SourcesController_getTables']
put?: never
post?: never
delete?: never
@@ -4152,7 +4152,7 @@ export interface paths {
* Delete tenant
* @description Delete the replication tenant for the project. Requires bearer auth.
*/
- delete: operations['ReplicationTenantsController_deleteTenant']
+ delete: operations['TenantsController_deleteTenant']
options?: never
head?: never
patch?: never
@@ -4171,7 +4171,95 @@ export interface paths {
* Create tenant and source
* @description Create a replication tenant and source. Requires bearer auth and an active, healthy project.
*/
- post: operations['ReplicationTenantsSourcesController_createTenantSource']
+ post: operations['TenantsSourcesController_createTenantSource']
+ delete?: never
+ options?: never
+ head?: never
+ patch?: never
+ trace?: never
+ }
+ '/platform/replication/v2/{ref}/sources/{source_id}/publications': {
+ parameters: {
+ query?: never
+ header?: never
+ path?: never
+ cookie?: never
+ }
+ /**
+ * List publications for source (V2)
+ * @description List publication names for a source. Requires bearer auth and an active, healthy project.
+ */
+ get: operations['V2SourcesController_getPublications']
+ put?: never
+ post?: never
+ delete?: never
+ options?: never
+ head?: never
+ patch?: never
+ trace?: never
+ }
+ '/platform/replication/v2/{ref}/sources/{source_id}/publications/{publication_name}': {
+ parameters: {
+ query?: never
+ header?: never
+ path?: never
+ cookie?: never
+ }
+ /**
+ * Read a publication (V2)
+ * @description Read a publication configuration and the tables it currently exposes. Requires bearer auth and an active, healthy project.
+ */
+ get: operations['V2SourcesController_getPublication']
+ /**
+ * Create or replace a publication (V2)
+ * @description Creates the named publication, or replaces the table configuration of an existing explicit-table publication. Table references use stable Postgres table ids (OIDs), and support optional per-table row filters and column lists. Requires bearer auth and an active, healthy project.
+ */
+ put: operations['V2SourcesController_putPublication']
+ post?: never
+ /**
+ * Delete a publication (V2)
+ * @description Delete a publication for a source. Requires bearer auth and an active, healthy project.
+ */
+ delete: operations['V2SourcesController_deletePublication']
+ options?: never
+ head?: never
+ patch?: never
+ trace?: never
+ }
+ '/platform/replication/v2/{ref}/sources/{source_id}/tables': {
+ parameters: {
+ query?: never
+ header?: never
+ path?: never
+ cookie?: never
+ }
+ /**
+ * List replication-eligible source tables (V2)
+ * @description List tables available for a source, including their partition hierarchy. Requires bearer auth and an active, healthy project.
+ */
+ get: operations['V2SourcesController_getTables']
+ put?: never
+ post?: never
+ delete?: never
+ options?: never
+ head?: never
+ patch?: never
+ trace?: never
+ }
+ '/platform/replication/v2/{ref}/sources/{source_id}/tables/{table_id}/columns': {
+ parameters: {
+ query?: never
+ header?: never
+ path?: never
+ cookie?: never
+ }
+ /**
+ * List columns for a source table
+ * @description List columns for a table available to a source. Requires bearer auth and an active, healthy project.
+ */
+ get: operations['V2SourcesController_getTableColumns']
+ put?: never
+ post?: never
delete?: never
options?: never
head?: never
@@ -6800,6 +6888,40 @@ export interface components {
* @example false
*/
s3_use_ssl?: boolean
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ }
}
| {
catalog:
@@ -6918,6 +7040,40 @@ export interface components {
/** @enum {string} */
type: 'supabase_storage'
}
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ }
}
}
| {
@@ -7034,37 +7190,39 @@ export interface components {
table_error_retry_max_attempts?: number | null
/** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
table_sync_copy?:
- | {
- /** @enum {string} */
- type: 'include_all_tables'
- }
- | {
- /** @enum {string} */
- type: 'skip_all_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be performed
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'include_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be skipped
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'skip_tables'
- }
- | never
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
}
/**
* @description Source id
@@ -10409,178 +10567,375 @@ export interface components {
redirect_uris: string[]
website: string
}
- RealtimeConfigResponse: {
- /** @description Sets connection pool size for Realtime Authorization */
- connection_pool: number | null
- /** @description Sets maximum number of bytes per second rate per channel limit */
- max_bytes_per_second: number | null
- /** @description Sets maximum number of channels per client rate limit */
- max_channels_per_client: number | null
- /** @description Sets maximum number of concurrent users rate limit */
- max_concurrent_users: number | null
- /** @description Sets maximum number of events per second rate per channel limit */
- max_events_per_second: number | null
- /** @description Sets maximum number of joins per second rate limit */
- max_joins_per_second: number | null
- /** @description Sets maximum number of payload size in KB rate limit */
- max_payload_size_in_kb: number | null
- /** @description Sets maximum number of presence events per second rate limit */
- max_presence_events_per_second: number | null
- /** @description Sets connection pool size used to create Postgres Changes subscriptions */
- postgres_changes_pool: number | null
- /** @description Whether to enable presence */
- presence_enabled: boolean
- /** @description Whether to only allow private channels */
- private_only: boolean | null
- /** @description Disables the Realtime service for this project when true. Set to false to re-enable it. */
- suspend: boolean | null
- }
- RegionsInfo: {
- all: {
- smartGroup: {
- /** @enum {string} */
- code: 'americas' | 'emea' | 'apac'
- name: string
- /** @enum {string} */
- type: 'smartGroup'
- }[]
- specific: {
- /** @enum {string} */
- code:
- | 'us-east-1'
- | 'us-east-2'
- | 'us-west-1'
- | 'us-west-2'
- | 'ap-southeast-1'
- | 'ap-northeast-1'
- | 'ap-northeast-2'
- | 'ap-east-1'
- | 'ap-southeast-2'
- | 'eu-west-1'
- | 'eu-west-2'
- | 'eu-west-3'
- | 'eu-north-1'
- | 'eu-central-1'
- | 'eu-central-2'
- | 'ca-central-1'
- | 'ap-south-1'
- | 'sa-east-1'
- name: string
- /** @enum {string} */
- provider: 'AWS' | 'AWS_K8S' | 'AWS_NIMBUS'
- /** @enum {string} */
- status?: 'capacity' | 'other'
- /** @enum {string} */
- type: 'specific'
- }[]
- }
- recommendations: {
- smartGroup: {
- /** @enum {string} */
- code: 'americas' | 'emea' | 'apac'
- name: string
- /** @enum {string} */
- type: 'smartGroup'
- }
- specific: {
- /** @enum {string} */
- code:
- | 'us-east-1'
- | 'us-east-2'
- | 'us-west-1'
- | 'us-west-2'
- | 'ap-southeast-1'
- | 'ap-northeast-1'
- | 'ap-northeast-2'
- | 'ap-east-1'
- | 'ap-southeast-2'
- | 'eu-west-1'
- | 'eu-west-2'
- | 'eu-west-3'
- | 'eu-north-1'
- | 'eu-central-1'
- | 'eu-central-2'
- | 'ca-central-1'
- | 'ap-south-1'
- | 'sa-east-1'
- name: string
- /** @enum {string} */
- provider: 'AWS' | 'AWS_K8S' | 'AWS_NIMBUS'
- /** @enum {string} */
- status?: 'capacity' | 'other'
- /** @enum {string} */
- type: 'specific'
- }[]
- }
- }
- RemoveProjectResponse: {
- id: number
- name: string
- ref: string
- vercel?: {
- resourceUninstallFailure: boolean
- }
- }
- ReplicationDestinationResponse: {
- /** @description Destination configuration */
- config:
- | {
- big_query: {
- /**
- * @description Number of concurrent BigQuery Storage Write API connections.
- * @example 8
- */
- connection_pool_size: number
- /**
- * @description BigQuery dataset id
- * @example analytics
- */
- dataset_id: string
- /**
- * @description Maximum data staleness in minutes
- * @example 5
- */
- max_staleness_mins?: number
- /**
- * @description BigQuery project id
- * @example my-gcp-project
- */
- project_id: string
- /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
- table_options?: {
- tables?: {
- cluster_by?: string[]
- partition_by?:
- | (
- | {
- /**
- * @description Source column name
- * @example created_at
- */
- column: string
- /**
- * @description Partition granularity
- * @example day
- * @enum {string}
- */
- granularity?: 'hour' | 'day' | 'month' | 'year'
+ DestinationsResponse_Output: {
+ /** @description List of destinations */
+ destinations: {
+ /** @description Destination configuration */
+ config:
+ | {
+ big_query: {
+ /**
+ * @description Number of concurrent BigQuery Storage Write API connections.
+ * @example 8
+ */
+ connection_pool_size?: number | null
+ /**
+ * @description BigQuery dataset id
+ * @example analytics
+ */
+ dataset_id: string
+ /**
+ * @description Maximum data staleness in minutes
+ * @example 5
+ */
+ max_staleness_mins?: number | null
+ /**
+ * @description BigQuery project id
+ * @example my-gcp-project
+ */
+ project_id: string
+ /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
+ table_options?: {
+ tables?: {
+ cluster_by?: string[]
+ partition_by?:
+ | (
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @enum {string}
+ */
+ kind: 'time_column'
+ }
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Exclusive end of the last partition range
+ * @example 100
+ */
+ end: number
+ /**
+ * @description Width of each partition range
+ * @example 10
+ */
+ interval: number
+ /**
+ * @description Partition by ranges of a replicated integer column
+ * @enum {string}
+ */
+ kind: 'integer_range'
+ /**
+ * @description Inclusive start of the first partition range
+ * @example 0
+ */
+ start: number
+ }
+ | {
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by the time at which BigQuery ingests each row
+ * @enum {string}
+ */
+ kind: 'ingestion_time'
+ }
+ )
+ | null
+ /**
+ * @description Source PostgreSQL table OID, stable across renames for the relation lifetime
+ * @example 16384
+ */
+ table_id: number
+ }[]
+ }
+ }
+ }
+ | {
+ clickhouse: {
+ /**
+ * @description ClickHouse target database
+ * @example analytics
+ */
+ database: string
+ /**
+ * @description Table engine used for replicated tables. Defaults to `replacing_merge_tree` server-side when omitted.
+ * @example replacing_merge_tree
+ * @enum {string}
+ */
+ engine: 'merge_tree' | 'replacing_merge_tree'
+ /**
+ * @description Persisted ClickHouse HTTP(S) endpoint URL
+ * @example http://clickhouse.example.com:8123
+ */
+ url: string
+ /**
+ * @description ClickHouse user name
+ * @example default
+ */
+ user: string
+ }
+ }
+ | {
+ iceberg:
+ | {
+ supabase: {
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string | null
+ /**
+ * @description Project ref
+ * @example abcdefghijklmnopqrst
+ */
+ project_ref: string
+ /**
+ * @description S3 region
+ * @example ap-southeast-1
+ */
+ s3_region: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ | {
+ rest: {
+ /**
+ * @description Iceberg REST catalog URI
+ * @example https://catalog.example.com
+ */
+ catalog_uri: string
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string | null
+ /**
+ * @description S3-compatible storage endpoint
+ * @example https://s3.example.com
+ */
+ s3_endpoint: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ }
+ | {
+ ducklake: {
+ /**
+ * @description Persisted DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description Persisted DuckLake metadata schema
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description Persisted S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint?: string | null
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region?: string | null
+ /**
+ * @description Persisted S3 URL style
+ * @example path
+ */
+ s3_url_style?: string | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @example false
+ */
+ s3_use_ssl?: boolean | null
+ table_sorting?: {
+ tables: ({
+ schema: string
+ sort_by:
+ | ({
+ columns: ({
/**
- * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @description DuckLake sort direction
+ * @example asc
* @enum {string}
*/
- kind: 'time_column'
- }
- | {
+ direction: 'asc' | 'desc'
/**
* @description Source column name
* @example created_at
*/
- column: string
+ name: string
/**
- * @description Exclusive end of the last partition range
- * @example 100
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
*/
- end: number
+ nulls?: 'first' | 'last' | null
+ } & {
+ [key: string]: unknown
+ })[]
+ /** @enum {string} */
+ kind: 'columns'
+ } & {
+ [key: string]: unknown
+ })
+ | ({
+ /** @enum {string} */
+ kind: 'primary_key'
+ } & {
+ [key: string]: unknown
+ })
+ table: string
+ } & {
+ [key: string]: unknown
+ })[]
+ } & {
+ [key: string]: unknown
+ }
+ }
+ }
+ | {
+ snowflake: {
+ /**
+ * @description Snowflake account identifier
+ * @example MYORG-MYACCOUNT
+ */
+ account_id: string
+ /**
+ * @description Snowflake target database
+ * @example ANALYTICS
+ */
+ database: string
+ /**
+ * @description Optional Snowflake role
+ * @example PIPELINES_ROLE
+ */
+ role?: string | null
+ /**
+ * @description Snowflake target schema
+ * @example PUBLIC
+ */
+ schema: string
+ /**
+ * @description Snowflake user configured for key-pair authentication
+ * @example PIPELINES_USER
+ */
+ user: string
+ }
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ id: number
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }[]
+ }
+ CreateDestinationBody: {
+ /** @description Destination configuration */
+ config:
+ | {
+ big_query: {
+ /**
+ * @description Number of concurrent BigQuery Storage Write API connections.
+ * @example 8
+ */
+ connection_pool_size?: number | null
+ /**
+ * @description BigQuery dataset id
+ * @example analytics
+ */
+ dataset_id: string
+ /**
+ * @description Maximum data staleness in minutes
+ * @example 5
+ */
+ max_staleness_mins?: number | null
+ /**
+ * @description BigQuery project id
+ * @example my-gcp-project
+ */
+ project_id: string
+ /** @description BigQuery service account key */
+ service_account_key: string
+ /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
+ table_options?: {
+ tables?: {
+ cluster_by?: string[]
+ partition_by?:
+ | (
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @enum {string}
+ */
+ kind: 'time_column'
+ }
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Exclusive end of the last partition range
+ * @example 100
+ */
+ end: number
/**
* @description Width of each partition range
* @example 10
@@ -10633,10 +10988,12 @@ export interface components {
* @example replacing_merge_tree
* @enum {string}
*/
- engine: 'merge_tree' | 'replacing_merge_tree'
+ engine?: 'merge_tree' | 'replacing_merge_tree'
+ /** @description ClickHouse password. Omit for passwordless access. */
+ password?: string | null
/**
- * @description Persisted ClickHouse HTTP(S) endpoint URL
- * @example http://clickhouse.example.com:8123
+ * @description ClickHouse HTTPS endpoint URL
+ * @example https://clickhouse.example.com:8443
*/
url: string
/**
@@ -10647,95 +11004,290 @@ export interface components {
}
}
| {
- iceberg:
+ iceberg: {
+ supabase: {
+ /**
+ * @description Catalog token
+ * @example A jwt secret
+ */
+ catalog_token: string
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string | null
+ /**
+ * @description Project ref
+ * @example abcdefghijklmnopqrst
+ */
+ project_ref: string
+ /**
+ * @description S3 access key ID
+ * @example 53383b1d0cdb16a3afa63152656aa3cc
+ */
+ s3_access_key_id: string
+ /**
+ * @description S3 region
+ * @example ap-southeast-1
+ */
+ s3_region: string
+ /**
+ * @description S3 secret access key
+ * @example 25a0c5e69d847088a3e6ffb901adf4d19bbf74a400dec2ee49f46401039b3258
+ */
+ s3_secret_access_key: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ }
+ | {
+ ducklake:
| {
- supabase: {
- /**
- * @description Namespace
- * @example my-namespace
- */
- namespace?: string
- /**
- * @description Project ref
- * @example abcdefghijklmnopqrst
- */
- project_ref: string
- /**
- * @description S3 region
- * @example ap-southeast-1
- */
- s3_region: string
- /**
- * @description Warehouse name
- * @example my-warehouse
- */
- warehouse_name: string
+ /**
+ * @description DuckLake catalog URL
+ * @example postgres://user:pass@localhost:5432/ducklake_catalog
+ */
+ catalog_url: string
+ /**
+ * @description DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description Schema used for DuckLake metadata tables stored in PostgreSQL
+ * @default ducklake
+ * @example ducklake
+ */
+ metadata_schema?: string
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description S3-compatible storage access key ID
+ * @example my-access-key
+ */
+ s3_access_key_id?: string | null
+ /**
+ * @description S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint?: string | null
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region?: string | null
+ /**
+ * @description S3-compatible storage secret access key
+ * @example my-secret-key
+ */
+ s3_secret_access_key?: string | null
+ /**
+ * @description S3 URL style: `path` (MinIO/Supabase) or `vhost` (AWS)
+ * @example path
+ * @enum {string|null}
+ */
+ s3_url_style?: 'path' | 'vhost' | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @default true
+ * @example false
+ */
+ s3_use_ssl?: boolean
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
}
}
| {
- rest: {
- /**
- * @description Iceberg REST catalog URI
- * @example https://catalog.example.com
- */
- catalog_uri: string
- /**
- * @description Namespace
- * @example my-namespace
- */
- namespace?: string
- /**
- * @description S3-compatible storage endpoint
- * @example https://s3.example.com
- */
- s3_endpoint: string
- /**
- * @description Warehouse name
- * @example my-warehouse
- */
- warehouse_name: string
+ catalog:
+ | {
+ /**
+ * @description DuckLake catalog URL
+ * @example postgres://user:pass@localhost:5432/ducklake_catalog
+ */
+ catalog_url: string
+ /**
+ * @description Schema used for DuckLake metadata tables stored in this PostgreSQL catalog. Overrides `metadata_schema` when provided.
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /** @enum {string} */
+ type: 'postgres_url'
+ }
+ | {
+ /**
+ * @description Schema used for DuckLake metadata tables stored in this PostgreSQL catalog. Overrides `metadata_schema` when provided.
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description Supabase project ref used as the DuckLake PostgreSQL catalog
+ * @example abcjuqabhgwjjutfvtpa
+ */
+ project_ref: string
+ /** @enum {string} */
+ type: 'supabase_project'
+ }
+ /**
+ * @description Schema used for DuckLake metadata tables stored in PostgreSQL
+ * @default ducklake
+ * @example ducklake
+ */
+ metadata_schema?: string
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ storage:
+ | {
+ /**
+ * @description DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description S3-compatible storage access key ID
+ * @example my-access-key
+ */
+ s3_access_key_id: string
+ /**
+ * @description S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint: string
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region: string
+ /**
+ * @description S3-compatible storage secret access key
+ * @example my-secret-key
+ */
+ s3_secret_access_key: string
+ /**
+ * @description S3 URL style: `path` (MinIO/Supabase) or `vhost` (AWS)
+ * @example path
+ * @enum {string|null}
+ */
+ s3_url_style?: 'path' | 'vhost' | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @default true
+ * @example false
+ */
+ s3_use_ssl?: boolean
+ /** @enum {string} */
+ type: 's3'
+ }
+ | {
+ /**
+ * @description Storage bucket id used for DuckLake data files
+ * @example ducklake
+ */
+ bucket: string
+ /**
+ * @description Optional description for the generated Supabase Storage S3 credential
+ * @example DuckLake replication destination
+ */
+ credential_description?: string
+ /**
+ * @description Optional path prefix inside the bucket for DuckLake data files
+ * @example replication
+ */
+ path?: string
+ /**
+ * @description Supabase project ref whose Object Storage S3 API stores DuckLake data files
+ * @example abcjuqabhgwjjutfvtpa
+ */
+ project_ref: string
+ /** @enum {string} */
+ type: 'supabase_storage'
+ }
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
}
}
}
- | {
- ducklake: {
- /**
- * @description Persisted DuckLake data path
- * @example s3://<bucket-name>/
- */
- data_path: string
- /**
- * @description Persisted DuckLake metadata schema
- * @example ducklake
- */
- metadata_schema?: string
- /**
- * @description Number of concurrent DuckDB connections.
- * @example 4
- */
- pool_size: number
- /**
- * @description Persisted S3-compatible storage endpoint
- * @example 127.0.0.1:5000/s3
- */
- s3_endpoint?: string
- /**
- * @description S3-compatible storage region
- * @example us-east-1
- */
- s3_region?: string
- /**
- * @description Persisted S3 URL style
- * @example path
- */
- s3_url_style?: string
- /**
- * @description Whether to use SSL for S3-compatible storage
- * @example false
- */
- s3_use_ssl?: boolean
- }
- }
| {
snowflake: {
/**
@@ -10748,11 +11300,15 @@ export interface components {
* @example ANALYTICS
*/
database: string
+ /** @description Snowflake RSA private key PEM contents */
+ private_key: string
+ /** @description Optional passphrase for encrypted private keys */
+ private_key_passphrase?: string | null
/**
* @description Optional Snowflake role
* @example PIPELINES_ROLE
*/
- role?: string
+ role?: string | null
/**
* @description Snowflake target schema
* @example PUBLIC
@@ -10765,1256 +11321,4394 @@ export interface components {
user: string
}
}
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ name: string
+ }
+ CreateDestinationResponse_Output: {
/**
* @description Destination id
* @example 2001
*/
id: number
+ }
+ CreateDestinationPipelineResponse_Output: {
/**
- * @description Destination name
- * @example bq-analytics
+ * @description Destination id
+ * @example 2001
*/
- name: string
+ destination_id: number
/**
- * @description Tenant id
- * @example tenant_9f3a2c
+ * @description Pipeline id
+ * @example 1012
*/
- tenant_id: string
+ pipeline_id: number
}
- ReplicationDestinationsResponse: {
- /** @description List of destinations */
- destinations: {
- /** @description Destination configuration */
- config:
- | {
- big_query: {
- /**
- * @description Number of concurrent BigQuery Storage Write API connections.
- * @example 8
- */
- connection_pool_size: number
- /**
- * @description BigQuery dataset id
- * @example analytics
- */
- dataset_id: string
- /**
- * @description Maximum data staleness in minutes
- * @example 5
- */
- max_staleness_mins?: number
- /**
- * @description BigQuery project id
- * @example my-gcp-project
- */
- project_id: string
- /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
- table_options?: {
- tables?: {
- cluster_by?: string[]
- partition_by?:
- | (
- | {
- /**
- * @description Source column name
- * @example created_at
- */
- column: string
- /**
- * @description Partition granularity
- * @example day
- * @enum {string}
- */
- granularity?: 'hour' | 'day' | 'month' | 'year'
- /**
- * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
- * @enum {string}
- */
- kind: 'time_column'
- }
- | {
- /**
- * @description Source column name
- * @example created_at
- */
- column: string
- /**
- * @description Exclusive end of the last partition range
- * @example 100
- */
- end: number
- /**
- * @description Width of each partition range
- * @example 10
- */
- interval: number
- /**
- * @description Partition by ranges of a replicated integer column
- * @enum {string}
- */
- kind: 'integer_range'
- /**
- * @description Inclusive start of the first partition range
- * @example 0
- */
- start: number
- }
- | {
- /**
- * @description Partition granularity
- * @example day
- * @enum {string}
- */
- granularity?: 'hour' | 'day' | 'month' | 'year'
- /**
- * @description Partition by the time at which BigQuery ingests each row
- * @enum {string}
- */
- kind: 'ingestion_time'
- }
- )
- | null
- /**
- * @description Source PostgreSQL table OID, stable across renames for the relation lifetime
- * @example 16384
- */
- table_id: number
- }[]
- }
+ DeleteDestinationPipelineResponse_Output: {
+ /**
+ * @description Whether the destination was deleted. True when no other pipelines remain attached to it.
+ * @example true
+ */
+ destination_deleted: boolean
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ destination_id: number
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ }
+ DestinationResponse_Output: {
+ /** @description Destination configuration */
+ config:
+ | {
+ big_query: {
+ /**
+ * @description Number of concurrent BigQuery Storage Write API connections.
+ * @example 8
+ */
+ connection_pool_size?: number | null
+ /**
+ * @description BigQuery dataset id
+ * @example analytics
+ */
+ dataset_id: string
+ /**
+ * @description Maximum data staleness in minutes
+ * @example 5
+ */
+ max_staleness_mins?: number | null
+ /**
+ * @description BigQuery project id
+ * @example my-gcp-project
+ */
+ project_id: string
+ /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
+ table_options?: {
+ tables?: {
+ cluster_by?: string[]
+ partition_by?:
+ | (
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @enum {string}
+ */
+ kind: 'time_column'
+ }
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Exclusive end of the last partition range
+ * @example 100
+ */
+ end: number
+ /**
+ * @description Width of each partition range
+ * @example 10
+ */
+ interval: number
+ /**
+ * @description Partition by ranges of a replicated integer column
+ * @enum {string}
+ */
+ kind: 'integer_range'
+ /**
+ * @description Inclusive start of the first partition range
+ * @example 0
+ */
+ start: number
+ }
+ | {
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by the time at which BigQuery ingests each row
+ * @enum {string}
+ */
+ kind: 'ingestion_time'
+ }
+ )
+ | null
+ /**
+ * @description Source PostgreSQL table OID, stable across renames for the relation lifetime
+ * @example 16384
+ */
+ table_id: number
+ }[]
}
}
- | {
- clickhouse: {
- /**
- * @description ClickHouse target database
- * @example analytics
- */
- database: string
- /**
- * @description Table engine used for replicated tables. Defaults to `replacing_merge_tree` server-side when omitted.
- * @example replacing_merge_tree
- * @enum {string}
- */
- engine: 'merge_tree' | 'replacing_merge_tree'
- /**
- * @description Persisted ClickHouse HTTP(S) endpoint URL
- * @example http://clickhouse.example.com:8123
- */
- url: string
- /**
- * @description ClickHouse user name
- * @example default
- */
- user: string
- }
+ }
+ | {
+ clickhouse: {
+ /**
+ * @description ClickHouse target database
+ * @example analytics
+ */
+ database: string
+ /**
+ * @description Table engine used for replicated tables. Defaults to `replacing_merge_tree` server-side when omitted.
+ * @example replacing_merge_tree
+ * @enum {string}
+ */
+ engine: 'merge_tree' | 'replacing_merge_tree'
+ /**
+ * @description Persisted ClickHouse HTTP(S) endpoint URL
+ * @example http://clickhouse.example.com:8123
+ */
+ url: string
+ /**
+ * @description ClickHouse user name
+ * @example default
+ */
+ user: string
}
- | {
- iceberg:
- | {
- supabase: {
- /**
- * @description Namespace
- * @example my-namespace
- */
- namespace?: string
- /**
- * @description Project ref
- * @example abcdefghijklmnopqrst
- */
- project_ref: string
- /**
- * @description S3 region
- * @example ap-southeast-1
- */
- s3_region: string
- /**
- * @description Warehouse name
- * @example my-warehouse
- */
- warehouse_name: string
- }
- }
- | {
- rest: {
- /**
- * @description Iceberg REST catalog URI
- * @example https://catalog.example.com
- */
- catalog_uri: string
- /**
- * @description Namespace
- * @example my-namespace
- */
- namespace?: string
- /**
- * @description S3-compatible storage endpoint
- * @example https://s3.example.com
- */
- s3_endpoint: string
- /**
- * @description Warehouse name
- * @example my-warehouse
- */
- warehouse_name: string
- }
+ }
+ | {
+ iceberg:
+ | {
+ supabase: {
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string | null
+ /**
+ * @description Project ref
+ * @example abcdefghijklmnopqrst
+ */
+ project_ref: string
+ /**
+ * @description S3 region
+ * @example ap-southeast-1
+ */
+ s3_region: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
}
- }
- | {
- ducklake: {
- /**
- * @description Persisted DuckLake data path
- * @example s3://<bucket-name>/
- */
- data_path: string
- /**
- * @description Persisted DuckLake metadata schema
- * @example ducklake
- */
- metadata_schema?: string
- /**
- * @description Number of concurrent DuckDB connections.
- * @example 4
- */
- pool_size: number
- /**
- * @description Persisted S3-compatible storage endpoint
- * @example 127.0.0.1:5000/s3
- */
- s3_endpoint?: string
- /**
- * @description S3-compatible storage region
- * @example us-east-1
- */
- s3_region?: string
- /**
- * @description Persisted S3 URL style
- * @example path
- */
- s3_url_style?: string
- /**
- * @description Whether to use SSL for S3-compatible storage
- * @example false
- */
- s3_use_ssl?: boolean
+ }
+ | {
+ rest: {
+ /**
+ * @description Iceberg REST catalog URI
+ * @example https://catalog.example.com
+ */
+ catalog_uri: string
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string | null
+ /**
+ * @description S3-compatible storage endpoint
+ * @example https://s3.example.com
+ */
+ s3_endpoint: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ }
+ | {
+ ducklake: {
+ /**
+ * @description Persisted DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description Persisted DuckLake metadata schema
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description Persisted S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint?: string | null
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region?: string | null
+ /**
+ * @description Persisted S3 URL style
+ * @example path
+ */
+ s3_url_style?: string | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @example false
+ */
+ s3_use_ssl?: boolean | null
+ table_sorting?: {
+ tables: ({
+ schema: string
+ sort_by:
+ | ({
+ columns: ({
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ } & {
+ [key: string]: unknown
+ })[]
+ /** @enum {string} */
+ kind: 'columns'
+ } & {
+ [key: string]: unknown
+ })
+ | ({
+ /** @enum {string} */
+ kind: 'primary_key'
+ } & {
+ [key: string]: unknown
+ })
+ table: string
+ } & {
+ [key: string]: unknown
+ })[]
+ } & {
+ [key: string]: unknown
}
}
- | {
- snowflake: {
- /**
- * @description Snowflake account identifier
- * @example MYORG-MYACCOUNT
- */
- account_id: string
- /**
- * @description Snowflake target database
- * @example ANALYTICS
- */
- database: string
- /**
- * @description Optional Snowflake role
- * @example PIPELINES_ROLE
- */
- role?: string
- /**
- * @description Snowflake target schema
- * @example PUBLIC
- */
- schema: string
- /**
- * @description Snowflake user configured for key-pair authentication
- * @example PIPELINES_USER
- */
- user: string
- }
+ }
+ | {
+ snowflake: {
+ /**
+ * @description Snowflake account identifier
+ * @example MYORG-MYACCOUNT
+ */
+ account_id: string
+ /**
+ * @description Snowflake target database
+ * @example ANALYTICS
+ */
+ database: string
+ /**
+ * @description Optional Snowflake role
+ * @example PIPELINES_ROLE
+ */
+ role?: string | null
+ /**
+ * @description Snowflake target schema
+ * @example PUBLIC
+ */
+ schema: string
+ /**
+ * @description Snowflake user configured for key-pair authentication
+ * @example PIPELINES_USER
+ */
+ user: string
}
- /**
- * @description Destination id
- * @example 2001
- */
- id: number
- /**
- * @description Destination name
- * @example bq-analytics
- */
- name: string
- /**
- * @description Tenant id
- * @example tenant_9f3a2c
- */
- tenant_id: string
- }[]
- }
- ReplicationPipelineReplicationStatusResponse: {
- /** @description Stats about apply worker lag */
- apply_lag?: {
- /**
- * @description Whether the slot currently has an active replication connection.
- * @example true
- */
- active: boolean
- /**
- * @description Bytes between the current WAL location and the confirmed flush LSN.
- * @example 2048
- */
- confirmed_flush_lsn_bytes: number
- /**
- * @description Flush lag expressed in milliseconds.
- * @example 1200
- */
- flush_lag?: number
- /**
- * @description Milliseconds elapsed since the walsender last received client feedback. This can be present even when write and flush lag are unavailable.
- * @example 5000
- */
- reply_time_lag?: number
- /**
- * @description Bytes between the current WAL location and the slot restart LSN.
- * @example 1024
- */
- restart_lsn_bytes: number
- /**
- * @description How many bytes of WAL are still safe to build up before the limit of the slot is reached. `null` means Postgres reports unlimited slot WAL retention.
- * @example 8192
- */
- safe_wal_size_bytes: number | null
- /**
- * @description WAL availability status reported by Postgres for the slot.
- * @example reserved
- * @enum {string}
- */
- wal_status?: 'reserved' | 'extended' | 'unreserved' | 'lost' | 'unknown'
- /**
- * @description Write lag expressed in milliseconds.
- * @example 1500
- */
- write_lag?: number
- }
+ }
/**
- * @description Pipeline id
- * @example 1012
+ * @description Destination id
+ * @example 2001
*/
- pipeline_id: number
- /** @description Table statuses */
- table_statuses: {
- /**
- * @description Table id (Postgres OID)
- * @example 16408
- */
- id: number
- /**
- * @description Table name
- * @example orders
- */
- name: string
- /**
- * @description Table schema
- * @example public
- */
- schema: string
- /** @description Table replication state */
- state:
- | {
- /** @enum {string} */
- name: 'queued'
- }
- | {
- /** @enum {string} */
- name: 'copying_table'
- }
- | {
- /** @enum {string} */
- name: 'copied_table'
- }
- | {
- /** @enum {string} */
- name: 'following_wal'
- }
- | {
- /** @enum {string} */
- name: 'error'
- reason: string
- retry_policy:
- | {
- /** @enum {string} */
- policy: 'no_retry'
- }
- | {
- /** @enum {string} */
- policy: 'manual_retry'
- }
- | {
- /**
- * @description Next retry time (RFC 3339 timestamp)
- * @example 2025-01-02T03:04:05Z
- */
- next_retry: string
- /** @enum {string} */
- policy: 'timed_retry'
- }
- solution?: string
- }
- /**
- * @deprecated
- * @description Deprecated compatibility alias for `id`.
- * @example 16408
- */
- table_id: number
- /**
- * @deprecated
- * @description Deprecated unquoted `schema.name` compatibility representation.
- * @example public.orders
- */
- table_name: string
- /** @description Stats about table sync worker lag */
- table_sync_lag?: {
- /**
- * @description Whether the slot currently has an active replication connection.
- * @example true
- */
- active: boolean
- /**
- * @description Bytes between the current WAL location and the confirmed flush LSN.
- * @example 2048
- */
- confirmed_flush_lsn_bytes: number
- /**
- * @description Flush lag expressed in milliseconds.
- * @example 1200
- */
- flush_lag?: number
- /**
- * @description Milliseconds elapsed since the walsender last received client feedback. This can be present even when write and flush lag are unavailable.
- * @example 5000
- */
- reply_time_lag?: number
- /**
- * @description Bytes between the current WAL location and the slot restart LSN.
- * @example 1024
- */
- restart_lsn_bytes: number
- /**
- * @description How many bytes of WAL are still safe to build up before the limit of the slot is reached. `null` means Postgres reports unlimited slot WAL retention.
- * @example 8192
- */
- safe_wal_size_bytes: number | null
- /**
- * @description WAL availability status reported by Postgres for the slot.
- * @example reserved
- * @enum {string}
- */
- wal_status?: 'reserved' | 'extended' | 'unreserved' | 'lost' | 'unknown'
- /**
- * @description Write lag expressed in milliseconds.
- * @example 1500
- */
- write_lag?: number
- }
- }[]
- }
- /** @description Pipeline */
- ReplicationPipelineResponse: {
- /** @description Pipeline configuration */
- config: {
- /** @description Batch configuration */
- batch?: {
- /**
- * @description Maximum preferred byte size for one source batch
- * @example 8388608
- */
- max_bytes?: number
- /**
- * @description Maximum fill time in milliseconds
- * @example 200
- */
- max_fill_ms?: number
- /**
- * @description Persisted ratio of process memory reserved for incoming stream batch bytes
- * @example 0.2
- */
- memory_budget_ratio?: number
- }
- /**
- * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
- * @example error
- * @enum {string}
- */
- invalidated_slot_behavior?: 'error' | 'recreate'
- /**
- * @description Replicator log level
- * @example info
- * @enum {string}
- */
- log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error'
- /** @description Maximum number of copy connections per table */
- max_copy_connections_per_table?: number
- /** @description Maximum number of table sync workers */
- max_table_sync_workers?: number
- /** @description Memory-based backpressure configuration */
- memory_backpressure?: {
- /**
- * @description Persisted memory usage ratio that activates backpressure
- * @example 0.85
- */
- activate_threshold: number
- /**
- * @description Persisted memory usage ratio that releases backpressure
- * @example 0.75
- */
- resume_threshold: number
- }
- /**
- * @description Milliseconds between one memory usage refresh and another
- * @example 100
- */
- memory_refresh_interval_ms?: number
- /**
- * @description Publication name
- * @example pub_orders
- */
- publication_name: string
- /**
- * @description Milliseconds between one replication lag refresh and another
- * @example 10000
- */
- replication_lag_refresh_interval_ms?: number
- /**
- * @description Milliseconds between one retry and another for timed worker retries
- * @example 10000
- */
- table_error_retry_delay_ms?: number
- /**
- * @description Maximum number of automatic timed retry attempts
- * @example 5
- */
- table_error_retry_max_attempts?: number
- /** @description Selection rules for tables participating in initial table copy */
- table_sync_copy?:
- | {
- /** @enum {string} */
- type: 'include_all_tables'
- }
- | {
- /** @enum {string} */
- type: 'skip_all_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be performed
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'include_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be skipped
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'skip_tables'
- }
- }
- /**
- * @description Destination id
- * @example 2001
- */
- destination_id: number
+ id: number
/**
* @description Destination name
* @example bq-analytics
*/
- destination_name: string
- /**
- * @description Pipeline id
- * @example 1012
- */
- id: number
- /**
- * @description Replicator id
- * @example 9001
- */
- replicator_id: number
- /**
- * @description Source id
- * @example 3001
- */
- source_id: number
- /**
- * @description Source name
- * @example main-db
- */
- source_name: string
+ name: string
/**
* @description Tenant id
* @example tenant_9f3a2c
*/
tenant_id: string
}
- ReplicationPipelinesResponse: {
- /** @description List of pipelines */
- pipelines: {
- /** @description Pipeline configuration */
- config: {
- /** @description Batch configuration */
- batch?: {
- /**
- * @description Maximum preferred byte size for one source batch
- * @example 8388608
- */
- max_bytes?: number
- /**
- * @description Maximum fill time in milliseconds
- * @example 200
- */
- max_fill_ms?: number
- /**
- * @description Persisted ratio of process memory reserved for incoming stream batch bytes
- * @example 0.2
- */
- memory_budget_ratio?: number
+ UpdateDestinationBody: {
+ /** @description Destination configuration */
+ config:
+ | {
+ big_query: {
+ /**
+ * @description Number of concurrent BigQuery Storage Write API connections.
+ * @example 8
+ */
+ connection_pool_size?: number | null
+ /**
+ * @description BigQuery dataset id
+ * @example analytics
+ */
+ dataset_id?: string | null
+ /**
+ * @description Maximum data staleness in minutes
+ * @example 5
+ */
+ max_staleness_mins?: number | null
+ /**
+ * @description BigQuery project id
+ * @example my-gcp-project
+ */
+ project_id?: string | null
+ /** @description BigQuery service account key */
+ service_account_key?: string | null
+ /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
+ table_options?: {
+ tables?: {
+ cluster_by?: string[]
+ partition_by?:
+ | (
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @enum {string}
+ */
+ kind: 'time_column'
+ }
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Exclusive end of the last partition range
+ * @example 100
+ */
+ end: number
+ /**
+ * @description Width of each partition range
+ * @example 10
+ */
+ interval: number
+ /**
+ * @description Partition by ranges of a replicated integer column
+ * @enum {string}
+ */
+ kind: 'integer_range'
+ /**
+ * @description Inclusive start of the first partition range
+ * @example 0
+ */
+ start: number
+ }
+ | {
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by the time at which BigQuery ingests each row
+ * @enum {string}
+ */
+ kind: 'ingestion_time'
+ }
+ )
+ | null
+ /**
+ * @description Source PostgreSQL table OID, stable across renames for the relation lifetime
+ * @example 16384
+ */
+ table_id: number
+ }[]
+ } | null
+ }
}
- /**
- * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
- * @example error
- * @enum {string}
- */
- invalidated_slot_behavior?: 'error' | 'recreate'
- /**
- * @description Replicator log level
- * @example info
- * @enum {string}
- */
- log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error'
- /** @description Maximum number of copy connections per table */
- max_copy_connections_per_table?: number
- /** @description Maximum number of table sync workers */
- max_table_sync_workers?: number
- /** @description Memory-based backpressure configuration */
- memory_backpressure?: {
- /**
- * @description Persisted memory usage ratio that activates backpressure
- * @example 0.85
- */
- activate_threshold: number
- /**
- * @description Persisted memory usage ratio that releases backpressure
- * @example 0.75
- */
- resume_threshold: number
+ | {
+ clickhouse: {
+ /**
+ * @description ClickHouse target database
+ * @example analytics
+ */
+ database?: string | null
+ /**
+ * @description Table engine used for replicated tables. Defaults to `replacing_merge_tree` server-side when omitted.
+ * @example replacing_merge_tree
+ * @enum {string|null}
+ */
+ engine?: 'merge_tree' | 'replacing_merge_tree' | null
+ /** @description ClickHouse password. Omit for passwordless access. */
+ password?: string | null
+ /**
+ * @description ClickHouse HTTPS endpoint URL
+ * @example https://clickhouse.example.com:8443
+ */
+ url?: string | null
+ /**
+ * @description ClickHouse user name
+ * @example default
+ */
+ user?: string | null
+ }
}
- /**
- * @description Milliseconds between one memory usage refresh and another
- * @example 100
- */
- memory_refresh_interval_ms?: number
- /**
- * @description Publication name
- * @example pub_orders
- */
- publication_name: string
- /**
- * @description Milliseconds between one replication lag refresh and another
- * @example 10000
- */
- replication_lag_refresh_interval_ms?: number
- /**
- * @description Milliseconds between one retry and another for timed worker retries
- * @example 10000
- */
- table_error_retry_delay_ms?: number
- /**
- * @description Maximum number of automatic timed retry attempts
- * @example 5
- */
- table_error_retry_max_attempts?: number
- /** @description Selection rules for tables participating in initial table copy */
- table_sync_copy?:
- | {
- /** @enum {string} */
- type: 'include_all_tables'
- }
- | {
- /** @enum {string} */
- type: 'skip_all_tables'
- }
- | {
+ | {
+ iceberg: {
+ supabase: {
/**
- * @description Table ids for which copy should be performed
- * @example [
- * 16408
- * ]
+ * @description Catalog token
+ * @example A jwt secret
*/
- table_ids: number[]
- /** @enum {string} */
- type: 'include_tables'
- }
- | {
+ catalog_token?: string | null
/**
- * @description Table ids for which copy should be skipped
- * @example [
- * 16408
- * ]
+ * @description Namespace
+ * @example my-namespace
*/
- table_ids: number[]
- /** @enum {string} */
- type: 'skip_tables'
+ namespace?: string | null
+ /**
+ * @description Project ref
+ * @example abcdefghijklmnopqrst
+ */
+ project_ref?: string | null
+ /**
+ * @description S3 access key ID
+ * @example 53383b1d0cdb16a3afa63152656aa3cc
+ */
+ s3_access_key_id?: string | null
+ /**
+ * @description S3 region
+ * @example ap-southeast-1
+ */
+ s3_region?: string | null
+ /**
+ * @description S3 secret access key
+ * @example 25a0c5e69d847088a3e6ffb901adf4d19bbf74a400dec2ee49f46401039b3258
+ */
+ s3_secret_access_key?: string | null
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name?: string | null
}
- }
- /**
- * @description Destination id
- * @example 2001
- */
- destination_id: number
- /**
- * @description Destination name
- * @example bq-analytics
- */
- destination_name: string
- /**
- * @description Pipeline id
- * @example 1012
- */
- id: number
- /**
- * @description Replicator id
- * @example 9001
- */
- replicator_id: number
- /**
- * @description Source id
- * @example 3001
- */
- source_id: number
- /**
- * @description Source name
- * @example main-db
- */
- source_name: string
- /**
- * @description Tenant id
- * @example tenant_9f3a2c
- */
- tenant_id: string
- }[]
- }
- ReplicationPipelineStatusResponse: {
- /**
- * @description Pipeline id
- * @example 1012
- */
- pipeline_id: number
- /** @description Pipeline status */
- status: {
- /**
- * @example started
- * @enum {string}
- */
- name: 'stopped' | 'starting' | 'started' | 'stopping' | 'unknown' | 'failed'
- }
- }
- ReplicationPipelineVersionResponse: {
- /** @description New pipeline version */
- new_version?: {
- /**
- * @description Version id
- * @example 3
- */
- id: number
- /**
- * @description Version name
- * @example v0.3.0
- */
- name: string
- }
- /**
- * @description Pipeline id
- * @example 1012
- */
- pipeline_id: number
- /** @description Current pipeline version */
- version: {
- /**
- * @description Version id
- * @example 3
- */
- id: number
- /**
- * @description Version name
- * @example v0.3.0
- */
- name: string
- }
- }
- ReplicationPublicationsResponse: {
- /** @description List of publications */
- publications: {
- /**
- * @description Publication name
- * @example pub_orders
- */
- name: string
- /** @description Publication tables */
- tables: {
- /**
- * @description Table id (Postgres OID)
- * @example 16408
- */
- id: number
- /**
- * @description Table name
- * @example orders
- */
- name: string
- /**
- * @description Table schema
- * @example public
- */
- schema: string
- }[]
- }[]
- }
- ReplicationSourcesResponse: {
- /** @description List of sources */
- sources: {
- /** @description Source configuration */
- config: {
- /**
- * @description Source host
- * @example db.internal
- */
- host: string
- /**
- * @description Source name
- * @example main-db
- */
- name: string
- /**
- * @description Source port
- * @example 5432
- */
- port: number
- /**
- * @description Source username
- * @example etl_user
- */
- username: string
- }
- /**
- * @description Source id
- * @example 3001
- */
- id: number
- /**
- * @description Source name
- * @example main-db
- */
- name: string
- /**
- * @description Tenant id
- * @example tenant_9f3a2c
- */
- tenant_id: string
- }[]
- }
- ReplicationTablesResponse: {
- /** @description List of tables */
- tables: {
- /**
- * @description Table id (Postgres OID)
- * @example 16408
- */
- id: number
- /**
- * @description Table name
- * @example orders
- */
- name: string
- /**
- * @description Table schema
- * @example public
- */
- schema: string
- }[]
- }
- RequestUpgradeBody: {
- note?: string
- /** @enum {string} */
- requested_plan: 'Pro' | 'Team' | 'Enterprise'
- }
- RequestUpgradeResponse: {
- message: string
- }
- ResetPasswordBody: {
- /** Format: email */
- email: string
- /** Format: uri */
- redirectTo?: string
- }
- ResizeBody: {
- volume_size_gb: number
- }
- ResolveConversationBody: {
- /** @enum {string} */
- aiSupportStatus: 'user_resolved' | 'bot_resolved'
- chatId: string
- conversationId: string
- }
- RestartProjectBody: {
- database_identifier?: string
- }
- RestartServicesBody: {
- restartRequest: {
- database_identifier?: string
- region: string
- services: (
- | 'adminapi'
- | 'api-gateway'
- | 'envoy'
- | 'functions'
- | 'gotrue'
- | 'kong'
- | 'pgbouncer'
- | 'pgsodium'
- | 'postgresql'
- | 'postgrest'
- | 'realtime'
- | 'storage'
- | 'walg'
- | 'autoshutdown'
- )[]
- source_notification_id?: string
- }
- }
- RestoreLogicalBackupBody: {
- id: number
- }
- RestorePhysicalBackupBody: {
- id: number
- recovery_time_target?: string
- }
- RevokeAuthorizedOAuthAppResponse: {
- authorized_at?: string
- icon?: string
- id: string
- name: string
- website: string
- }
- RollbackTablesBody: {
- /**
- * @description Rollback type
- * @example individual
- * @enum {string}
- */
- rollback_type: 'individual' | 'full'
- /** @description Rollback target */
- target:
- | {
- /**
- * @description Table id (Postgres OID)
- * @example 16408
- */
- table_id: number
- /** @enum {string} */
- type: 'single_table'
+ }
}
| {
- /** @enum {string} */
- type: 'all_errored_tables'
- }
+ ducklake:
+ | {
+ /**
+ * @description DuckLake catalog URL
+ * @example postgres://user:pass@localhost:5432/ducklake_catalog
+ */
+ catalog_url?: string | null
+ /**
+ * @description DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path?: string | null
+ /**
+ * @description Schema used for DuckLake metadata tables stored in PostgreSQL
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description S3-compatible storage access key ID
+ * @example my-access-key
+ */
+ s3_access_key_id?: string | null
+ /**
+ * @description S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint?: string | null
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region?: string | null
+ /**
+ * @description S3-compatible storage secret access key
+ * @example my-secret-key
+ */
+ s3_secret_access_key?: string | null
+ /**
+ * @description S3 URL style: `path` (MinIO/Supabase) or `vhost` (AWS)
+ * @example path
+ * @enum {string|null}
+ */
+ s3_url_style?: 'path' | 'vhost' | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @example false
+ */
+ s3_use_ssl?: boolean | null
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ } | null
+ }
+ | {
+ catalog:
+ | {
+ /**
+ * @description DuckLake catalog URL
+ * @example postgres://user:pass@localhost:5432/ducklake_catalog
+ */
+ catalog_url: string
+ /**
+ * @description Schema used for DuckLake metadata tables stored in this PostgreSQL catalog. Overrides `metadata_schema` when provided.
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /** @enum {string} */
+ type: 'postgres_url'
+ }
+ | {
+ /**
+ * @description Schema used for DuckLake metadata tables stored in this PostgreSQL catalog. Overrides `metadata_schema` when provided.
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description Supabase project ref used as the DuckLake PostgreSQL catalog
+ * @example abcjuqabhgwjjutfvtpa
+ */
+ project_ref: string
+ /** @enum {string} */
+ type: 'supabase_project'
+ }
+ /**
+ * @description Schema used for DuckLake metadata tables stored in PostgreSQL
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ storage:
+ | {
+ /**
+ * @description DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description S3-compatible storage access key ID
+ * @example my-access-key
+ */
+ s3_access_key_id: string
+ /**
+ * @description S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint: string
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region: string
+ /**
+ * @description S3-compatible storage secret access key
+ * @example my-secret-key
+ */
+ s3_secret_access_key: string
+ /**
+ * @description S3 URL style: `path` (MinIO/Supabase) or `vhost` (AWS)
+ * @example path
+ * @enum {string|null}
+ */
+ s3_url_style?: 'path' | 'vhost' | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @example false
+ */
+ s3_use_ssl?: boolean | null
+ /** @enum {string} */
+ type: 's3'
+ }
+ | {
+ /**
+ * @description Storage bucket id used for DuckLake data files
+ * @example ducklake
+ */
+ bucket: string
+ /**
+ * @description Optional description for the generated Supabase Storage S3 credential
+ * @example DuckLake replication destination
+ */
+ credential_description?: string
+ /**
+ * @description Optional path prefix inside the bucket for DuckLake data files
+ * @example replication
+ */
+ path?: string
+ /**
+ * @description Supabase project ref whose Object Storage S3 API stores DuckLake data files
+ * @example abcjuqabhgwjjutfvtpa
+ */
+ project_ref: string
+ /** @enum {string} */
+ type: 'supabase_storage'
+ }
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ } | null
+ }
+ }
| {
- /** @enum {string} */
- type: 'all_tables'
+ snowflake: {
+ /**
+ * @description Snowflake account identifier
+ * @example MYORG-MYACCOUNT
+ */
+ account_id?: string | null
+ /**
+ * @description Snowflake target database
+ * @example ANALYTICS
+ */
+ database?: string | null
+ /** @description Snowflake RSA private key PEM contents */
+ private_key?: string | null
+ /** @description Optional passphrase for encrypted private keys */
+ private_key_passphrase?: string | null
+ /**
+ * @description Optional Snowflake role
+ * @example PIPELINES_ROLE
+ */
+ role?: string | null
+ /**
+ * @description Snowflake target schema
+ * @example PUBLIC
+ */
+ schema?: string | null
+ /**
+ * @description Snowflake user configured for key-pair authentication
+ * @example PIPELINES_USER
+ */
+ user?: string | null
+ }
}
- }
- RollbackTablesResponse: {
/**
- * @description Pipeline id
- * @example 1012
+ * @description Destination name
+ * @example bq-analytics
*/
- pipeline_id: number
- /** @description Rolled back tables */
- tables: {
- /** @description Table replication state */
- new_state:
- | {
- /** @enum {string} */
- name: 'queued'
- }
- | {
- /** @enum {string} */
- name: 'copying_table'
- }
- | {
- /** @enum {string} */
- name: 'copied_table'
- }
- | {
- /** @enum {string} */
- name: 'following_wal'
- }
- | {
- /** @enum {string} */
- name: 'error'
- reason: string
- retry_policy:
- | {
- /** @enum {string} */
- policy: 'no_retry'
- }
- | {
- /** @enum {string} */
- policy: 'manual_retry'
- }
- | {
- /**
- * @description Next retry time (RFC 3339 timestamp)
- * @example 2025-01-02T03:04:05Z
- */
- next_retry: string
- /** @enum {string} */
- policy: 'timed_retry'
- }
- solution?: string
- }
- /**
- * @description Table id (Postgres OID)
- * @example 16408
- */
- table_id: number
- }[]
- }
- RunQueryBody: {
- /** @default false */
- disable_statement_timeout?: boolean
- parameters?: unknown[]
- query: string
- }
- SendExitSurveyBody: {
- additionalFeedback?: string
- exitAction?: string
- orgSlug?: string
- projectRef?: string
- reasons: string
- }
- SendFeedbackBody: {
- additionalRedirectUrls?: string
- affectedServices?: string
- allowSupportAccess?: boolean
- browserInformation?: string
- category: string
- dashboardLogs?: string
- dashboardSentryIssueId?: string
- dashboardStudioVersion?: string
- library?: string
- message: string
- organizationSlug?: string
- pathname?: string
- projectRef?: string
- severity?: string
- siteUrl?: string
- subject?: string
- tags: string[]
- threadRef?: string
- urlToAirTable?: string
- verified?: boolean
- }
- SendFeedbackResponse: {
- conversationId?: string
- result: string
- }
- SendUpgradeSurveyBody: {
- additionalFeedback?: string
- currentPlan?: string
- orgSlug?: string
- prevPlan?: string
- reasons: string[]
- }
- ServiceVersions: {
- gotrue?: string
- postgrest?: string
- 'supabase-postgres': string
- }
- SetupIntentRequest: {
- hcaptchaToken?: string
- }
- SetupIntentResponse: {
- client_secret: string
- pending_subscription_flow_enabled_for_creation: boolean
- }
- SignedUrlResponse: {
- signedUrl: string
- }
- SignedUrlsResponse: {
- error: string | null
- path: string | null
- signedUrl: string | null
- }
- SignUpBody: {
- /** Format: email */
- email: string
- password: string
- /** Format: uri */
- redirectTo?: string
- }
- StorageAnalyticsBucketDeleteResponse: {
- message: string
- }
- StorageAnalyticsBucketNamespaceTablesResponse: {
- data: {
- name: string
- namespace: string[]
- }[]
- }
- StorageAnalyticsBucketResponse: {
- created_at: string
- name: string
- updated_at: string
- }
- StorageAnalyticsBucketsResponse: {
- data: {
- created_at: string
- name: string
- updated_at: string
- }[]
- }
- StorageBucketResponse: {
- allowed_mime_types?: string[]
- created_at: string
- file_size_limit?: number
- id: string
- name: string
- owner: string
- public: boolean
- type?: ('STANDARD' | 'ANALYTICS') | string
- updated_at: string
- }
- StorageConfigResponse: {
- capabilities: {
- iceberg_catalog: boolean
- list_v2: boolean
- }
- databasePoolMode: string
- external: {
- /** @enum {string} */
- upstreamTarget: 'main' | 'canary'
- }
- features: {
- icebergCatalog: {
- enabled: boolean
- maxCatalogs: number
- maxNamespaces: number
- maxTables: number
- }
- imageTransformation: {
- enabled: boolean
- }
- purgeCache: {
- enabled: boolean
- }
- s3Protocol: {
- enabled: boolean
- }
- vectorBuckets: {
- enabled: boolean
- maxBuckets: number
- maxIndexes: number
- }
- }
- /** Format: int64 */
- fileSizeLimit: number
- migrationVersion: string
- }
- StorageListResponseV2: {
- folders: {
- key?: string
- name: string
- }[]
- hasNext: boolean
- nextCursor?: string
- objects: {
- created_at: string
- id: string
- key?: string
- last_accessed_at: string
- metadata: {
- cacheControl?: string | null
- contentLength?: number | null
- eTag?: string | null
- httpStatusCode?: number | null
- lastModified?: string | null
- mimetype?: string | null
- size?: number | null
- } | null
- name: string
- updated_at: string
- }[]
- }
- StorageObject: {
- bucket_id?: string
- buckets?: {
- allowed_mime_types?: string[]
- created_at: string
- file_size_limit?: number
- id: string
- name: string
- owner: string
- public: boolean
- type?: ('STANDARD' | 'ANALYTICS') | string
- updated_at: string
- }
- created_at: string | null
- id: string | null
- last_accessed_at: string | null
- metadata: {
- [key: string]: unknown
- } | null
name: string
- owner?: string
- updated_at: string | null
- }
- StorageVectorBucketListIndexesResponse: {
- indexes: {
- creationTime?: number
- dataType: 'float32' | string
- dimension: number
- distanceMetric: ('cosine' | 'euclidean' | 'dotproduct') | string
- indexName: string
- metadataConfiguration?: {
- nonFilterableMetadataKeys?: string[]
- }
- vectorBucketName: string
- }[]
- nextToken?: string
- }
- StorageVectorBucketResponse: {
- vectorBucketName: string
- }
- StorageVectorBucketsResponse: {
- nextToken?: string
- vectorBuckets: {
- vectorBucketName: string
- }[]
}
- SupavisorConfigResponse: {
- connection_string: string
- /** @description Use connection_string instead */
- connectionString: string
- /** @enum {string} */
- database_type: 'PRIMARY' | 'READ_REPLICA'
- db_host: string
- db_name: string
- db_port: number
- db_user: string
- default_pool_size: number | null
- identifier: string
- is_using_scram_auth: boolean
- max_client_conn: number | null
+ ValidateDestinationBody: {
+ /** @description Destination configuration */
+ config:
+ | {
+ big_query: {
+ /**
+ * @description Number of concurrent BigQuery Storage Write API connections.
+ * @example 8
+ */
+ connection_pool_size?: number | null
+ /**
+ * @description BigQuery dataset id
+ * @example analytics
+ */
+ dataset_id: string
+ /**
+ * @description Maximum data staleness in minutes
+ * @example 5
+ */
+ max_staleness_mins?: number | null
+ /**
+ * @description BigQuery project id
+ * @example my-gcp-project
+ */
+ project_id: string
+ /** @description BigQuery service account key */
+ service_account_key: string
+ /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
+ table_options?: {
+ tables?: {
+ cluster_by?: string[]
+ partition_by?:
+ | (
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @enum {string}
+ */
+ kind: 'time_column'
+ }
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Exclusive end of the last partition range
+ * @example 100
+ */
+ end: number
+ /**
+ * @description Width of each partition range
+ * @example 10
+ */
+ interval: number
+ /**
+ * @description Partition by ranges of a replicated integer column
+ * @enum {string}
+ */
+ kind: 'integer_range'
+ /**
+ * @description Inclusive start of the first partition range
+ * @example 0
+ */
+ start: number
+ }
+ | {
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by the time at which BigQuery ingests each row
+ * @enum {string}
+ */
+ kind: 'ingestion_time'
+ }
+ )
+ | null
+ /**
+ * @description Source PostgreSQL table OID, stable across renames for the relation lifetime
+ * @example 16384
+ */
+ table_id: number
+ }[]
+ }
+ }
+ }
+ | {
+ clickhouse: {
+ /**
+ * @description ClickHouse target database
+ * @example analytics
+ */
+ database: string
+ /**
+ * @description Table engine used for replicated tables. Defaults to `replacing_merge_tree` server-side when omitted.
+ * @example replacing_merge_tree
+ * @enum {string}
+ */
+ engine?: 'merge_tree' | 'replacing_merge_tree'
+ /** @description ClickHouse password. Omit for passwordless access. */
+ password?: string | null
+ /**
+ * @description ClickHouse HTTPS endpoint URL
+ * @example https://clickhouse.example.com:8443
+ */
+ url: string
+ /**
+ * @description ClickHouse user name
+ * @example default
+ */
+ user: string
+ }
+ }
+ | {
+ iceberg: {
+ supabase: {
+ /**
+ * @description Catalog token
+ * @example A jwt secret
+ */
+ catalog_token: string
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string | null
+ /**
+ * @description Project ref
+ * @example abcdefghijklmnopqrst
+ */
+ project_ref: string
+ /**
+ * @description S3 access key ID
+ * @example 53383b1d0cdb16a3afa63152656aa3cc
+ */
+ s3_access_key_id: string
+ /**
+ * @description S3 region
+ * @example ap-southeast-1
+ */
+ s3_region: string
+ /**
+ * @description S3 secret access key
+ * @example 25a0c5e69d847088a3e6ffb901adf4d19bbf74a400dec2ee49f46401039b3258
+ */
+ s3_secret_access_key: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ }
+ | {
+ ducklake:
+ | {
+ /**
+ * @description DuckLake catalog URL
+ * @example postgres://user:pass@localhost:5432/ducklake_catalog
+ */
+ catalog_url: string
+ /**
+ * @description DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description Schema used for DuckLake metadata tables stored in PostgreSQL
+ * @default ducklake
+ * @example ducklake
+ */
+ metadata_schema?: string
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description S3-compatible storage access key ID
+ * @example my-access-key
+ */
+ s3_access_key_id?: string | null
+ /**
+ * @description S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint?: string | null
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region?: string | null
+ /**
+ * @description S3-compatible storage secret access key
+ * @example my-secret-key
+ */
+ s3_secret_access_key?: string | null
+ /**
+ * @description S3 URL style: `path` (MinIO/Supabase) or `vhost` (AWS)
+ * @example path
+ * @enum {string|null}
+ */
+ s3_url_style?: 'path' | 'vhost' | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @default true
+ * @example false
+ */
+ s3_use_ssl?: boolean
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ }
+ }
+ | {
+ catalog:
+ | {
+ /**
+ * @description DuckLake catalog URL
+ * @example postgres://user:pass@localhost:5432/ducklake_catalog
+ */
+ catalog_url: string
+ /**
+ * @description Schema used for DuckLake metadata tables stored in this PostgreSQL catalog. Overrides `metadata_schema` when provided.
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /** @enum {string} */
+ type: 'postgres_url'
+ }
+ | {
+ /**
+ * @description Schema used for DuckLake metadata tables stored in this PostgreSQL catalog. Overrides `metadata_schema` when provided.
+ * @example ducklake
+ */
+ metadata_schema?: string | null
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ /**
+ * @description Supabase project ref used as the DuckLake PostgreSQL catalog
+ * @example abcjuqabhgwjjutfvtpa
+ */
+ project_ref: string
+ /** @enum {string} */
+ type: 'supabase_project'
+ }
+ /**
+ * @description Schema used for DuckLake metadata tables stored in PostgreSQL
+ * @default ducklake
+ * @example ducklake
+ */
+ metadata_schema?: string
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size?: number | null
+ storage:
+ | {
+ /**
+ * @description DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description S3-compatible storage access key ID
+ * @example my-access-key
+ */
+ s3_access_key_id: string
+ /**
+ * @description S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint: string
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region: string
+ /**
+ * @description S3-compatible storage secret access key
+ * @example my-secret-key
+ */
+ s3_secret_access_key: string
+ /**
+ * @description S3 URL style: `path` (MinIO/Supabase) or `vhost` (AWS)
+ * @example path
+ * @enum {string|null}
+ */
+ s3_url_style?: 'path' | 'vhost' | null
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @default true
+ * @example false
+ */
+ s3_use_ssl?: boolean
+ /** @enum {string} */
+ type: 's3'
+ }
+ | {
+ /**
+ * @description Storage bucket id used for DuckLake data files
+ * @example ducklake
+ */
+ bucket: string
+ /**
+ * @description Optional description for the generated Supabase Storage S3 credential
+ * @example DuckLake replication destination
+ */
+ credential_description?: string
+ /**
+ * @description Optional path prefix inside the bucket for DuckLake data files
+ * @example replication
+ */
+ path?: string
+ /**
+ * @description Supabase project ref whose Object Storage S3 API stores DuckLake data files
+ * @example abcjuqabhgwjjutfvtpa
+ */
+ project_ref: string
+ /** @enum {string} */
+ type: 'supabase_storage'
+ }
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ }
+ }
+ }
+ | {
+ snowflake: {
+ /**
+ * @description Snowflake account identifier
+ * @example MYORG-MYACCOUNT
+ */
+ account_id: string
+ /**
+ * @description Snowflake target database
+ * @example ANALYTICS
+ */
+ database: string
+ /** @description Snowflake RSA private key PEM contents */
+ private_key: string
+ /** @description Optional passphrase for encrypted private keys */
+ private_key_passphrase?: string | null
+ /**
+ * @description Optional Snowflake role
+ * @example PIPELINES_ROLE
+ */
+ role?: string | null
+ /**
+ * @description Snowflake target schema
+ * @example PUBLIC
+ */
+ schema: string
+ /**
+ * @description Snowflake user configured for key-pair authentication
+ * @example PIPELINES_USER
+ */
+ user: string
+ }
+ }
+ /** @description Pipeline configuration */
+ pipeline_config?: {
+ /** @description Batch configuration. Omit or use `null` for server defaults. */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Memory-based backpressure configuration. Omission enables server defaults; `null` disables it. */
+ memory_backpressure?: {
+ /**
+ * @description Memory usage ratio above which backpressure is activated
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Memory usage ratio below which backpressure is released
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
+ table_sync_copy?:
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
+ } | null
+ /**
+ * @description Source id
+ * @example 1
+ */
+ source_id?: number | null
+ }
+ ValidateDestinationResponse_Output: {
+ /** @description List of validation failures */
+ validation_failures: {
+ /**
+ * @description Failure type
+ * @example critical
+ * @enum {string}
+ */
+ failure_type: 'critical' | 'warning'
+ /**
+ * @description Validation failure name
+ * @example Validation Failed
+ */
+ name: string
+ /**
+ * @description Validation failure reason
+ * @example The configuration is invalid
+ */
+ reason: string
+ }[]
+ }
+ PipelinesResponse_Output: {
+ /** @description List of pipelines */
+ pipelines: {
+ /** @description Pipeline configuration */
+ config: {
+ /** @description Batch configuration */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Persisted ratio of process memory reserved for incoming stream batch bytes
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Memory-based backpressure configuration */
+ memory_backpressure?: {
+ /**
+ * @description Persisted memory usage ratio that activates backpressure
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Persisted memory usage ratio that releases backpressure
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Selection rules for tables participating in initial table copy */
+ table_sync_copy?:
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ destination_id: number
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ destination_name: string
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ id: number
+ /**
+ * @description Replicator id
+ * @example 9001
+ */
+ replicator_id: number
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ source_name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }[]
+ }
+ CreatePipelineBody: {
+ /** @description Pipeline configuration */
+ config: {
+ /** @description Batch configuration. Omit or use `null` for server defaults. */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Memory-based backpressure configuration. Omission enables server defaults; `null` disables it. */
+ memory_backpressure?: {
+ /**
+ * @description Memory usage ratio above which backpressure is activated
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Memory usage ratio below which backpressure is released
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
+ table_sync_copy?:
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ destination_id: number
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ }
+ CreatePipelineResponse_Output: {
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ id: number
+ }
+ PipelineResponse_Output: {
+ /** @description Pipeline configuration */
+ config: {
+ /** @description Batch configuration */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Persisted ratio of process memory reserved for incoming stream batch bytes
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Memory-based backpressure configuration */
+ memory_backpressure?: {
+ /**
+ * @description Persisted memory usage ratio that activates backpressure
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Persisted memory usage ratio that releases backpressure
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Selection rules for tables participating in initial table copy */
+ table_sync_copy?:
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ destination_id: number
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ destination_name: string
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ id: number
+ /**
+ * @description Replicator id
+ * @example 9001
+ */
+ replicator_id: number
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ source_name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }
+ UpdatePipelineBody: {
+ /** @description Pipeline configuration patch */
+ config: {
+ /** @description Complete batch configuration replacement. Omission preserves it; `null` resets server defaults. */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Complete memory backpressure replacement. Omission preserves it; `null` resets server defaults. */
+ memory_backpressure?: {
+ /**
+ * @description Memory usage ratio above which backpressure is activated
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Memory usage ratio below which backpressure is released
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name. Omission preserves the stored value; Pipelines rejects clearing it with `null`.
+ * @example pub_orders
+ */
+ publication_name?: string | null
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Initial-copy selection. Omission preserves it; `null` resets to copying all tables. */
+ table_sync_copy?:
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ destination_id: number
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ }
+ PipelineReplicationStatusResponse_Output: {
+ /** @description Stats about apply worker lag */
+ apply_lag?: {
+ /**
+ * @description Whether the slot currently has an active replication connection.
+ * @example true
+ */
+ active: boolean
+ /**
+ * @description Bytes between the current WAL location and the confirmed flush LSN.
+ * @example 2048
+ */
+ confirmed_flush_lsn_bytes: number
+ /**
+ * @description Flush lag expressed in milliseconds.
+ * @example 1200
+ */
+ flush_lag?: number | null
+ /**
+ * @description Milliseconds elapsed since the walsender last received client feedback. This can be present even when write and flush lag are unavailable.
+ * @example 5000
+ */
+ reply_time_lag?: number | null
+ /**
+ * @description Bytes between the current WAL location and the slot restart LSN.
+ * @example 1024
+ */
+ restart_lsn_bytes: number
+ /**
+ * @description How many bytes of WAL are still safe to build up before the limit of the slot is reached. `null` means Postgres reports unlimited slot WAL retention.
+ * @example 8192
+ */
+ safe_wal_size_bytes?: number | null
+ /**
+ * @description WAL availability status reported by Postgres for the slot.
+ * @example reserved
+ * @enum {string|null}
+ */
+ wal_status?: 'reserved' | 'extended' | 'unreserved' | 'lost' | 'unknown' | null
+ /**
+ * @description Write lag expressed in milliseconds.
+ * @example 1500
+ */
+ write_lag?: number | null
+ } | null
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Table statuses */
+ table_statuses: {
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ /** @description Table replication state */
+ state:
+ | {
+ /** @enum {string} */
+ name: 'queued'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copying_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copied_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'following_wal'
+ }
+ | {
+ /** @enum {string} */
+ name: 'error'
+ reason: string
+ retry_policy:
+ | {
+ /** @enum {string} */
+ policy: 'no_retry'
+ }
+ | {
+ /** @enum {string} */
+ policy: 'manual_retry'
+ }
+ | {
+ /**
+ * @description Next retry time (RFC 3339 timestamp)
+ * @example 2025-01-02T03:04:05Z
+ */
+ next_retry: string
+ /** @enum {string} */
+ policy: 'timed_retry'
+ }
+ solution?: string | null
+ }
+ /**
+ * @deprecated
+ * @description Deprecated compatibility alias for `id`.
+ * @example 16408
+ */
+ table_id: number
+ /**
+ * @deprecated
+ * @description Deprecated unquoted `schema.name` compatibility representation.
+ * @example public.orders
+ */
+ table_name: string
+ /** @description Stats about table sync worker lag */
+ table_sync_lag?: {
+ /**
+ * @description Whether the slot currently has an active replication connection.
+ * @example true
+ */
+ active: boolean
+ /**
+ * @description Bytes between the current WAL location and the confirmed flush LSN.
+ * @example 2048
+ */
+ confirmed_flush_lsn_bytes: number
+ /**
+ * @description Flush lag expressed in milliseconds.
+ * @example 1200
+ */
+ flush_lag?: number | null
+ /**
+ * @description Milliseconds elapsed since the walsender last received client feedback. This can be present even when write and flush lag are unavailable.
+ * @example 5000
+ */
+ reply_time_lag?: number | null
+ /**
+ * @description Bytes between the current WAL location and the slot restart LSN.
+ * @example 1024
+ */
+ restart_lsn_bytes: number
+ /**
+ * @description How many bytes of WAL are still safe to build up before the limit of the slot is reached. `null` means Postgres reports unlimited slot WAL retention.
+ * @example 8192
+ */
+ safe_wal_size_bytes?: number | null
+ /**
+ * @description WAL availability status reported by Postgres for the slot.
+ * @example reserved
+ * @enum {string|null}
+ */
+ wal_status?: 'reserved' | 'extended' | 'unreserved' | 'lost' | 'unknown' | null
+ /**
+ * @description Write lag expressed in milliseconds.
+ * @example 1500
+ */
+ write_lag?: number | null
+ } | null
+ }[]
+ }
+ /** @description Pipeline */
+ RollbackTablesResponse_Output: {
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Rolled back tables */
+ tables: {
+ /** @description Table replication state */
+ new_state:
+ | {
+ /** @enum {string} */
+ name: 'queued'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copying_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copied_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'following_wal'
+ }
+ | {
+ /** @enum {string} */
+ name: 'error'
+ reason: string
+ retry_policy:
+ | {
+ /** @enum {string} */
+ policy: 'no_retry'
+ }
+ | {
+ /** @enum {string} */
+ policy: 'manual_retry'
+ }
+ | {
+ /**
+ * @description Next retry time (RFC 3339 timestamp)
+ * @example 2025-01-02T03:04:05Z
+ */
+ next_retry: string
+ /** @enum {string} */
+ policy: 'timed_retry'
+ }
+ solution?: string | null
+ }
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ table_id: number
+ }[]
+ }
+ PipelineStatusResponse_Output: {
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Pipeline status */
+ status: {
+ /**
+ * @example started
+ * @enum {string}
+ */
+ name: 'stopped' | 'starting' | 'started' | 'stopping' | 'unknown' | 'failed'
+ }
+ }
+ PipelineVersionResponse_Output: {
+ /** @description New pipeline version */
+ new_version?: {
+ /**
+ * @description Version id
+ * @example 3
+ */
+ id: number
+ /**
+ * @description Version name
+ * @example v0.3.0
+ */
+ name: string
+ } | null
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Current pipeline version */
+ version: {
+ /**
+ * @description Version id
+ * @example 3
+ */
+ id: number
+ /**
+ * @description Version name
+ * @example v0.3.0
+ */
+ name: string
+ }
+ }
+ UpdatePipelineVersionBody: {
+ /**
+ * @description Pipeline version id
+ * @example 4
+ */
+ version_id: number
+ }
+ ValidatePipelineBody: {
+ /** @description Pipeline configuration */
+ config: {
+ /** @description Batch configuration. Omit or use `null` for server defaults. */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Memory-based backpressure configuration. Omission enables server defaults; `null` disables it. */
+ memory_backpressure?: {
+ /**
+ * @description Memory usage ratio above which backpressure is activated
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Memory usage ratio below which backpressure is released
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
+ table_sync_copy?:
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
+ }
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ }
+ ValidatePipelineResponse_Output: {
+ /** @description List of validation failures */
+ validation_failures: {
+ /**
+ * @description Failure type
+ * @example critical
+ * @enum {string}
+ */
+ failure_type: 'critical' | 'warning'
+ /**
+ * @description Validation failure name
+ * @example Validation Failed
+ */
+ name: string
+ /**
+ * @description Validation failure reason
+ * @example The configuration is invalid
+ */
+ reason: string
+ }[]
+ }
+ SourcesResponse_Output: {
+ /** @description List of sources */
+ sources: {
+ /** @description Source configuration */
+ config: {
+ /**
+ * @description Source host
+ * @example db.internal
+ */
+ host: string
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ name: string
+ /**
+ * @description Source port
+ * @example 5432
+ */
+ port: number
+ /**
+ * @description Source username
+ * @example etl_user
+ */
+ username: string
+ }
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ id: number
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }[]
+ }
+ CreateSourceResponse_Output: {
+ /** @description Source ID */
+ id: number
+ }
+ PublicationsResponse_Output: {
+ /** @description List of publications */
+ publications: {
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ name: string
+ /** @description Publication tables */
+ tables: {
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ }[]
+ }[]
+ }
+ CreatePublicationBody: {
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ name: string
+ /** @description Publication tables */
+ tables: {
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ }[]
+ }
+ UpdatePublicationBody: {
+ /** @description Publication tables */
+ tables: {
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ }[]
+ }
+ CostEstimateResponse_Output: {
+ /**
+ * @description Currency of all amounts
+ * @example usd
+ * @enum {string}
+ */
+ currency: 'usd'
+ /** @description Recurring per-pipeline cost */
+ pipeline: {
+ /**
+ * @description Hourly rate charged per active pipeline
+ * @example 0.053
+ */
+ hourly_cost: number
+ /**
+ * @description Projected monthly cost for an active pipeline, based on an average 730-hour month. Pipelines are billed hourly, so this is an estimate, not a metered amount.
+ * @example 38.69
+ */
+ monthly_cost: number
+ }
+ /** @description Usage-based streaming cost, expressed as a rate */
+ streaming: {
+ /**
+ * @description Usage-based streaming rate per GB. Actual cost depends on the change volume.
+ * @example 3
+ */
+ rate_per_gb: number
+ }
+ /** @description One-time cost for the initial table copy */
+ table_copy: {
+ /**
+ * @description One-time initial-copy rate per GB
+ * @example 0.6
+ */
+ rate_per_gb: number
+ /** @description Per-table initial-copy cost estimate */
+ tables: {
+ /**
+ * @description Estimated on-disk size of the table in bytes
+ * @example 10960896
+ */
+ estimated_bytes: number
+ /**
+ * @description Estimated one-time initial-copy cost for the table, in the response currency
+ * @example 0.01
+ */
+ estimated_cost: number
+ /**
+ * @description Whether this table has a row filter. The estimate does not account for how many rows the filter excludes, so the actual replicated volume may be lower than shown.
+ * @example false
+ */
+ is_row_filtered: boolean
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ }[]
+ /**
+ * @description Total estimated bytes across all tables
+ * @example 11911168
+ */
+ total_bytes: number
+ /**
+ * @description Total estimated one-time initial-copy cost
+ * @example 0.01
+ */
+ total_cost: number
+ }
+ }
+ TablesResponse_Output: {
+ /** @description List of tables */
+ tables: {
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ }[]
+ }
+ CreateTenantSourceResponse_Output: {
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }
+ ReadPublicationsResponse_Output: {
+ /** @description List of publications */
+ publications: ({
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ name: string
+ } & {
+ [key: string]: unknown
+ })[]
+ }
+ PublicationDetailsResponse_Output: {
+ config:
+ | ({
+ /** @description Data-change operations to publish */
+ operations: ('insert' | 'update' | 'delete' | 'truncate')[]
+ /**
+ * @description PostgreSQL 18+ generated-column publication behavior
+ * @enum {string|null}
+ */
+ publish_generated_columns?: 'none' | 'stored' | null
+ /** @description Whether partition changes use the partition root identity */
+ publish_via_partition_root: boolean
+ /** @enum {string} */
+ type: 'all_tables'
+ } & {
+ [key: string]: unknown
+ })
+ | ({
+ /** @description Data-change operations to publish */
+ operations: ('insert' | 'update' | 'delete' | 'truncate')[]
+ /**
+ * @description PostgreSQL 18+ generated-column publication behavior
+ * @enum {string|null}
+ */
+ publish_generated_columns?: 'none' | 'stored' | null
+ /** @description Whether partition changes use the partition root identity */
+ publish_via_partition_root: boolean
+ /** @description Schemas whose tables are published */
+ schemas: string[]
+ /** @enum {string} */
+ type: 'tables_in_schema'
+ } & {
+ [key: string]: unknown
+ })
+ | ({
+ /** @description Data-change operations to publish */
+ operations: ('insert' | 'update' | 'delete' | 'truncate')[]
+ /**
+ * @description PostgreSQL 18+ generated-column publication behavior
+ * @enum {string|null}
+ */
+ publish_generated_columns?: 'none' | 'stored' | null
+ /** @description Whether partition changes use the partition root identity */
+ publish_via_partition_root: boolean
+ tables: ({
+ /** @description Columns to publish, or null for Postgres' default column set */
+ columns?: string[] | null
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /** @description A self-contained PostgreSQL row-filter expression, or null for none */
+ row_filter?: string | null
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ } & {
+ [key: string]: unknown
+ })[]
+ /** @enum {string} */
+ type: 'tables'
+ } & {
+ [key: string]: unknown
+ })
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ name: string
+ /** @description Tables currently exposed by the publication */
+ tables: ({
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Whether the table can own partitions
+ * @enum {string}
+ */
+ kind: 'table' | 'partitioned_table'
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /** @description The direct partition parent's table id, if any */
+ partition_parent_id?: number | null
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ } & {
+ [key: string]: unknown
+ })[]
+ }
+ PutPublicationBody:
+ | {
+ /** @description Data-change operations to publish */
+ operations: ('insert' | 'update' | 'delete' | 'truncate')[]
+ /**
+ * @description PostgreSQL 18+ generated-column publication behavior
+ * @enum {string|null}
+ */
+ publish_generated_columns?: 'none' | 'stored' | null
+ /** @description Whether partition changes use the partition root identity */
+ publish_via_partition_root?: boolean
+ /** @enum {string} */
+ type: 'all_tables'
+ }
+ | {
+ /** @description Data-change operations to publish */
+ operations: ('insert' | 'update' | 'delete' | 'truncate')[]
+ /**
+ * @description PostgreSQL 18+ generated-column publication behavior
+ * @enum {string|null}
+ */
+ publish_generated_columns?: 'none' | 'stored' | null
+ /** @description Whether partition changes use the partition root identity */
+ publish_via_partition_root?: boolean
+ /** @description Schemas whose tables are published */
+ schemas: string[]
+ /** @enum {string} */
+ type: 'tables_in_schema'
+ }
+ | {
+ /** @description Data-change operations to publish */
+ operations: ('insert' | 'update' | 'delete' | 'truncate')[]
+ /**
+ * @description PostgreSQL 18+ generated-column publication behavior
+ * @enum {string|null}
+ */
+ publish_generated_columns?: 'none' | 'stored' | null
+ /** @description Whether partition changes use the partition root identity */
+ publish_via_partition_root?: boolean
+ tables: {
+ /** @description Columns to publish, or null for Postgres' default column set */
+ columns?: string[] | null
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /** @description A self-contained PostgreSQL row-filter expression, or null for none */
+ row_filter?: string | null
+ }[]
+ /** @enum {string} */
+ type: 'tables'
+ }
+ ReadTablesResponse_Output: {
+ /** @description List of tables */
+ tables: ({
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Whether the table can own partitions
+ * @enum {string}
+ */
+ kind: 'table' | 'partitioned_table'
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /** @description The direct partition parent's table id, if any */
+ partition_parent_id?: number | null
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ } & {
+ [key: string]: unknown
+ })[]
+ }
+ ReadColumnsResponse_Output: {
+ /** @description Table columns in ordinal position order */
+ columns: ({
+ /**
+ * @description Column name
+ * @example created_at
+ */
+ name: string
+ /** @description Whether the column accepts null values */
+ nullable: boolean
+ /** @description Whether the column belongs to the table's primary key */
+ primary_key: boolean
+ /**
+ * @description Postgres-formatted column type
+ * @example timestamptz
+ */
+ type: string
+ } & {
+ [key: string]: unknown
+ })[]
+ }
+ RealtimeConfigResponse: {
+ /** @description Sets connection pool size for Realtime Authorization */
+ connection_pool: number | null
+ /** @description Sets maximum number of bytes per second rate per channel limit */
+ max_bytes_per_second: number | null
+ /** @description Sets maximum number of channels per client rate limit */
+ max_channels_per_client: number | null
+ /** @description Sets maximum number of concurrent users rate limit */
+ max_concurrent_users: number | null
+ /** @description Sets maximum number of events per second rate per channel limit */
+ max_events_per_second: number | null
+ /** @description Sets maximum number of joins per second rate limit */
+ max_joins_per_second: number | null
+ /** @description Sets maximum number of payload size in KB rate limit */
+ max_payload_size_in_kb: number | null
+ /** @description Sets maximum number of presence events per second rate limit */
+ max_presence_events_per_second: number | null
+ /** @description Sets connection pool size used to create Postgres Changes subscriptions */
+ postgres_changes_pool: number | null
+ /** @description Whether to enable presence */
+ presence_enabled: boolean
+ /** @description Whether to only allow private channels */
+ private_only: boolean | null
+ /** @description Disables the Realtime service for this project when true. Set to false to re-enable it. */
+ suspend: boolean | null
+ }
+ RegionsInfo: {
+ all: {
+ smartGroup: {
+ /** @enum {string} */
+ code: 'americas' | 'emea' | 'apac'
+ name: string
+ /** @enum {string} */
+ type: 'smartGroup'
+ }[]
+ specific: {
+ /** @enum {string} */
+ code:
+ | 'us-east-1'
+ | 'us-east-2'
+ | 'us-west-1'
+ | 'us-west-2'
+ | 'ap-southeast-1'
+ | 'ap-northeast-1'
+ | 'ap-northeast-2'
+ | 'ap-east-1'
+ | 'ap-southeast-2'
+ | 'eu-west-1'
+ | 'eu-west-2'
+ | 'eu-west-3'
+ | 'eu-north-1'
+ | 'eu-central-1'
+ | 'eu-central-2'
+ | 'ca-central-1'
+ | 'ap-south-1'
+ | 'sa-east-1'
+ name: string
+ /** @enum {string} */
+ provider: 'AWS' | 'AWS_K8S' | 'AWS_NIMBUS'
+ /** @enum {string} */
+ status?: 'capacity' | 'other'
+ /** @enum {string} */
+ type: 'specific'
+ }[]
+ }
+ recommendations: {
+ smartGroup: {
+ /** @enum {string} */
+ code: 'americas' | 'emea' | 'apac'
+ name: string
+ /** @enum {string} */
+ type: 'smartGroup'
+ }
+ specific: {
+ /** @enum {string} */
+ code:
+ | 'us-east-1'
+ | 'us-east-2'
+ | 'us-west-1'
+ | 'us-west-2'
+ | 'ap-southeast-1'
+ | 'ap-northeast-1'
+ | 'ap-northeast-2'
+ | 'ap-east-1'
+ | 'ap-southeast-2'
+ | 'eu-west-1'
+ | 'eu-west-2'
+ | 'eu-west-3'
+ | 'eu-north-1'
+ | 'eu-central-1'
+ | 'eu-central-2'
+ | 'ca-central-1'
+ | 'ap-south-1'
+ | 'sa-east-1'
+ name: string
+ /** @enum {string} */
+ provider: 'AWS' | 'AWS_K8S' | 'AWS_NIMBUS'
+ /** @enum {string} */
+ status?: 'capacity' | 'other'
+ /** @enum {string} */
+ type: 'specific'
+ }[]
+ }
+ }
+ RemoveProjectResponse: {
+ id: number
+ name: string
+ ref: string
+ vercel?: {
+ resourceUninstallFailure: boolean
+ }
+ }
+ ReplicationDestinationResponse: {
+ /** @description Destination configuration */
+ config:
+ | {
+ big_query: {
+ /**
+ * @description Number of concurrent BigQuery Storage Write API connections.
+ * @example 8
+ */
+ connection_pool_size: number
+ /**
+ * @description BigQuery dataset id
+ * @example analytics
+ */
+ dataset_id: string
+ /**
+ * @description Maximum data staleness in minutes
+ * @example 5
+ */
+ max_staleness_mins?: number
+ /**
+ * @description BigQuery project id
+ * @example my-gcp-project
+ */
+ project_id: string
+ /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
+ table_options?: {
+ tables?: {
+ cluster_by?: string[]
+ partition_by?:
+ | (
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @enum {string}
+ */
+ kind: 'time_column'
+ }
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Exclusive end of the last partition range
+ * @example 100
+ */
+ end: number
+ /**
+ * @description Width of each partition range
+ * @example 10
+ */
+ interval: number
+ /**
+ * @description Partition by ranges of a replicated integer column
+ * @enum {string}
+ */
+ kind: 'integer_range'
+ /**
+ * @description Inclusive start of the first partition range
+ * @example 0
+ */
+ start: number
+ }
+ | {
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by the time at which BigQuery ingests each row
+ * @enum {string}
+ */
+ kind: 'ingestion_time'
+ }
+ )
+ | null
+ /**
+ * @description Source PostgreSQL table OID, stable across renames for the relation lifetime
+ * @example 16384
+ */
+ table_id: number
+ }[]
+ }
+ }
+ }
+ | {
+ clickhouse: {
+ /**
+ * @description ClickHouse target database
+ * @example analytics
+ */
+ database: string
+ /**
+ * @description Table engine used for replicated tables. Defaults to `replacing_merge_tree` server-side when omitted.
+ * @example replacing_merge_tree
+ * @enum {string}
+ */
+ engine: 'merge_tree' | 'replacing_merge_tree'
+ /**
+ * @description Persisted ClickHouse HTTP(S) endpoint URL
+ * @example http://clickhouse.example.com:8123
+ */
+ url: string
+ /**
+ * @description ClickHouse user name
+ * @example default
+ */
+ user: string
+ }
+ }
+ | {
+ iceberg:
+ | {
+ supabase: {
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string
+ /**
+ * @description Project ref
+ * @example abcdefghijklmnopqrst
+ */
+ project_ref: string
+ /**
+ * @description S3 region
+ * @example ap-southeast-1
+ */
+ s3_region: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ | {
+ rest: {
+ /**
+ * @description Iceberg REST catalog URI
+ * @example https://catalog.example.com
+ */
+ catalog_uri: string
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string
+ /**
+ * @description S3-compatible storage endpoint
+ * @example https://s3.example.com
+ */
+ s3_endpoint: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ }
+ | {
+ ducklake: {
+ /**
+ * @description Persisted DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description Persisted DuckLake metadata schema
+ * @example ducklake
+ */
+ metadata_schema?: string
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size: number
+ /**
+ * @description Persisted S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint?: string
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region?: string
+ /**
+ * @description Persisted S3 URL style
+ * @example path
+ */
+ s3_url_style?: string
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @example false
+ */
+ s3_use_ssl?: boolean
+ }
+ }
+ | {
+ snowflake: {
+ /**
+ * @description Snowflake account identifier
+ * @example MYORG-MYACCOUNT
+ */
+ account_id: string
+ /**
+ * @description Snowflake target database
+ * @example ANALYTICS
+ */
+ database: string
+ /**
+ * @description Optional Snowflake role
+ * @example PIPELINES_ROLE
+ */
+ role?: string
+ /**
+ * @description Snowflake target schema
+ * @example PUBLIC
+ */
+ schema: string
+ /**
+ * @description Snowflake user configured for key-pair authentication
+ * @example PIPELINES_USER
+ */
+ user: string
+ }
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ id: number
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }
+ ReplicationDestinationsResponse: {
+ /** @description List of destinations */
+ destinations: {
+ /** @description Destination configuration */
+ config:
+ | {
+ big_query: {
+ /**
+ * @description Number of concurrent BigQuery Storage Write API connections.
+ * @example 8
+ */
+ connection_pool_size: number
+ /**
+ * @description BigQuery dataset id
+ * @example analytics
+ */
+ dataset_id: string
+ /**
+ * @description Maximum data staleness in minutes
+ * @example 5
+ */
+ max_staleness_mins?: number
+ /**
+ * @description BigQuery project id
+ * @example my-gcp-project
+ */
+ project_id: string
+ /** @description Per-table partitioning and clustering, applied only when the physical table is created or recreated */
+ table_options?: {
+ tables?: {
+ cluster_by?: string[]
+ partition_by?:
+ | (
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by a replicated `DATE`, `TIMESTAMP`, or `DATETIME` column
+ * @enum {string}
+ */
+ kind: 'time_column'
+ }
+ | {
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ column: string
+ /**
+ * @description Exclusive end of the last partition range
+ * @example 100
+ */
+ end: number
+ /**
+ * @description Width of each partition range
+ * @example 10
+ */
+ interval: number
+ /**
+ * @description Partition by ranges of a replicated integer column
+ * @enum {string}
+ */
+ kind: 'integer_range'
+ /**
+ * @description Inclusive start of the first partition range
+ * @example 0
+ */
+ start: number
+ }
+ | {
+ /**
+ * @description Partition granularity
+ * @example day
+ * @enum {string}
+ */
+ granularity?: 'hour' | 'day' | 'month' | 'year'
+ /**
+ * @description Partition by the time at which BigQuery ingests each row
+ * @enum {string}
+ */
+ kind: 'ingestion_time'
+ }
+ )
+ | null
+ /**
+ * @description Source PostgreSQL table OID, stable across renames for the relation lifetime
+ * @example 16384
+ */
+ table_id: number
+ }[]
+ }
+ }
+ }
+ | {
+ clickhouse: {
+ /**
+ * @description ClickHouse target database
+ * @example analytics
+ */
+ database: string
+ /**
+ * @description Table engine used for replicated tables. Defaults to `replacing_merge_tree` server-side when omitted.
+ * @example replacing_merge_tree
+ * @enum {string}
+ */
+ engine: 'merge_tree' | 'replacing_merge_tree'
+ /**
+ * @description Persisted ClickHouse HTTP(S) endpoint URL
+ * @example http://clickhouse.example.com:8123
+ */
+ url: string
+ /**
+ * @description ClickHouse user name
+ * @example default
+ */
+ user: string
+ }
+ }
+ | {
+ iceberg:
+ | {
+ supabase: {
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string
+ /**
+ * @description Project ref
+ * @example abcdefghijklmnopqrst
+ */
+ project_ref: string
+ /**
+ * @description S3 region
+ * @example ap-southeast-1
+ */
+ s3_region: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ | {
+ rest: {
+ /**
+ * @description Iceberg REST catalog URI
+ * @example https://catalog.example.com
+ */
+ catalog_uri: string
+ /**
+ * @description Namespace
+ * @example my-namespace
+ */
+ namespace?: string
+ /**
+ * @description S3-compatible storage endpoint
+ * @example https://s3.example.com
+ */
+ s3_endpoint: string
+ /**
+ * @description Warehouse name
+ * @example my-warehouse
+ */
+ warehouse_name: string
+ }
+ }
+ }
+ | {
+ ducklake: {
+ /**
+ * @description Persisted DuckLake data path
+ * @example s3://<bucket-name>/
+ */
+ data_path: string
+ /**
+ * @description Persisted DuckLake metadata schema
+ * @example ducklake
+ */
+ metadata_schema?: string
+ /**
+ * @description Number of concurrent DuckDB connections.
+ * @example 4
+ */
+ pool_size: number
+ /**
+ * @description Persisted S3-compatible storage endpoint
+ * @example 127.0.0.1:5000/s3
+ */
+ s3_endpoint?: string
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region?: string
+ /**
+ * @description Persisted S3 URL style
+ * @example path
+ */
+ s3_url_style?: string
+ /**
+ * @description Whether to use SSL for S3-compatible storage
+ * @example false
+ */
+ s3_use_ssl?: boolean
+ }
+ }
+ | {
+ snowflake: {
+ /**
+ * @description Snowflake account identifier
+ * @example MYORG-MYACCOUNT
+ */
+ account_id: string
+ /**
+ * @description Snowflake target database
+ * @example ANALYTICS
+ */
+ database: string
+ /**
+ * @description Optional Snowflake role
+ * @example PIPELINES_ROLE
+ */
+ role?: string
+ /**
+ * @description Snowflake target schema
+ * @example PUBLIC
+ */
+ schema: string
+ /**
+ * @description Snowflake user configured for key-pair authentication
+ * @example PIPELINES_USER
+ */
+ user: string
+ }
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ id: number
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }[]
+ }
+ ReplicationPipelineReplicationStatusResponse: {
+ /** @description Stats about apply worker lag */
+ apply_lag?: {
+ /**
+ * @description Whether the slot currently has an active replication connection.
+ * @example true
+ */
+ active: boolean
+ /**
+ * @description Bytes between the current WAL location and the confirmed flush LSN.
+ * @example 2048
+ */
+ confirmed_flush_lsn_bytes: number
+ /**
+ * @description Flush lag expressed in milliseconds.
+ * @example 1200
+ */
+ flush_lag?: number
+ /**
+ * @description Milliseconds elapsed since the walsender last received client feedback. This can be present even when write and flush lag are unavailable.
+ * @example 5000
+ */
+ reply_time_lag?: number
+ /**
+ * @description Bytes between the current WAL location and the slot restart LSN.
+ * @example 1024
+ */
+ restart_lsn_bytes: number
+ /**
+ * @description How many bytes of WAL are still safe to build up before the limit of the slot is reached. `null` means Postgres reports unlimited slot WAL retention.
+ * @example 8192
+ */
+ safe_wal_size_bytes: number | null
+ /**
+ * @description WAL availability status reported by Postgres for the slot.
+ * @example reserved
+ * @enum {string}
+ */
+ wal_status?: 'reserved' | 'extended' | 'unreserved' | 'lost' | 'unknown'
+ /**
+ * @description Write lag expressed in milliseconds.
+ * @example 1500
+ */
+ write_lag?: number
+ }
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Table statuses */
+ table_statuses: {
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ /** @description Table replication state */
+ state:
+ | {
+ /** @enum {string} */
+ name: 'queued'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copying_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copied_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'following_wal'
+ }
+ | {
+ /** @enum {string} */
+ name: 'error'
+ reason: string
+ retry_policy:
+ | {
+ /** @enum {string} */
+ policy: 'no_retry'
+ }
+ | {
+ /** @enum {string} */
+ policy: 'manual_retry'
+ }
+ | {
+ /**
+ * @description Next retry time (RFC 3339 timestamp)
+ * @example 2025-01-02T03:04:05Z
+ */
+ next_retry: string
+ /** @enum {string} */
+ policy: 'timed_retry'
+ }
+ solution?: string
+ }
+ /**
+ * @deprecated
+ * @description Deprecated compatibility alias for `id`.
+ * @example 16408
+ */
+ table_id: number
+ /**
+ * @deprecated
+ * @description Deprecated unquoted `schema.name` compatibility representation.
+ * @example public.orders
+ */
+ table_name: string
+ /** @description Stats about table sync worker lag */
+ table_sync_lag?: {
+ /**
+ * @description Whether the slot currently has an active replication connection.
+ * @example true
+ */
+ active: boolean
+ /**
+ * @description Bytes between the current WAL location and the confirmed flush LSN.
+ * @example 2048
+ */
+ confirmed_flush_lsn_bytes: number
+ /**
+ * @description Flush lag expressed in milliseconds.
+ * @example 1200
+ */
+ flush_lag?: number
+ /**
+ * @description Milliseconds elapsed since the walsender last received client feedback. This can be present even when write and flush lag are unavailable.
+ * @example 5000
+ */
+ reply_time_lag?: number
+ /**
+ * @description Bytes between the current WAL location and the slot restart LSN.
+ * @example 1024
+ */
+ restart_lsn_bytes: number
+ /**
+ * @description How many bytes of WAL are still safe to build up before the limit of the slot is reached. `null` means Postgres reports unlimited slot WAL retention.
+ * @example 8192
+ */
+ safe_wal_size_bytes: number | null
+ /**
+ * @description WAL availability status reported by Postgres for the slot.
+ * @example reserved
+ * @enum {string}
+ */
+ wal_status?: 'reserved' | 'extended' | 'unreserved' | 'lost' | 'unknown'
+ /**
+ * @description Write lag expressed in milliseconds.
+ * @example 1500
+ */
+ write_lag?: number
+ }
+ }[]
+ }
+ /** @description Pipeline */
+ ReplicationPipelineResponse: {
+ /** @description Pipeline configuration */
+ config: {
+ /** @description Batch configuration */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Persisted ratio of process memory reserved for incoming stream batch bytes
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ }
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate'
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error'
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number
+ /** @description Memory-based backpressure configuration */
+ memory_backpressure?: {
+ /**
+ * @description Persisted memory usage ratio that activates backpressure
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Persisted memory usage ratio that releases backpressure
+ * @example 0.75
+ */
+ resume_threshold: number
+ }
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number
+ /** @description Selection rules for tables participating in initial table copy */
+ table_sync_copy?:
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ destination_id: number
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ destination_name: string
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ id: number
+ /**
+ * @description Replicator id
+ * @example 9001
+ */
+ replicator_id: number
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ source_name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }
+ ReplicationPipelinesResponse: {
+ /** @description List of pipelines */
+ pipelines: {
+ /** @description Pipeline configuration */
+ config: {
+ /** @description Batch configuration */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Persisted ratio of process memory reserved for incoming stream batch bytes
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ }
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate'
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error'
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number
+ /** @description Memory-based backpressure configuration */
+ memory_backpressure?: {
+ /**
+ * @description Persisted memory usage ratio that activates backpressure
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Persisted memory usage ratio that releases backpressure
+ * @example 0.75
+ */
+ resume_threshold: number
+ }
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number
+ /** @description Selection rules for tables participating in initial table copy */
+ table_sync_copy?:
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ }
+ /**
+ * @description Destination id
+ * @example 2001
+ */
+ destination_id: number
+ /**
+ * @description Destination name
+ * @example bq-analytics
+ */
+ destination_name: string
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ id: number
+ /**
+ * @description Replicator id
+ * @example 9001
+ */
+ replicator_id: number
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ source_name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }[]
+ }
+ ReplicationPipelineStatusResponse: {
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Pipeline status */
+ status: {
+ /**
+ * @example started
+ * @enum {string}
+ */
+ name: 'stopped' | 'starting' | 'started' | 'stopping' | 'unknown' | 'failed'
+ }
+ }
+ ReplicationPipelineVersionResponse: {
+ /** @description New pipeline version */
+ new_version?: {
+ /**
+ * @description Version id
+ * @example 3
+ */
+ id: number
+ /**
+ * @description Version name
+ * @example v0.3.0
+ */
+ name: string
+ }
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Current pipeline version */
+ version: {
+ /**
+ * @description Version id
+ * @example 3
+ */
+ id: number
+ /**
+ * @description Version name
+ * @example v0.3.0
+ */
+ name: string
+ }
+ }
+ ReplicationPublicationsResponse: {
+ /** @description List of publications */
+ publications: {
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ name: string
+ /** @description Publication tables */
+ tables: {
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ }[]
+ }[]
+ }
+ ReplicationSourcesResponse: {
+ /** @description List of sources */
+ sources: {
+ /** @description Source configuration */
+ config: {
+ /**
+ * @description Source host
+ * @example db.internal
+ */
+ host: string
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ name: string
+ /**
+ * @description Source port
+ * @example 5432
+ */
+ port: number
+ /**
+ * @description Source username
+ * @example etl_user
+ */
+ username: string
+ }
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ id: number
+ /**
+ * @description Source name
+ * @example main-db
+ */
+ name: string
+ /**
+ * @description Tenant id
+ * @example tenant_9f3a2c
+ */
+ tenant_id: string
+ }[]
+ }
+ ReplicationTablesResponse: {
+ /** @description List of tables */
+ tables: {
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ id: number
+ /**
+ * @description Table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Table schema
+ * @example public
+ */
+ schema: string
+ }[]
+ }
+ RequestUpgradeBody: {
+ note?: string
+ /** @enum {string} */
+ requested_plan: 'Pro' | 'Team' | 'Enterprise'
+ }
+ RequestUpgradeResponse: {
+ message: string
+ }
+ ResetPasswordBody: {
+ /** Format: email */
+ email: string
+ /** Format: uri */
+ redirectTo?: string
+ }
+ ResizeBody: {
+ volume_size_gb: number
+ }
+ ResolveConversationBody: {
+ /** @enum {string} */
+ aiSupportStatus: 'user_resolved' | 'bot_resolved'
+ chatId: string
+ conversationId: string
+ }
+ RestartProjectBody: {
+ database_identifier?: string
+ }
+ RestartServicesBody: {
+ restartRequest: {
+ database_identifier?: string
+ region: string
+ services: (
+ | 'adminapi'
+ | 'api-gateway'
+ | 'envoy'
+ | 'functions'
+ | 'gotrue'
+ | 'kong'
+ | 'pgbouncer'
+ | 'pgsodium'
+ | 'postgresql'
+ | 'postgrest'
+ | 'realtime'
+ | 'storage'
+ | 'walg'
+ | 'autoshutdown'
+ )[]
+ source_notification_id?: string
+ }
+ }
+ RestoreLogicalBackupBody: {
+ id: number
+ }
+ RestorePhysicalBackupBody: {
+ id: number
+ recovery_time_target?: string
+ }
+ RevokeAuthorizedOAuthAppResponse: {
+ authorized_at?: string
+ icon?: string
+ id: string
+ name: string
+ website: string
+ }
+ RollbackTablesBody: {
+ /**
+ * @description Rollback type
+ * @example individual
+ * @enum {string}
+ */
+ rollback_type: 'individual' | 'full'
+ /** @description Rollback target */
+ target:
+ | {
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ table_id: number
+ /** @enum {string} */
+ type: 'single_table'
+ }
+ | {
+ /** @enum {string} */
+ type: 'all_errored_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'all_tables'
+ }
+ }
+ RollbackTablesResponse: {
+ /**
+ * @description Pipeline id
+ * @example 1012
+ */
+ pipeline_id: number
+ /** @description Rolled back tables */
+ tables: {
+ /** @description Table replication state */
+ new_state:
+ | {
+ /** @enum {string} */
+ name: 'queued'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copying_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'copied_table'
+ }
+ | {
+ /** @enum {string} */
+ name: 'following_wal'
+ }
+ | {
+ /** @enum {string} */
+ name: 'error'
+ reason: string
+ retry_policy:
+ | {
+ /** @enum {string} */
+ policy: 'no_retry'
+ }
+ | {
+ /** @enum {string} */
+ policy: 'manual_retry'
+ }
+ | {
+ /**
+ * @description Next retry time (RFC 3339 timestamp)
+ * @example 2025-01-02T03:04:05Z
+ */
+ next_retry: string
+ /** @enum {string} */
+ policy: 'timed_retry'
+ }
+ solution?: string
+ }
+ /**
+ * @description Table id (Postgres OID)
+ * @example 16408
+ */
+ table_id: number
+ }[]
+ }
+ RunQueryBody: {
+ /** @default false */
+ disable_statement_timeout?: boolean
+ parameters?: unknown[]
+ query: string
+ }
+ SendExitSurveyBody: {
+ additionalFeedback?: string
+ exitAction?: string
+ orgSlug?: string
+ projectRef?: string
+ reasons: string
+ }
+ SendFeedbackBody: {
+ additionalRedirectUrls?: string
+ affectedServices?: string
+ allowSupportAccess?: boolean
+ browserInformation?: string
+ category: string
+ dashboardLogs?: string
+ dashboardSentryIssueId?: string
+ dashboardStudioVersion?: string
+ library?: string
+ message: string
+ organizationSlug?: string
+ pathname?: string
+ projectRef?: string
+ severity?: string
+ siteUrl?: string
+ subject?: string
+ tags: string[]
+ threadRef?: string
+ urlToAirTable?: string
+ verified?: boolean
+ }
+ SendFeedbackResponse: {
+ conversationId?: string
+ result: string
+ }
+ SendUpgradeSurveyBody: {
+ additionalFeedback?: string
+ currentPlan?: string
+ orgSlug?: string
+ prevPlan?: string
+ reasons: string[]
+ }
+ ServiceVersions: {
+ gotrue?: string
+ postgrest?: string
+ 'supabase-postgres': string
+ }
+ SetupIntentRequest: {
+ hcaptchaToken?: string
+ }
+ SetupIntentResponse: {
+ client_secret: string
+ pending_subscription_flow_enabled_for_creation: boolean
+ }
+ SignedUrlResponse: {
+ signedUrl: string
+ }
+ SignedUrlsResponse: {
+ error: string | null
+ path: string | null
+ signedUrl: string | null
+ }
+ SignUpBody: {
+ /** Format: email */
+ email: string
+ password: string
+ /** Format: uri */
+ redirectTo?: string
+ }
+ StorageAnalyticsBucketDeleteResponse: {
+ message: string
+ }
+ StorageAnalyticsBucketNamespaceTablesResponse: {
+ data: {
+ name: string
+ namespace: string[]
+ }[]
+ }
+ StorageAnalyticsBucketResponse: {
+ created_at: string
+ name: string
+ updated_at: string
+ }
+ StorageAnalyticsBucketsResponse: {
+ data: {
+ created_at: string
+ name: string
+ updated_at: string
+ }[]
+ }
+ StorageBucketResponse: {
+ allowed_mime_types?: string[]
+ created_at: string
+ file_size_limit?: number
+ id: string
+ name: string
+ owner: string
+ public: boolean
+ type?: ('STANDARD' | 'ANALYTICS') | string
+ updated_at: string
+ }
+ StorageConfigResponse: {
+ capabilities: {
+ iceberg_catalog: boolean
+ list_v2: boolean
+ }
+ databasePoolMode: string
+ external: {
+ /** @enum {string} */
+ upstreamTarget: 'main' | 'canary'
+ }
+ features: {
+ icebergCatalog: {
+ enabled: boolean
+ maxCatalogs: number
+ maxNamespaces: number
+ maxTables: number
+ }
+ imageTransformation: {
+ enabled: boolean
+ }
+ purgeCache: {
+ enabled: boolean
+ }
+ s3Protocol: {
+ enabled: boolean
+ }
+ vectorBuckets: {
+ enabled: boolean
+ maxBuckets: number
+ maxIndexes: number
+ }
+ }
+ /** Format: int64 */
+ fileSizeLimit: number
+ migrationVersion: string
+ }
+ StorageListResponseV2: {
+ folders: {
+ key?: string
+ name: string
+ }[]
+ hasNext: boolean
+ nextCursor?: string
+ objects: {
+ created_at: string
+ id: string
+ key?: string
+ last_accessed_at: string
+ metadata: {
+ cacheControl?: string | null
+ contentLength?: number | null
+ eTag?: string | null
+ httpStatusCode?: number | null
+ lastModified?: string | null
+ mimetype?: string | null
+ size?: number | null
+ } | null
+ name: string
+ updated_at: string
+ }[]
+ }
+ StorageObject: {
+ bucket_id?: string
+ buckets?: {
+ allowed_mime_types?: string[]
+ created_at: string
+ file_size_limit?: number
+ id: string
+ name: string
+ owner: string
+ public: boolean
+ type?: ('STANDARD' | 'ANALYTICS') | string
+ updated_at: string
+ }
+ created_at: string | null
+ id: string | null
+ last_accessed_at: string | null
+ metadata: {
+ [key: string]: unknown
+ } | null
+ name: string
+ owner?: string
+ updated_at: string | null
+ }
+ StorageVectorBucketListIndexesResponse: {
+ indexes: {
+ creationTime?: number
+ dataType: 'float32' | string
+ dimension: number
+ distanceMetric: ('cosine' | 'euclidean' | 'dotproduct') | string
+ indexName: string
+ metadataConfiguration?: {
+ nonFilterableMetadataKeys?: string[]
+ }
+ vectorBucketName: string
+ }[]
+ nextToken?: string
+ }
+ StorageVectorBucketResponse: {
+ vectorBucketName: string
+ }
+ StorageVectorBucketsResponse: {
+ nextToken?: string
+ vectorBuckets: {
+ vectorBucketName: string
+ }[]
+ }
+ SupavisorConfigResponse: {
+ connection_string: string
+ /** @description Use connection_string instead */
+ connectionString: string
+ /** @enum {string} */
+ database_type: 'PRIMARY' | 'READ_REPLICA'
+ db_host: string
+ db_name: string
+ db_port: number
+ db_user: string
+ default_pool_size: number | null
+ identifier: string
+ is_using_scram_auth: boolean
+ max_client_conn: number | null
/** @enum {string} */
pool_mode: 'transaction' | 'session'
}
@@ -13568,6 +17262,40 @@ export interface components {
* @example false
*/
s3_use_ssl?: boolean | null
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ } | null
}
| {
catalog:
@@ -13684,6 +17412,40 @@ export interface components {
/** @enum {string} */
type: 'supabase_storage'
}
+ table_sorting?: {
+ tables?: {
+ schema: string
+ sort_by:
+ | {
+ columns: {
+ /**
+ * @description DuckLake sort direction
+ * @example asc
+ * @enum {string}
+ */
+ direction?: 'asc' | 'desc'
+ /**
+ * @description Source column name
+ * @example created_at
+ */
+ name: string
+ /**
+ * @description Optional placement of null values in the DuckLake sort order
+ * @example last
+ * @enum {string|null}
+ */
+ nulls?: 'first' | 'last' | null
+ }[]
+ /** @enum {string} */
+ kind: 'columns'
+ }
+ | {
+ /** @enum {string} */
+ kind: 'primary_key'
+ }
+ table: string
+ }[]
+ } | null
}
}
| {
@@ -13800,37 +17562,39 @@ export interface components {
table_error_retry_max_attempts?: number | null
/** @description Initial-copy selection. Omission preserves it; `null` resets to copying all tables. */
table_sync_copy?:
- | {
- /** @enum {string} */
- type: 'include_all_tables'
- }
- | {
- /** @enum {string} */
- type: 'skip_all_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be performed
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'include_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be skipped
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'skip_tables'
- }
- | never
+ | (
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
+ */
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ )
+ | null
}
/**
* @description Source id
@@ -14692,602 +18456,2978 @@ export interface components {
*/
account_id: string
/**
- * @description Snowflake target database
- * @example ANALYTICS
+ * @description Snowflake target database
+ * @example ANALYTICS
+ */
+ database: string
+ /** @description Snowflake RSA private key PEM contents */
+ private_key: string
+ /** @description Optional passphrase for encrypted private keys */
+ private_key_passphrase?: string | null
+ /**
+ * @description Optional Snowflake role
+ * @example PIPELINES_ROLE
+ */
+ role?: string | null
+ /**
+ * @description Snowflake target schema
+ * @example PUBLIC
+ */
+ schema: string
+ /**
+ * @description Snowflake user configured for key-pair authentication
+ * @example PIPELINES_USER
+ */
+ user: string
+ }
+ }
+ /** @description Pipeline configuration */
+ pipeline_config?: {
+ /** @description Batch configuration. Omit or use `null` for server defaults. */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Memory-based backpressure configuration. Omission enables server defaults; `null` disables it. */
+ memory_backpressure?: {
+ /**
+ * @description Memory usage ratio above which backpressure is activated
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Memory usage ratio below which backpressure is released
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
+ table_sync_copy?:
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
+ /**
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
*/
- database: string
- /** @description Snowflake RSA private key PEM contents */
- private_key: string
- /** @description Optional passphrase for encrypted private keys */
- private_key_passphrase?: string | null
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
/**
- * @description Optional Snowflake role
- * @example PIPELINES_ROLE
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
*/
- role?: string | null
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
+ }
+ | never
+ }
+ /**
+ * @description Source id
+ * @example 1
+ */
+ source_id?: number
+ }
+ ValidateReplicationPipelineBody: {
+ /** @description Pipeline configuration */
+ config: {
+ /** @description Batch configuration. Omit or use `null` for server defaults. */
+ batch?: {
+ /**
+ * @description Maximum preferred byte size for one source batch
+ * @example 8388608
+ */
+ max_bytes?: number
+ /**
+ * @description Maximum fill time in milliseconds
+ * @example 200
+ */
+ max_fill_ms?: number
+ /**
+ * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
+ * @example 0.2
+ */
+ memory_budget_ratio?: number
+ } | null
+ /**
+ * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
+ * @example error
+ * @enum {string|null}
+ */
+ invalidated_slot_behavior?: 'error' | 'recreate' | null
+ /**
+ * @description Replicator log level
+ * @example info
+ * @enum {string|null}
+ */
+ log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
+ /** @description Maximum number of copy connections per table */
+ max_copy_connections_per_table?: number | null
+ /** @description Maximum number of table sync workers */
+ max_table_sync_workers?: number | null
+ /** @description Memory-based backpressure configuration. Omission enables server defaults; `null` disables it. */
+ memory_backpressure?: {
+ /**
+ * @description Memory usage ratio above which backpressure is activated
+ * @example 0.85
+ */
+ activate_threshold: number
+ /**
+ * @description Memory usage ratio below which backpressure is released
+ * @example 0.75
+ */
+ resume_threshold: number
+ } | null
+ /**
+ * @description Milliseconds between one memory usage refresh and another
+ * @example 100
+ */
+ memory_refresh_interval_ms?: number | null
+ /**
+ * @description Publication name
+ * @example pub_orders
+ */
+ publication_name: string
+ /**
+ * @description Milliseconds between one replication lag refresh and another
+ * @example 10000
+ */
+ replication_lag_refresh_interval_ms?: number | null
+ /**
+ * @description Milliseconds between one retry and another for timed worker retries
+ * @example 10000
+ */
+ table_error_retry_delay_ms?: number | null
+ /**
+ * @description Maximum number of automatic timed retry attempts
+ * @example 5
+ */
+ table_error_retry_max_attempts?: number | null
+ /** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
+ table_sync_copy?:
+ | {
+ /** @enum {string} */
+ type: 'include_all_tables'
+ }
+ | {
+ /** @enum {string} */
+ type: 'skip_all_tables'
+ }
+ | {
/**
- * @description Snowflake target schema
- * @example PUBLIC
+ * @description Table ids for which copy should be performed
+ * @example [
+ * 16408
+ * ]
*/
- schema: string
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'include_tables'
+ }
+ | {
/**
- * @description Snowflake user configured for key-pair authentication
- * @example PIPELINES_USER
+ * @description Table ids for which copy should be skipped
+ * @example [
+ * 16408
+ * ]
*/
- user: string
+ table_ids: number[]
+ /** @enum {string} */
+ type: 'skip_tables'
}
+ | never
+ }
+ /**
+ * @description Source id
+ * @example 3001
+ */
+ source_id: number
+ }
+ ValidateSpamBody: {
+ content: string
+ subject: string
+ }
+ ValidateSpamResponse: {
+ rules: {
+ desc: string
+ name: string
+ score: number
+ }[]
+ }
+ VercelRedirectResponse: {
+ url: string
+ }
+ VerifyEmailBody: {
+ token: string
+ }
+ VerifyEmailResponse: {
+ /** @enum {string} */
+ result: 'success'
+ }
+ WarehouseCatalogResponse: {
+ /** @description External catalog credentials. Present only when enabled. */
+ credentials?: {
+ /**
+ * @description DuckLake catalog Postgres URL
+ * @example postgres://postgres:<pwd>@db.example.supabase.co:5432/postgres
+ */
+ catalog_url: string
+ /**
+ * @description DuckLake object storage path
+ * @example s3://warehouse/
+ */
+ data_path: string
+ /**
+ * @description DuckLake metadata schema in the catalog database
+ * @example ducklake
+ */
+ metadata_schema: string
+ /** @description S3 access key id */
+ s3_access_key_id: string
+ /**
+ * @description S3-compatible storage endpoint without protocol
+ * @example abcjuqabhgwjjutfvtpa.storage.supabase.co/storage/v1/s3
+ */
+ s3_endpoint: string
+ /**
+ * @description S3-compatible storage region
+ * @example us-east-1
+ */
+ s3_region: string
+ /** @description S3 secret access key */
+ s3_secret_access_key: string
+ }
+ /** @description Whether external catalog access is enabled */
+ enabled: boolean
+ }
+ WarehouseSetupBody: {
+ /**
+ * @description Whether to configure and install the Warehouse FDW in the project database. Defaults to false.
+ * @example false
+ */
+ install_fdw?: boolean
+ /** @description Schemas and individual tables to copy. Schema targets expand to the eligible tables present when the request is processed. */
+ targets: (
+ | {
+ /**
+ * @description Postgres schema whose currently eligible tables should be copied
+ * @example public
+ */
+ schema: string
+ /** @enum {string} */
+ type: 'schema'
+ }
+ | {
+ /**
+ * @description Postgres table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Postgres schema name
+ * @example public
+ */
+ schema: string
+ /** @enum {string} */
+ type: 'table'
}
- /** @description Pipeline configuration */
- pipeline_config?: {
- /** @description Batch configuration. Omit or use `null` for server defaults. */
- batch?: {
- /**
- * @description Maximum preferred byte size for one source batch
- * @example 8388608
- */
- max_bytes?: number
- /**
- * @description Maximum fill time in milliseconds
- * @example 200
- */
- max_fill_ms?: number
- /**
- * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
- * @example 0.2
- */
- memory_budget_ratio?: number
- } | null
+ )[]
+ }
+ WarehouseSetupResponse: {
+ /**
+ * @description Warehouse replication pipeline id
+ * @example 101
+ */
+ pipeline_id: number
+ /** @description Tables with Warehouse copies */
+ tables: {
/**
- * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
- * @example error
- * @enum {string|null}
+ * @description DuckLake schema-qualified table name
+ * @example public.orders
*/
- invalidated_slot_behavior?: 'error' | 'recreate' | null
+ copy_name: string
/**
- * @description Replicator log level
- * @example info
- * @enum {string|null}
+ * @description Replication lag in milliseconds, when available
+ * @example 12000
*/
- log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
- /** @description Maximum number of copy connections per table */
- max_copy_connections_per_table?: number | null
- /** @description Maximum number of table sync workers */
- max_table_sync_workers?: number | null
- /** @description Memory-based backpressure configuration. Omission enables server defaults; `null` disables it. */
- memory_backpressure?: {
- /**
- * @description Memory usage ratio above which backpressure is activated
- * @example 0.85
- */
- activate_threshold: number
- /**
- * @description Memory usage ratio below which backpressure is released
- * @example 0.75
- */
- resume_threshold: number
- } | null
+ lag_ms?: number
+ /**
+ * Format: date-time
+ * @description Last sync timestamp, when available
+ * @example 2026-06-23T17:48:00Z
+ */
+ last_synced_at?: string
+ /**
+ * @description Postgres table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Postgres schema name
+ * @example public
+ */
+ schema: string
+ /**
+ * @description Warehouse copy sync state derived from replication status
+ * @example live
+ * @enum {string}
+ */
+ state: 'syncing' | 'live' | 'error'
+ /**
+ * @description Warehouse table size in bytes, when available
+ * @example 197912092672
+ */
+ warehouse_size_bytes?: number
+ }[]
+ }
+ WarehouseSetupStatusResponse: {
+ /** @description Project database FDW setup markers used to derive the Warehouse FDW phase */
+ fdw_status: {
+ /**
+ * @description Whether fdw_warehouse is available to install on the project database instance
+ * @example true
+ */
+ extension_available: boolean
+ /**
+ * @description Whether the fdw_warehouse extension exists in the project database
+ * @example true
+ */
+ extension_installed: boolean
+ /**
+ * @description Whether the Warehouse foreign schema import has exposed the Warehouse snapshots table
+ * @example true
+ */
+ foreign_schema_imported: boolean
+ /**
+ * @description Whether the local Warehouse schema exists in the project database
+ * @example true
+ */
+ schema_created: boolean
+ /**
+ * @description Whether the Warehouse foreign server exists in the project database
+ * @example true
+ */
+ server_configured: boolean
+ /**
+ * @description Whether the Warehouse foreign data wrapper exists in the project database
+ * @example true
+ */
+ wrapper_installed: boolean
+ }
+ /**
+ * @description Warehouse replication pipeline id when it exists
+ * @example 101
+ */
+ pipeline_id?: number
+ /**
+ * @description Overall Warehouse setup status derived from replication state
+ * @example copying
+ * @enum {string}
+ */
+ setup_status: 'not_started' | 'setting_up' | 'copying' | 'complete' | 'error'
+ /** @description Warehouse setup phases in execution order */
+ steps: {
+ /**
+ * @description Best-effort progress or error message derived from Warehouse state
+ * @example Pending initial copy: public.orders:copying_table
+ */
+ message?: string
+ /**
+ * @description Observable Warehouse setup phase
+ * @example warehouse_copy
+ * @enum {string}
+ */
+ name: 'warehouse_pipeline' | 'warehouse_copy' | 'warehouse_fdw'
+ /**
+ * @description Derived Warehouse setup step status
+ * @example running
+ * @enum {string}
+ */
+ status: 'waiting' | 'running' | 'completed' | 'skipped' | 'error'
+ }[]
+ /** @description Warehouse linked tables and replication-derived sync state */
+ tables: {
+ /**
+ * @description DuckLake schema-qualified table name
+ * @example public.orders
+ */
+ copy_name: string
+ /**
+ * @description Replication lag in milliseconds, when available
+ * @example 12000
+ */
+ lag_ms?: number
+ /**
+ * Format: date-time
+ * @description Last sync timestamp, when available
+ * @example 2026-06-23T17:48:00Z
+ */
+ last_synced_at?: string
+ /**
+ * @description Postgres table name
+ * @example orders
+ */
+ name: string
+ /**
+ * @description Postgres schema name
+ * @example public
+ */
+ schema: string
+ /**
+ * @description Warehouse copy sync state derived from replication status
+ * @example live
+ * @enum {string}
+ */
+ state: 'syncing' | 'live' | 'error'
+ /**
+ * @description Warehouse table size in bytes, when available
+ * @example 197912092672
+ */
+ warehouse_size_bytes?: number
+ }[]
+ }
+ WarehouseTableSnapshotsResponse: {
+ /** @description Available Warehouse snapshots for the project catalog. */
+ snapshots: {
+ /**
+ * @description Snapshot author, when available.
+ * @example postgres
+ */
+ author: string | null
+ /** @description Snapshot change metadata returned by the Warehouse FDW. */
+ changes: string | null
+ /** @description Additional snapshot commit metadata returned by the Warehouse FDW. */
+ commit_extra_info: string | null
+ /** @description Snapshot commit message, when available. */
+ commit_message: string | null
+ /**
+ * @description DuckLake schema version. Returned as a string because the source value is bigint.
+ * @example 7
+ */
+ schema_version: string | null
+ /**
+ * @description DuckLake snapshot id. Returned as a string because the source value is bigint.
+ * @example 42
+ */
+ snapshot_id: string
+ /**
+ * @description Snapshot timestamp returned by the Warehouse FDW.
+ * @example 2026-06-24 08:00:00+00
+ */
+ snapshot_time: string | null
+ }[]
+ }
+ WarehouseTablesResponse: {
+ /** @description Tables with Warehouse copies */
+ tables: {
+ /**
+ * @description DuckLake schema-qualified table name
+ * @example public.orders
+ */
+ copy_name: string
+ /**
+ * @description Replication lag in milliseconds, when available
+ * @example 12000
+ */
+ lag_ms?: number
+ /**
+ * Format: date-time
+ * @description Last sync timestamp, when available
+ * @example 2026-06-23T17:48:00Z
+ */
+ last_synced_at?: string
/**
- * @description Milliseconds between one memory usage refresh and another
- * @example 100
+ * @description Postgres table name
+ * @example orders
*/
- memory_refresh_interval_ms?: number | null
+ name: string
/**
- * @description Publication name
- * @example pub_orders
+ * @description Postgres schema name
+ * @example public
+ */
+ schema: string
+ /**
+ * @description Warehouse copy sync state derived from replication status
+ * @example live
+ * @enum {string}
+ */
+ state: 'syncing' | 'live' | 'error'
+ /**
+ * @description Warehouse table size in bytes, when available
+ * @example 197912092672
*/
+ warehouse_size_bytes?: number
+ }[]
+ }
+ WorkflowRunResponse: {
+ branch_id: string
+ check_run_id: number | null
+ created_at: string
+ git_config?: unknown
+ id: string
+ /** @enum {string} */
+ status:
+ | 'CREATING_PROJECT'
+ | 'RUNNING_MIGRATIONS'
+ | 'MIGRATIONS_PASSED'
+ | 'MIGRATIONS_FAILED'
+ | 'FUNCTIONS_DEPLOYED'
+ | 'FUNCTIONS_FAILED'
+ updated_at: string
+ workdir: string | null
+ }
+ }
+ responses: never
+ parameters: never
+ requestBodies: never
+ headers: never
+ pathItems: never
+}
+export type $defs = Record<string, never>
+export interface operations {
+ DestinationsController_getDestinations: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description All destinations for the project. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['DestinationsResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing destinations. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsController_createDestination: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['CreateDestinationBody']
+ }
+ }
+ responses: {
+ /** @description Destination created. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['CreateDestinationResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while creating destination. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsPipelinesController_createDestinationPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['CreateReplicationDestinationPipelineBody']
+ }
+ }
+ responses: {
+ /** @description Destination and pipeline created. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['CreateDestinationPipelineResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while creating destination or pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsPipelinesController_updateDestinationPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Destination id */
+ destination_id: number
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['UpdateReplicationDestinationPipelineBody']
+ }
+ }
+ responses: {
+ /** @description Destination and pipeline updated. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while updating destination or pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsPipelinesController_deleteDestinationPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Destination id */
+ destination_id: number
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Destination and pipeline deleted. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['DeleteDestinationPipelineResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Pipeline or destination not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Pipeline is still active. */
+ 409: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while deleting destination or pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsController_getDestination: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Destination id */
+ destination_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Destination details. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['DestinationResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while retrieving destination. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsController_updateDestination: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Destination id */
+ destination_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['UpdateDestinationBody']
+ }
+ }
+ responses: {
+ /** @description Destination updated. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while updating destination. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsController_deleteDestination: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Destination id */
+ destination_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Destination deleted. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Destination not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Destination has an active or attached pipeline. */
+ 409: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while deleting destination. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ DestinationsController_validateDestination: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['ValidateDestinationBody']
+ }
+ }
+ responses: {
+ /** @description Validation completed. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['ValidateDestinationResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while validating destination. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_getPipelines: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description All pipelines for the project. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PipelinesResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing pipelines. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_createPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['CreatePipelineBody']
+ }
+ }
+ responses: {
+ /** @description Pipeline created. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['CreatePipelineResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while creating pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_getPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Pipeline details. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PipelineResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while retrieving pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_updatePipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['UpdatePipelineBody']
+ }
+ }
+ responses: {
+ /** @description Pipeline updated. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while updating pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_deletePipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Pipeline deleted. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Pipeline not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Pipeline is still active. */
+ 409: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while deleting pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_getPipelineReplicationStatus: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Pipeline replication status. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PipelineReplicationStatusResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while retrieving replication status. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_restartPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Pipeline restart accepted. */
+ 202: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Pipeline is not running. */
+ 409: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while restarting pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_rollbackTables: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['RollbackTablesBody']
+ }
+ }
+ responses: {
+ /** @description New table states after rollback. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['RollbackTablesResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while rolling back tables. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_startPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Pipeline started. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while starting pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_getPipelineStatus: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Current pipeline status. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PipelineStatusResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while retrieving pipeline status. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_stopPipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Pipeline stopped. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while stopping pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_getPipelineVersion: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Current pipeline version. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PipelineVersionResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while retrieving pipeline version. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_updatePipelineVersion: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Pipeline id */
+ pipeline_id: number
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['UpdatePipelineVersionBody']
+ }
+ }
+ responses: {
+ /** @description Pipeline version updated. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while updating pipeline version. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ PipelinesController_validatePipeline: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['ValidatePipelineBody']
+ }
+ }
+ responses: {
+ /** @description Validation completed. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['ValidatePipelineResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while validating pipeline. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ SourcesController_getSources: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description All sources for the project. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['SourcesResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing sources. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ SourcesController_createSource: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Source created. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['CreateSourceResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while creating source. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ SourcesController_getPublications: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description All publications for the source. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PublicationsResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing publications. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ SourcesController_createPublication: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['CreatePublicationBody']
+ }
+ }
+ responses: {
+ /** @description Publication created. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while creating publication. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ SourcesController_updatePublication: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Publication name */
publication_name: string
- /**
- * @description Milliseconds between one replication lag refresh and another
- * @example 10000
- */
- replication_lag_refresh_interval_ms?: number | null
- /**
- * @description Milliseconds between one retry and another for timed worker retries
- * @example 10000
- */
- table_error_retry_delay_ms?: number | null
- /**
- * @description Maximum number of automatic timed retry attempts
- * @example 5
- */
- table_error_retry_max_attempts?: number | null
- /** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
- table_sync_copy?:
- | {
- /** @enum {string} */
- type: 'include_all_tables'
- }
- | {
- /** @enum {string} */
- type: 'skip_all_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be performed
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'include_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be skipped
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'skip_tables'
- }
- | never
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
+ }
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['UpdatePublicationBody']
+ }
+ }
+ responses: {
+ /** @description Publication updated. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while updating publication. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ SourcesController_deletePublication: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Publication name */
+ publication_name: string
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Publication deleted. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Source not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while deleting publication. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
}
- /**
- * @description Source id
- * @example 1
- */
- source_id?: number
}
- ValidateReplicationPipelineBody: {
- /** @description Pipeline configuration */
- config: {
- /** @description Batch configuration. Omit or use `null` for server defaults. */
- batch?: {
- /**
- * @description Maximum preferred byte size for one source batch
- * @example 8388608
- */
- max_bytes?: number
- /**
- * @description Maximum fill time in milliseconds
- * @example 200
- */
- max_fill_ms?: number
- /**
- * @description Ratio of process memory reserved for incoming stream batch bytes, in (0, 1]
- * @example 0.2
- */
- memory_budget_ratio?: number
- } | null
- /**
- * @description Behavior when the replication slot is invalidated. `error` prevents pipeline startup and requires manual intervention. `recreate` automatically recreates the slot and restarts replication from scratch.
- * @example error
- * @enum {string|null}
- */
- invalidated_slot_behavior?: 'error' | 'recreate' | null
- /**
- * @description Replicator log level
- * @example info
- * @enum {string|null}
- */
- log_level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | null
- /** @description Maximum number of copy connections per table */
- max_copy_connections_per_table?: number | null
- /** @description Maximum number of table sync workers */
- max_table_sync_workers?: number | null
- /** @description Memory-based backpressure configuration. Omission enables server defaults; `null` disables it. */
- memory_backpressure?: {
- /**
- * @description Memory usage ratio above which backpressure is activated
- * @example 0.85
- */
- activate_threshold: number
- /**
- * @description Memory usage ratio below which backpressure is released
- * @example 0.75
- */
- resume_threshold: number
- } | null
- /**
- * @description Milliseconds between one memory usage refresh and another
- * @example 100
- */
- memory_refresh_interval_ms?: number | null
- /**
- * @description Publication name
- * @example pub_orders
- */
+ }
+ SourcesController_getCostEstimate: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Publication name */
publication_name: string
- /**
- * @description Milliseconds between one replication lag refresh and another
- * @example 10000
- */
- replication_lag_refresh_interval_ms?: number | null
- /**
- * @description Milliseconds between one retry and another for timed worker retries
- * @example 10000
- */
- table_error_retry_delay_ms?: number | null
- /**
- * @description Maximum number of automatic timed retry attempts
- * @example 5
- */
- table_error_retry_max_attempts?: number | null
- /** @description Selection rules for tables participating in initial table copy. Omit or use `null` to copy all tables. */
- table_sync_copy?:
- | {
- /** @enum {string} */
- type: 'include_all_tables'
- }
- | {
- /** @enum {string} */
- type: 'skip_all_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be performed
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'include_tables'
- }
- | {
- /**
- * @description Table ids for which copy should be skipped
- * @example [
- * 16408
- * ]
- */
- table_ids: number[]
- /** @enum {string} */
- type: 'skip_tables'
- }
- | never
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Cost estimate for replicating the publication. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['CostEstimateResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while estimating replication cost. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ SourcesController_getTables: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description All tables for the source. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['TablesResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing tables. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ TenantsController_deleteTenant: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description Tenant deleted. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Tenant not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Tenant has active pipelines. */
+ 409: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while deleting tenant. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
}
- /**
- * @description Source id
- * @example 3001
- */
- source_id: number
}
- ValidateSpamBody: {
- content: string
- subject: string
+ }
+ TenantsSourcesController_createTenantSource: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ }
+ cookie?: never
}
- ValidateSpamResponse: {
- rules: {
- desc: string
- name: string
- score: number
- }[]
+ requestBody?: never
+ responses: {
+ /** @description Tenant and source created. */
+ 201: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['CreateTenantSourceResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while creating tenant or source. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
}
- VercelRedirectResponse: {
- url: string
+ }
+ V2SourcesController_getPublications: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
}
- VerifyEmailBody: {
- token: string
+ requestBody?: never
+ responses: {
+ /** @description All publications for the source. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['ReadPublicationsResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing publications. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
}
- VerifyEmailResponse: {
- /** @enum {string} */
- result: 'success'
+ }
+ V2SourcesController_getPublication: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Publication name */
+ publication_name: string
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
}
- WarehouseCatalogResponse: {
- /** @description External catalog credentials. Present only when enabled. */
- credentials?: {
- /**
- * @description DuckLake catalog Postgres URL
- * @example postgres://postgres:<pwd>@db.example.supabase.co:5432/postgres
- */
- catalog_url: string
- /**
- * @description DuckLake object storage path
- * @example s3://warehouse/
- */
- data_path: string
- /**
- * @description DuckLake metadata schema in the catalog database
- * @example ducklake
- */
- metadata_schema: string
- /** @description S3 access key id */
- s3_access_key_id: string
- /**
- * @description S3-compatible storage endpoint without protocol
- * @example abcjuqabhgwjjutfvtpa.storage.supabase.co/storage/v1/s3
- */
- s3_endpoint: string
- /**
- * @description S3-compatible storage region
- * @example us-east-1
- */
- s3_region: string
- /** @description S3 secret access key */
- s3_secret_access_key: string
+ requestBody?: never
+ responses: {
+ /** @description The publication. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PublicationDetailsResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Source or publication not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while reading publication. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
}
- /** @description Whether external catalog access is enabled */
- enabled: boolean
}
- WarehouseSetupBody: {
- /**
- * @description Whether to configure and install the Warehouse FDW in the project database. Defaults to false.
- * @example false
- */
- install_fdw?: boolean
- /** @description Schemas and individual tables to copy. Schema targets expand to the eligible tables present when the request is processed. */
- targets: (
- | {
- /**
- * @description Postgres schema whose currently eligible tables should be copied
- * @example public
- */
- schema: string
- /** @enum {string} */
- type: 'schema'
- }
- | {
- /**
- * @description Postgres table name
- * @example orders
- */
- name: string
- /**
- * @description Postgres schema name
- * @example public
- */
- schema: string
- /** @enum {string} */
- type: 'table'
- }
- )[]
+ }
+ V2SourcesController_putPublication: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Publication name */
+ publication_name: string
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
}
- WarehouseSetupResponse: {
- /**
- * @description Warehouse replication pipeline id
- * @example 101
- */
- pipeline_id: number
- /** @description Tables with Warehouse copies */
- tables: {
- /**
- * @description DuckLake schema-qualified table name
- * @example public.orders
- */
- copy_name: string
- /**
- * @description Replication lag in milliseconds, when available
- * @example 12000
- */
- lag_ms?: number
- /**
- * Format: date-time
- * @description Last sync timestamp, when available
- * @example 2026-06-23T17:48:00Z
- */
- last_synced_at?: string
- /**
- * @description Postgres table name
- * @example orders
- */
- name: string
- /**
- * @description Postgres schema name
- * @example public
- */
- schema: string
- /**
- * @description Warehouse copy sync state derived from replication status
- * @example live
- * @enum {string}
- */
- state: 'syncing' | 'live' | 'error'
- /**
- * @description Warehouse table size in bytes, when available
- * @example 197912092672
- */
- warehouse_size_bytes?: number
- }[]
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['PutPublicationBody']
+ }
}
- WarehouseSetupStatusResponse: {
- /** @description Project database FDW setup markers used to derive the Warehouse FDW phase */
- fdw_status: {
- /**
- * @description Whether fdw_warehouse is available to install on the project database instance
- * @example true
- */
- extension_available: boolean
- /**
- * @description Whether the fdw_warehouse extension exists in the project database
- * @example true
- */
- extension_installed: boolean
- /**
- * @description Whether the Warehouse foreign schema import has exposed the Warehouse snapshots table
- * @example true
- */
- foreign_schema_imported: boolean
- /**
- * @description Whether the local Warehouse schema exists in the project database
- * @example true
- */
- schema_created: boolean
- /**
- * @description Whether the Warehouse foreign server exists in the project database
- * @example true
- */
- server_configured: boolean
- /**
- * @description Whether the Warehouse foreign data wrapper exists in the project database
- * @example true
- */
- wrapper_installed: boolean
+ responses: {
+ /** @description The publication after applying the configuration. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PublicationDetailsResponse_Output']
+ }
}
- /**
- * @description Warehouse replication pipeline id when it exists
- * @example 101
- */
- pipeline_id?: number
- /**
- * @description Overall Warehouse setup status derived from replication state
- * @example copying
- * @enum {string}
- */
- setup_status: 'not_started' | 'setting_up' | 'copying' | 'complete' | 'error'
- /** @description Warehouse setup phases in execution order */
- steps: {
- /**
- * @description Best-effort progress or error message derived from Warehouse state
- * @example Pending initial copy: public.orders:copying_table
- */
- message?: string
- /**
- * @description Observable Warehouse setup phase
- * @example warehouse_copy
- * @enum {string}
- */
- name: 'warehouse_pipeline' | 'warehouse_copy' | 'warehouse_fdw'
- /**
- * @description Derived Warehouse setup step status
- * @example running
- * @enum {string}
- */
- status: 'waiting' | 'running' | 'completed' | 'skipped' | 'error'
- }[]
- /** @description Warehouse linked tables and replication-derived sync state */
- tables: {
- /**
- * @description DuckLake schema-qualified table name
- * @example public.orders
- */
- copy_name: string
- /**
- * @description Replication lag in milliseconds, when available
- * @example 12000
- */
- lag_ms?: number
- /**
- * Format: date-time
- * @description Last sync timestamp, when available
- * @example 2026-06-23T17:48:00Z
- */
- last_synced_at?: string
- /**
- * @description Postgres table name
- * @example orders
- */
- name: string
- /**
- * @description Postgres schema name
- * @example public
- */
- schema: string
- /**
- * @description Warehouse copy sync state derived from replication status
- * @example live
- * @enum {string}
- */
- state: 'syncing' | 'live' | 'error'
- /**
- * @description Warehouse table size in bytes, when available
- * @example 197912092672
- */
- warehouse_size_bytes?: number
- }[]
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while writing publication. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ V2SourcesController_deletePublication: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Publication name */
+ publication_name: string
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
}
- WarehouseTableSnapshotsResponse: {
- /** @description Available Warehouse snapshots for the project catalog. */
- snapshots: {
- /**
- * @description Snapshot author, when available.
- * @example postgres
- */
- author: string | null
- /** @description Snapshot change metadata returned by the Warehouse FDW. */
- changes: string | null
- /** @description Additional snapshot commit metadata returned by the Warehouse FDW. */
- commit_extra_info: string | null
- /** @description Snapshot commit message, when available. */
- commit_message: string | null
- /**
- * @description DuckLake schema version. Returned as a string because the source value is bigint.
- * @example 7
- */
- schema_version: string | null
- /**
- * @description DuckLake snapshot id. Returned as a string because the source value is bigint.
- * @example 42
- */
- snapshot_id: string
- /**
- * @description Snapshot timestamp returned by the Warehouse FDW.
- * @example 2026-06-24 08:00:00+00
- */
- snapshot_time: string | null
- }[]
+ requestBody?: never
+ responses: {
+ /** @description Publication deleted. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description This feature requires the Pro, Team, or Enterprise organization plan. */
+ 402: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['PlanGateErrorBody']
+ }
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Source or publication not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while deleting publication. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
}
- WarehouseTablesResponse: {
- /** @description Tables with Warehouse copies */
- tables: {
- /**
- * @description DuckLake schema-qualified table name
- * @example public.orders
- */
- copy_name: string
- /**
- * @description Replication lag in milliseconds, when available
- * @example 12000
- */
- lag_ms?: number
- /**
- * Format: date-time
- * @description Last sync timestamp, when available
- * @example 2026-06-23T17:48:00Z
- */
- last_synced_at?: string
- /**
- * @description Postgres table name
- * @example orders
- */
- name: string
- /**
- * @description Postgres schema name
- * @example public
- */
- schema: string
- /**
- * @description Warehouse copy sync state derived from replication status
- * @example live
- * @enum {string}
- */
- state: 'syncing' | 'live' | 'error'
- /**
- * @description Warehouse table size in bytes, when available
- * @example 197912092672
- */
- warehouse_size_bytes?: number
- }[]
+ }
+ V2SourcesController_getTables: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ }
+ cookie?: never
}
- WorkflowRunResponse: {
- branch_id: string
- check_run_id: number | null
- created_at: string
- git_config?: unknown
- id: string
- /** @enum {string} */
- status:
- | 'CREATING_PROJECT'
- | 'RUNNING_MIGRATIONS'
- | 'MIGRATIONS_PASSED'
- | 'MIGRATIONS_FAILED'
- | 'FUNCTIONS_DEPLOYED'
- | 'FUNCTIONS_FAILED'
- updated_at: string
- workdir: string | null
+ requestBody?: never
+ responses: {
+ /** @description All tables for the source. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['ReadTablesResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing tables. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ }
+ }
+ V2SourcesController_getTableColumns: {
+ parameters: {
+ query?: never
+ header?: never
+ path: {
+ /** @description Project ref */
+ ref: string
+ /** @description Source id */
+ source_id: number
+ /** @description Table id (Postgres OID) */
+ table_id: number
+ }
+ cookie?: never
+ }
+ requestBody?: never
+ responses: {
+ /** @description All columns for the table. */
+ 200: {
+ headers: {
+ [name: string]: unknown
+ }
+ content: {
+ 'application/json': components['schemas']['ReadColumnsResponse_Output']
+ }
+ }
+ /** @description Unauthorized */
+ 401: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Forbidden action */
+ 403: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Source or table not found. */
+ 404: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Rate limit exceeded */
+ 429: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
+ /** @description Unexpected error while listing columns. */
+ 500: {
+ headers: {
+ [name: string]: unknown
+ }
+ content?: never
+ }
}
}
- responses: never
- parameters: never
- requestBodies: never
- headers: never
- pathItems: never
-}
-export type $defs = Record<string, never>
-export interface operations {
GoTrueConfigController_getGoTrueConfig: {
parameters: {
query?: never