Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions servers/javascript/.env.encrypted
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_ENCRYPTED_DBS=true
5 changes: 5 additions & 0 deletions servers/javascript/src/tdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ export class TDKImpl implements tdk.TDK, AsyncDisposable {
}
this.#logger.info `Reset: Creating database ${name} with ${collections?.length ?? 0} collection(s)`;
const db = await cbl.Database.open({name: name, version: 1, collections: colls});
if (import.meta.env.VITE_ENCRYPTED_DBS === 'true') {
this.#logger.info `- VITE_ENCRYPTED_DBS set, adding encryption to ${name}`;
await db.changeEncryptionKey("password");
}

this.#databases.set(name, db);
return db;
}
Expand Down
11 changes: 11 additions & 0 deletions servers/javascript/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
interface ViteTypeOptions {
strictImportMetaEnv: unknown
}

interface ImportMetaEnv {
readonly VITE_ENCRYPTED_DBS?: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
2 changes: 1 addition & 1 deletion tests/dev_e2e/test_query_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ async def test_query_inner_join(self, cblpytest: CBLPyTest):
ON airports.icao = routes.destinationairport
WHERE airports.country = "United States"
AND routes.stops = 0
ORDER BY routes.destinationairport
ORDER BY routes.sourceairport
"""

await self._test_join(cblpytest, query)
Expand Down
Loading