adjust so DB calls go to the factory

This commit is contained in:
2025-05-26 13:59:34 -06:00
parent bb0d8942b8
commit 0e10847cba
10 changed files with 86 additions and 19 deletions

View File

@@ -4,6 +4,8 @@ import {
PlatformCapabilities,
} from "../PlatformService";
import { logger } from "../../utils/logger";
import { QueryExecResult } from "@/interfaces/database";
import databaseService from "../database";
/**
* Platform service implementation for web browser platform.
@@ -359,4 +361,18 @@ export class WebPlatformService implements PlatformService {
async writeAndShareFile(_fileName: string, _content: string): Promise<void> {
throw new Error("File system access not available in web platform");
}
/**
* @see PlatformService.dbQuery
*/
dbQuery(sql: string, params?: unknown[]): Promise<QueryExecResult> {
return databaseService.query(sql, params).then((result) => result[0]);
}
/**
* @see PlatformService.dbExec
*/
dbExec(sql: string, params?: unknown[]): Promise<{ changes: number; lastId?: number }> {
return databaseService.run(sql, params);
}
}