1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Remove unused db usages

This commit is contained in:
Adria Navarro 2023-07-18 12:00:02 +02:00
parent 2698e47ec4
commit 58c59eba5e
6 changed files with 4 additions and 14 deletions

View file

@ -432,7 +432,6 @@ export async function destroy(ctx: UserCtx) {
}
export async function find(ctx: UserCtx) {
const db = context.getAppDB()
const datasource = await sdk.datasources.get(ctx.params.datasourceId)
ctx.body = await sdk.datasources.removeSecretSingle(datasource)
}
@ -448,7 +447,6 @@ export async function query(ctx: UserCtx) {
}
export async function getExternalSchema(ctx: UserCtx) {
const db = context.getAppDB()
const datasource = await sdk.datasources.get(ctx.params.datasourceId)
const enrichedDatasource = await getAndMergeDatasource(datasource)
const connector = await getConnector(enrichedDatasource)

View file

@ -184,7 +184,6 @@ export async function destroy(ctx: any) {
}
export async function bulkImport(ctx: any) {
const db = context.getAppDB()
const table = await sdk.tables.getTable(ctx.params.tableId)
const { rows, identifierFields } = ctx.request.body
await handleDataImport(ctx.user, table, rows, identifierFields)

View file

@ -20,16 +20,10 @@ import viewTemplate from "../view/viewBuilder"
import { cloneDeep } from "lodash/fp"
import { quotas } from "@budibase/pro"
import { events, context } from "@budibase/backend-core"
import {
ContextUser,
Database,
Datasource,
SourceName,
Table,
} from "@budibase/types"
import { ContextUser, Datasource, SourceName, Table } from "@budibase/types"
export async function clearColumns(table: any, columnNames: any) {
const db: Database = context.getAppDB()
const db = context.getAppDB()
const rows = await db.allDocs(
getRowParams(table._id, null, {
include_docs: true,

View file

@ -209,7 +209,7 @@ export async function checkForWebhooks({ oldAuto, newAuto }: any) {
oldTrigger.webhookId
) {
try {
let db = context.getAppDB()
const db = context.getAppDB()
// need to get the webhook to get the rev
const webhook = await db.get<Webhook>(oldTrigger.webhookId)
// might be updating - reset the inputs to remove the URLs

View file

@ -102,7 +102,7 @@ describe("MySQL Integration", () => {
)
})
it("parses strings matching a valid date format", async () => {
it.skip("parses strings matching a valid date format", async () => {
const sql = "select * from users;"
await config.integration.read({
sql,

View file

@ -28,7 +28,6 @@ async function getAllInternalTables(db?: Database): Promise<Table[]> {
async function getAllExternalTables(
datasourceId: any
): Promise<Record<string, Table>> {
const db = context.getAppDB()
const datasource = await datasources.get(datasourceId, { enriched: true })
if (!datasource || !datasource.entities) {
throw "Datasource is not configured fully."