Skip to content

Commit

Permalink
fix all the lint and type error
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Jul 20, 2024
1 parent 49fe91d commit abf2650
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/app/api/temp_ops/[session_id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/cloudflare-d1-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
5 changes: 2 additions & 3 deletions src/drivers/remote-driver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { InStatement } from "@libsql/client/web";
import {
BaseDriver,
DatabaseResultSet,
Expand Down Expand Up @@ -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<ApiOpsQueryResponse>({
type: "query",
statement: stmt,
Expand All @@ -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<ApiOpsBatchResponse>({
type: "batch",
statements: stmt,
Expand Down
1 change: 0 additions & 1 deletion src/drivers/rqlite-driver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { InStatement } from "@libsql/client";
import {
DatabaseHeader,
DatabaseResultSet,
Expand Down
5 changes: 2 additions & 3 deletions src/lib/api/api-request-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/lib/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export async function makeTestDatabase(
createdAt: now,
description: "",
driver: "turso",
databaseName: "",
host: "http://localhost:8080",
name: "hello",
id: id,
Expand Down

0 comments on commit abf2650

Please sign in to comment.