{ if (e.key === 'Escape') { if (replResultData) { replResultData = undefined } } }} /> {#snippet errorPane()}
{loadError?.message}
{/snippet} {#if (loadError || dbSchema) && ws && input} {@const _input = input} {@const dbType = getDbType(_input)} {@const shownSchema = loadError || !dbSchema ? emptySchemaFor(_input) : dbSchema}
{ // Only proceed if the click is directly on this div and not on the child elements if (e.target === e.currentTarget) { replResultData = undefined } }} > {#if replResultData} {#key replResultData} {/key} {/if}
Object.values(s)).length} dbSchema={shownSchema} mainPane={loadError ? errorPane : undefined} colDefs={loadError ? undefined : colDefs.current} dbTableOpsFactory={({ colDefs, tableKey, whereClause }) => dbTableOpsWithPreviewScripts({ colDefs, tableKey, whereClause, input: _input, workspace: ws, tag: workerTag })} dbSchemaOps={dbSchemaOpsWithPreviewScripts({ input: _input, workspace: ws, tag: workerTag, confirmRunOutOfOrder: (pending) => outOfOrderModal.ask({ title: 'Run migration out of order', confirmationText: 'Run anyway', children: outOfOrderRunMessage(pending) }) })} initialTableKey={input.specificTable} initialSchemaKey={input.specificSchema} asset={_input.type == 'ducklake' ? { kind: 'ducklake', path: _input.ducklake } : _input.resourcePath.startsWith('datatable://') ? { kind: 'datatable', path: _input.resourcePath.substring('datatable://'.length) } : undefined} {dbType} refresh={() => refresh()} {datatableTree} {datatableTreeLoading} {onSelectDatatable} {onSelectRole} workspace={ws} currentRole={input.type === 'database' ? input.role : undefined} bind:pendingAction {onDatatableAction} {canManageDatatable} {onImport} bind:selectedSchemaKey bind:selectedTableKey {multiSelectMode} bind:selectedTables bind:this={_dbManager} {disabledTables} features={getDbFeatures(input)} />
{#if showRepl} { replResultData = data }} onSchemaChange={() => refresh()} placeholderTableName={sortArray( Object.keys( shownSchema.schema[ 'public' in shownSchema.schema ? 'public' : 'dbo' in shownSchema.schema ? 'dbo' : Object.keys(shownSchema.schema ?? {})?.[0] ] ?? {} ) )?.[0]} /> {/if}
{:else} {#if slowLoad} The schema query is taking a while. It runs as a job, so it waits for a worker serving its tag to be free. {#if jobTag} {/if} {/if} {/if}