Skip to content

Commit 3909440

Browse files
committed
add db credentials as datalayer options
1 parent 9f6e691 commit 3909440

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/db/src/factory.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { DataLayerProvider } from './core/interfaces';
55
interface DBEnv {
66
COUCHDB_SERVER_URL: string; // URL of CouchDB server
77
COUCHDB_SERVER_PROTOCOL: string; // Protocol of CouchDB server (http or https)
8+
COUCHDB_USERNAME?: string;
9+
COUCHDB_PASSWORD?: string;
810
}
911

1012
export const ENV: DBEnv = {
@@ -20,6 +22,8 @@ export interface DataLayerConfig {
2022
localStoragePrefix?: string; // Prefix for IndexedDB storage names
2123
COUCHDB_SERVER_URL?: string;
2224
COUCHDB_SERVER_PROTOCOL?: string;
25+
COUCHDB_USERNAME?: string;
26+
COUCHDB_PASSWORD?: string;
2327
};
2428
}
2529

@@ -41,6 +45,8 @@ export async function initializeDataLayer(config: DataLayerConfig): Promise<Data
4145
}
4246
ENV.COUCHDB_SERVER_PROTOCOL = config.options.COUCHDB_SERVER_PROTOCOL;
4347
ENV.COUCHDB_SERVER_URL = config.options.COUCHDB_SERVER_URL;
48+
ENV.COUCHDB_USERNAME = config.options.COUCHDB_USERNAME;
49+
ENV.COUCHDB_PASSWORD = config.options.COUCHDB_PASSWORD;
4450

4551
// Dynamic import to avoid loading both implementations when only one is needed
4652
const { PouchDataLayerProvider } = await import('./impl/pouch/PouchDataLayerProvider');

0 commit comments

Comments
 (0)