forked from akai/readest
feat(database): add database service abstraction with libsql/turso backend (#3472)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { FileSystem, BaseDir, AppPlatform, ResolvedPath, FileItem } from '@/types/system';
|
||||
import { DatabaseService } from '@/types/database';
|
||||
import { getOSPlatform, isValidURL } from '@/utils/misc';
|
||||
import { RemoteFile } from '@/utils/file';
|
||||
import { isPWA } from './environment';
|
||||
@@ -347,4 +348,10 @@ export class WebAppService extends BaseAppService {
|
||||
async ask(message: string): Promise<boolean> {
|
||||
return window.confirm(message);
|
||||
}
|
||||
|
||||
async openDatabase(path: string, base: BaseDir): Promise<DatabaseService> {
|
||||
const fullPath = await this.resolveFilePath(path, base);
|
||||
const { WebDatabaseService } = await import('./database/webDatabaseService');
|
||||
return WebDatabaseService.open(fullPath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user