Comparing version 0.3.5 to 0.3.6
{ | ||
"name": "libsql", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "A better-sqlite3 compatible API for libSQL that supports Bun, Deno, and Node", | ||
@@ -69,10 +69,10 @@ "os": [ | ||
"optionalDependencies": { | ||
"@libsql/darwin-arm64": "0.3.5", | ||
"@libsql/linux-arm64-gnu": "0.3.5", | ||
"@libsql/linux-arm64-musl": "0.3.5", | ||
"@libsql/darwin-x64": "0.3.5", | ||
"@libsql/win32-x64-msvc": "0.3.5", | ||
"@libsql/linux-x64-gnu": "0.3.5", | ||
"@libsql/linux-x64-musl": "0.3.5" | ||
"@libsql/darwin-arm64": "0.3.6", | ||
"@libsql/linux-arm64-gnu": "0.3.6", | ||
"@libsql/linux-arm64-musl": "0.3.6", | ||
"@libsql/darwin-x64": "0.3.6", | ||
"@libsql/win32-x64-msvc": "0.3.6", | ||
"@libsql/linux-x64-gnu": "0.3.6", | ||
"@libsql/linux-x64-musl": "0.3.6" | ||
} | ||
} |
@@ -42,2 +42,3 @@ "use strict"; | ||
constructor(path, opts) { | ||
const encryptionCipher = opts?.encryptionCipher ?? "sqlcipher"; | ||
if (opts && opts.syncUrl) { | ||
@@ -51,6 +52,9 @@ var authToken = ""; | ||
} | ||
this.db = databaseOpenWithRpcSync(path, opts.syncUrl, authToken); | ||
const encryptionKey = opts?.encryptionKey ?? ""; | ||
const syncPeriod = opts?.syncPeriod ?? 0.0; | ||
this.db = databaseOpenWithRpcSync(path, opts.syncUrl, authToken, encryptionCipher, encryptionKey, syncPeriod); | ||
} else { | ||
const authToken = opts?.authToken ?? ""; | ||
this.db = databaseOpen(path, authToken); | ||
const encryptionKey = opts?.encryptionKey ?? ""; | ||
this.db = databaseOpen(path, authToken, encryptionCipher, encryptionKey); | ||
} | ||
@@ -57,0 +61,0 @@ // TODO: Use a libSQL API for this? |
30369
745