feat(database): add database service abstraction with libsql/turso backend (#3472)
This commit is contained in:
@@ -42,6 +42,7 @@ import { copyURIToPath, getStorefrontRegionCode } from '@/utils/bridge';
|
||||
import { copyFiles } from '@/utils/files';
|
||||
|
||||
import { BaseAppService } from './appService';
|
||||
import { DatabaseService } from '@/types/database';
|
||||
import {
|
||||
DATA_SUBDIR,
|
||||
LOCAL_BOOKS_SUBDIR,
|
||||
@@ -564,6 +565,12 @@ export class NativeAppService extends BaseAppService {
|
||||
return await ask(message);
|
||||
}
|
||||
|
||||
async openDatabase(path: string, base: BaseDir): Promise<DatabaseService> {
|
||||
const fullPath = await this.resolveFilePath(path, base);
|
||||
const { NativeDatabaseService } = await import('./database/nativeDatabaseService');
|
||||
return NativeDatabaseService.open(`sqlite:${fullPath}`);
|
||||
}
|
||||
|
||||
async migrate20251029() {
|
||||
console.log('Running migration 20251029 to update paths in Images dir...');
|
||||
const rootPath = await this.resolveFilePath('..', 'Data');
|
||||
|
||||
Reference in New Issue
Block a user