diff --git a/src/app/api/temp_ops/[session_id]/route.ts b/src/app/api/temp_ops/[session_id]/route.ts index a361d48d..d91ea89c 100644 --- a/src/app/api/temp_ops/[session_id]/route.ts +++ b/src/app/api/temp_ops/[session_id]/route.ts @@ -54,6 +54,7 @@ export const POST = withErrorHandler<{ params: { session_id: string } }>( body, permission: { canExecuteQuery: true, isOwner: true, roles: [] }, database: { + databaseName: "", driver: session.driver, host: config.url, password: config.password ?? null, diff --git a/src/drivers/cloudflare-d1-driver.ts b/src/drivers/cloudflare-d1-driver.ts index 5b489cad..33119609 100644 --- a/src/drivers/cloudflare-d1-driver.ts +++ b/src/drivers/cloudflare-d1-driver.ts @@ -29,7 +29,7 @@ function transformRawResult(raw: CloudflareResult): DatabaseResultSet { const values = raw.results.rows; const headerSet = new Set(); - const headers: DatabaseHeader[] = columns.map((colName, colIdx) => { + const headers: DatabaseHeader[] = columns.map((colName) => { let renameColName = colName; for (let i = 0; i < 20; i++) { diff --git a/src/drivers/remote-driver.ts b/src/drivers/remote-driver.ts index 520314df..7eb3a55c 100644 --- a/src/drivers/remote-driver.ts +++ b/src/drivers/remote-driver.ts @@ -1,4 +1,3 @@ -import { InStatement } from "@libsql/client/web"; import { BaseDriver, DatabaseResultSet, @@ -54,7 +53,7 @@ export default class RemoteDriver implements BaseDriver { return json as T; } - async query(stmt: InStatement) { + async query(stmt: string) { const r = await this.request({ type: "query", statement: stmt, @@ -63,7 +62,7 @@ export default class RemoteDriver implements BaseDriver { return r.data; } - async transaction(stmt: InStatement[]) { + async transaction(stmt: string[]) { const r = await this.request({ type: "batch", statements: stmt, diff --git a/src/drivers/rqlite-driver.ts b/src/drivers/rqlite-driver.ts index 9033c263..19146d42 100644 --- a/src/drivers/rqlite-driver.ts +++ b/src/drivers/rqlite-driver.ts @@ -1,4 +1,3 @@ -import { InStatement } from "@libsql/client"; import { DatabaseHeader, DatabaseResultSet, diff --git a/src/lib/api/api-request-types.ts b/src/lib/api/api-request-types.ts index 8d26020b..662b0537 100644 --- a/src/lib/api/api-request-types.ts +++ b/src/lib/api/api-request-types.ts @@ -2,16 +2,15 @@ import { DatabaseTableOperation, SelectFromTableOptions, } from "@/drivers/base-driver"; -import { InStatement } from "@libsql/client/web"; export interface RequestOperationBatch { type: "batch"; - statements: InStatement[]; + statements: string[]; } export interface RequestOperationQuery { type: "query"; - statement: InStatement; + statement: string; } export interface RequestOperationSchemas { diff --git a/src/lib/test-helper.ts b/src/lib/test-helper.ts index 41f48166..a3379fa7 100644 --- a/src/lib/test-helper.ts +++ b/src/lib/test-helper.ts @@ -111,6 +111,7 @@ export async function makeTestDatabase( createdAt: now, description: "", driver: "turso", + databaseName: "", host: "http://localhost:8080", name: "hello", id: id,