@libsql/client
Advanced tools
+13
-6
@@ -53,4 +53,11 @@ "use strict"; | ||
| } | ||
| // note: we must always prepend file scheme in order for SQLite3 to recognize :memory: connection query parameters | ||
| const path = `${config.scheme}:${config.path}`; | ||
| let isInMemory = (0, config_1.isInMemoryConfig)(config); | ||
| if (isInMemory && config.syncUrl) { | ||
| throw new api_1.LibsqlError(`Embedded replica must use file for local db but URI with in-memory mode were provided instead: ${config.path}`, "URL_INVALID"); | ||
| } | ||
| let path = config.path; | ||
| if (isInMemory) { | ||
| // note: we should prepend file scheme in order for SQLite3 to recognize :memory: connection query parameters | ||
| path = `${config.scheme}:${config.path}`; | ||
| } | ||
| const options = { | ||
@@ -85,6 +92,6 @@ authToken: config.authToken, | ||
| let stmt; | ||
| if (typeof stmtOrSql === 'string') { | ||
| if (typeof stmtOrSql === "string") { | ||
| stmt = { | ||
| sql: stmtOrSql, | ||
| args: args || [] | ||
| args: args || [], | ||
| }; | ||
@@ -170,6 +177,6 @@ } | ||
| let stmt; | ||
| if (typeof stmtOrSql === 'string') { | ||
| if (typeof stmtOrSql === "string") { | ||
| stmt = { | ||
| sql: stmtOrSql, | ||
| args: args || [] | ||
| args: args || [], | ||
| }; | ||
@@ -176,0 +183,0 @@ } |
+14
-7
| import Database from "libsql"; | ||
| import { Buffer } from "node:buffer"; | ||
| import { LibsqlError } from "@libsql/core/api"; | ||
| import { expandConfig } from "@libsql/core/config"; | ||
| import { expandConfig, isInMemoryConfig } from "@libsql/core/config"; | ||
| import { supportedUrlLink, transactionModeToBegin, ResultSetImpl, } from "@libsql/core/util"; | ||
@@ -32,4 +32,11 @@ export * from "@libsql/core/api"; | ||
| } | ||
| // note: we must always prepend file scheme in order for SQLite3 to recognize :memory: connection query parameters | ||
| const path = `${config.scheme}:${config.path}`; | ||
| let isInMemory = isInMemoryConfig(config); | ||
| if (isInMemory && config.syncUrl) { | ||
| throw new LibsqlError(`Embedded replica must use file for local db but URI with in-memory mode were provided instead: ${config.path}`, "URL_INVALID"); | ||
| } | ||
| let path = config.path; | ||
| if (isInMemory) { | ||
| // note: we should prepend file scheme in order for SQLite3 to recognize :memory: connection query parameters | ||
| path = `${config.scheme}:${config.path}`; | ||
| } | ||
| const options = { | ||
@@ -63,6 +70,6 @@ authToken: config.authToken, | ||
| let stmt; | ||
| if (typeof stmtOrSql === 'string') { | ||
| if (typeof stmtOrSql === "string") { | ||
| stmt = { | ||
| sql: stmtOrSql, | ||
| args: args || [] | ||
| args: args || [], | ||
| }; | ||
@@ -147,6 +154,6 @@ } | ||
| let stmt; | ||
| if (typeof stmtOrSql === 'string') { | ||
| if (typeof stmtOrSql === "string") { | ||
| stmt = { | ||
| sql: stmtOrSql, | ||
| args: args || [] | ||
| args: args || [], | ||
| }; | ||
@@ -153,0 +160,0 @@ } |
+2
-2
| { | ||
| "name": "@libsql/client", | ||
| "version": "0.8.0", | ||
| "version": "0.8.1", | ||
| "keywords": [ | ||
@@ -105,3 +105,3 @@ "libsql", | ||
| "dependencies": { | ||
| "@libsql/core": "^0.8.0", | ||
| "@libsql/core": "^0.8.1", | ||
| "@libsql/hrana-client": "^0.6.2", | ||
@@ -108,0 +108,0 @@ "js-base64": "^3.7.5", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
117957
0.56%2820
0.5%Updated