mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-09-01 10:42:00 +00:00
refactor: clean up database module by removing unused SelectQueryResult type and disabling eslint for explicit any usage
This commit is contained in:
parent
37c72a3931
commit
20449b846b
@ -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) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user