@libsql/client
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -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 @@ } |
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 @@ } |
{ | ||
"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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117957
2820
Updated@libsql/core@^0.8.1