diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx index 9b14461e8ac..ee640523a61 100644 --- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx +++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AdvancedSettings.tsx @@ -72,35 +72,6 @@ export const AdvancedSettings = ({ )} /> - ( - -

Number of rows to send in a batch.

-

Larger batches use more memory, with the risk of running out of memory.

- - } - > - - - - - -
- )} - /> - + ( + +

+ Number of copy connections each table sync worker can use in parallel when + copying a table. +

+ + } + > + + + + + +
+ )} + /> + {/* BigQuery-specific: Max staleness */} {type === 'BigQuery' && ( { if (!projectRef) throw new Error('projectRef is required') if (!sourceId) throw new Error('sourceId is required') - const batchConfig = - maxFillMs !== undefined || maxSize !== undefined - ? { max_fill_ms: maxFillMs, max_size: maxSize } - : undefined + const batchConfig = maxFillMs !== undefined ? { max_fill_ms: maxFillMs } : undefined const { data, error } = await post('/platform/replication/{ref}/pipelines/validate', { params: { path: { ref: projectRef } }, @@ -40,6 +37,7 @@ async function validatePipeline( config: { publication_name: publicationName, max_table_sync_workers: maxTableSyncWorkers, + max_copy_connections_per_table: maxCopyConnectionsPerTable, batch: batchConfig, }, }, diff --git a/packages/api-types/types/api.d.ts b/packages/api-types/types/api.d.ts index 32207dabcdb..0e5003ce695 100644 --- a/packages/api-types/types/api.d.ts +++ b/packages/api-types/types/api.d.ts @@ -934,7 +934,8 @@ export interface paths { path?: never cookie?: never } - get?: never + /** Get database disk attributes */ + get: operations['v1-get-database-disk'] put?: never /** Modify database disk */ post: operations['v1-modify-database-disk'] @@ -2806,6 +2807,23 @@ export interface components { type: 'io2' } } + DiskResponse: { + attributes: + | { + iops: number + size_gb: number + throughput_mibps?: number + /** @enum {string} */ + type: 'gp3' + } + | { + iops: number + size_gb: number + /** @enum {string} */ + type: 'io2' + } + last_modified_at?: string + } DiskUtilMetricsResponse: { metrics: { fs_avail_bytes: number @@ -4821,6 +4839,7 @@ export interface components { * @description Deprecated. Use `status` instead. */ healthy: boolean + replication_connected: boolean } | { db_schema: string @@ -8291,6 +8310,56 @@ export interface operations { } } } + 'v1-get-database-disk': { + parameters: { + query?: never + header?: never + path: { + /** @description Project ref */ + ref: string + } + cookie?: never + } + requestBody?: never + responses: { + 200: { + headers: { + [name: string]: unknown + } + content: { + 'application/json': components['schemas']['DiskResponse'] + } + } + /** @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 Failed to get database disk attributes */ + 500: { + headers: { + [name: string]: unknown + } + content?: never + } + } + } 'v1-modify-database-disk': { parameters: { query?: never diff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.ts index f695cc39e5b..9d917f93f37 100644 --- a/packages/api-types/types/platform.d.ts +++ b/packages/api-types/types/platform.d.ts @@ -5451,12 +5451,9 @@ export interface components { * @example 200 */ max_fill_ms?: number - /** - * @description Maximum size of the batch - * @example 200 - */ - max_size?: number } + /** @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 /** @@ -5481,12 +5478,9 @@ export interface components { * @example 200 */ max_fill_ms?: number - /** - * @description Maximum size of the batch - * @example 200 - */ - max_size?: number } + /** @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 /** @@ -8766,12 +8760,9 @@ export interface components { * @example 200 */ max_fill_ms?: number - /** - * @description Maximum size of the batch - * @example 200 - */ - max_size?: number } + /** @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 /** @@ -8828,12 +8819,9 @@ export interface components { * @example 200 */ max_fill_ms?: number - /** - * @description Maximum size of the batch - * @example 200 - */ - max_size?: number } + /** @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 /** @@ -10365,12 +10353,9 @@ export interface components { * @example 200 */ max_fill_ms?: number - /** - * @description Maximum size of the batch - * @example 200 - */ - max_size?: number } + /** @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 /** @@ -10395,12 +10380,9 @@ export interface components { * @example 200 */ max_fill_ms?: number - /** - * @description Maximum size of the batch - * @example 200 - */ - max_size?: number } + /** @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 /** @@ -10806,12 +10788,9 @@ export interface components { * @example 200 */ max_fill_ms?: number - /** - * @description Maximum size of the batch - * @example 200 - */ - max_size?: number } + /** @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 /**