refactor: clean up database module by removing unused SelectQueryResult type and disabling eslint for explicit any usage

This commit is contained in:
Huakun Shen 2025-03-25 04:16:47 -04:00
parent 37c72a3931
commit 20449b846b
No known key found for this signature in database

View File

@ -1,15 +1,8 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as schema from "@kksh/drizzle/schema" import * as schema from "@kksh/drizzle/schema"
import * as dbCmd from "@kunkunapi/src/commands/db" import * as dbCmd from "@kunkunapi/src/commands/db"
import Database from "@tauri-apps/plugin-sql"
import { drizzle } from "drizzle-orm/sqlite-proxy" import { drizzle } from "drizzle-orm/sqlite-proxy"
/**
* Represents the result of a SELECT query.
*/
export type SelectQueryResult = {
[key: string]: any
}
/** /**
* Loads the sqlite database via the Tauri Proxy. * Loads the sqlite database via the Tauri Proxy.
*/ */
@ -22,11 +15,11 @@ export const db = drizzle<typeof schema>(
async (sql, params, method) => { async (sql, params, method) => {
let rows: any = [] let rows: any = []
let results = [] let results = []
console.log({ // console.log({
sql, // sql,
params, // params,
method // method
}) // })
// If the query is a SELECT, use the select method // If the query is a SELECT, use the select method
if (isSelectQuery(sql)) { if (isSelectQuery(sql)) {
rows = await dbCmd.select(sql, params).catch((e) => { rows = await dbCmd.select(sql, params).catch((e) => {