File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ interface DBEnv {
1010 COUCHDB_SERVER_PROTOCOL : string ; // Protocol of CouchDB server (http or https)
1111 COUCHDB_USERNAME ?: string ;
1212 COUCHDB_PASSWORD ?: string ;
13+ LOCAL_STORAGE_PREFIX : string ; // Prefix for IndexedDB storage names
1314}
1415
1516export const ENV : DBEnv = {
1617 COUCHDB_SERVER_PROTOCOL : 'NOT_SET' ,
1718 COUCHDB_SERVER_URL : 'NOT_SET' ,
19+ LOCAL_STORAGE_PREFIX : '' ,
1820} ;
1921
2022// Configuration type for data layer initialization
@@ -44,6 +46,9 @@ export async function initializeDataLayer(config: DataLayerConfig): Promise<Data
4446 logger . warn ( 'Data layer already initialized. Returning existing instance.' ) ;
4547 return dataLayerInstance ;
4648 }
49+ if ( config . options . localStoragePrefix ) {
50+ ENV . LOCAL_STORAGE_PREFIX = config . options . localStoragePrefix ;
51+ }
4752
4853 if ( config . type === 'couch' ) {
4954 if ( ! config . options . COUCHDB_SERVER_URL || ! config . options . COUCHDB_SERVER_PROTOCOL ) {
Original file line number Diff line number Diff line change @@ -5,13 +5,18 @@ import * as fs from 'fs';
55import * as path from 'path' ;
66import * as os from 'os' ;
77import { logger } from './tuiLogger' ;
8+ import { ENV } from '@db/factory' ;
89
910/**
1011 * Get the application data directory for the current platform
1112 * Uses ~/.tuilder as requested by user for simplicity
1213 */
1314export function getAppDataDirectory ( ) : string {
14- return path . join ( os . homedir ( ) , '.tuilder' ) ;
15+ if ( ENV . LOCAL_STORAGE_PREFIX ) {
16+ return path . join ( os . homedir ( ) , `.tuilder` , ENV . LOCAL_STORAGE_PREFIX ) ;
17+ } else {
18+ return path . join ( os . homedir ( ) , '.tuilder' ) ;
19+ }
1520}
1621
1722/**
You can’t perform that action at this time.
0 commit comments