Type BuildSchemaFromSource
This commit is contained in:
parent
024c3ec3ae
commit
92eb185390
|
@ -8,6 +8,8 @@ import { getIntegration } from "../../integrations"
|
||||||
import { invalidateDynamicVariables } from "../../threads/utils"
|
import { invalidateDynamicVariables } from "../../threads/utils"
|
||||||
import { context, db as dbCore, events } from "@budibase/backend-core"
|
import { context, db as dbCore, events } from "@budibase/backend-core"
|
||||||
import {
|
import {
|
||||||
|
BuildSchemaFromSourceRequest,
|
||||||
|
BuildSchemaFromSourceResponse,
|
||||||
CreateDatasourceRequest,
|
CreateDatasourceRequest,
|
||||||
CreateDatasourceResponse,
|
CreateDatasourceResponse,
|
||||||
Datasource,
|
Datasource,
|
||||||
|
@ -67,7 +69,9 @@ export async function information(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function buildSchemaFromDb(ctx: UserCtx) {
|
export async function buildSchemaFromDb(
|
||||||
|
ctx: UserCtx<BuildSchemaFromSourceRequest, BuildSchemaFromSourceResponse>
|
||||||
|
) {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const tablesFilter = ctx.request.body.tablesFilter
|
const tablesFilter = ctx.request.body.tablesFilter
|
||||||
const datasource = await sdk.datasources.get(ctx.params.datasourceId)
|
const datasource = await sdk.datasources.get(ctx.params.datasourceId)
|
||||||
|
|
|
@ -35,3 +35,12 @@ export interface FetchDatasourceInfoResponse {
|
||||||
export interface UpdateDatasourceRequest extends Datasource {
|
export interface UpdateDatasourceRequest extends Datasource {
|
||||||
datasource: Datasource
|
datasource: Datasource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface BuildSchemaFromSourceRequest {
|
||||||
|
tablesFilter?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BuildSchemaFromSourceResponse {
|
||||||
|
datasource: Datasource
|
||||||
|
errors: Record<string, string>
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue