Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libsql

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libsql - npm Package Compare versions

Comparing version 0.3.13 to 0.3.14

36

index.js

@@ -124,14 +124,28 @@ "use strict";

return (...bindParameters) => {
// TODO: Use libsql transaction API.
this.exec("BEGIN");
try {
const result = fn(...bindParameters);
this.exec("COMMIT");
return result;
} catch (err) {
this.exec("ROLLBACK");
throw err;
}
const db = this;
const wrapTxn = (mode) => {
return (...bindParameters) => {
db.exec("BEGIN " + mode);
try {
const result = fn(...bindParameters);
db.exec("COMMIT");
return result;
} catch (err) {
db.exec("ROLLBACK");
throw err;
}
};
};
const properties = {
default: { value: wrapTxn("") },
deferred: { value: wrapTxn("DEFERRED") },
immediate: { value: wrapTxn("IMMEDIATE") },
exclusive: { value: wrapTxn("EXCLUSIVE") },
database: { value: this, enumerable: true },
};
Object.defineProperties(properties.default.value, properties);
Object.defineProperties(properties.deferred.value, properties);
Object.defineProperties(properties.immediate.value, properties);
Object.defineProperties(properties.exclusive.value, properties);
return properties.default.value;
}

@@ -138,0 +152,0 @@

{
"name": "libsql",
"version": "0.3.13",
"version": "0.3.14",
"description": "A better-sqlite3 compatible API for libSQL that supports Bun, Deno, and Node",

@@ -73,10 +73,10 @@ "os": [

"optionalDependencies": {
"@libsql/darwin-arm64": "0.3.13",
"@libsql/darwin-x64": "0.3.13",
"@libsql/linux-arm64-gnu": "0.3.13",
"@libsql/linux-arm64-musl": "0.3.13",
"@libsql/linux-x64-gnu": "0.3.13",
"@libsql/linux-x64-musl": "0.3.13",
"@libsql/win32-x64-msvc": "0.3.13"
"@libsql/darwin-arm64": "0.3.14",
"@libsql/darwin-x64": "0.3.14",
"@libsql/linux-arm64-gnu": "0.3.14",
"@libsql/linux-arm64-musl": "0.3.14",
"@libsql/linux-x64-gnu": "0.3.14",
"@libsql/linux-x64-musl": "0.3.14",
"@libsql/win32-x64-msvc": "0.3.14"
}
}

@@ -127,14 +127,28 @@ "use strict";

return async (...bindParameters) => {
// TODO: Use libsql transaction API.
await this.exec("BEGIN");
try {
const result = fn(...bindParameters);
await this.exec("COMMIT");
return result;
} catch (err) {
await this.exec("ROLLBACK");
throw err;
}
const db = this;
const wrapTxn = (mode) => {
return async (...bindParameters) => {
await db.exec("BEGIN " + mode);
try {
const result = fn(...bindParameters);
await db.exec("COMMIT");
return result;
} catch (err) {
await db.exec("ROLLBACK");
throw err;
}
};
};
const properties = {
default: { value: wrapTxn("") },
deferred: { value: wrapTxn("DEFERRED") },
immediate: { value: wrapTxn("IMMEDIATE") },
exclusive: { value: wrapTxn("EXCLUSIVE") },
database: { value: this, enumerable: true },
};
Object.defineProperties(properties.default.value, properties);
Object.defineProperties(properties.deferred.value, properties);
Object.defineProperties(properties.immediate.value, properties);
Object.defineProperties(properties.exclusive.value, properties);
return properties.default.value;
}

@@ -141,0 +155,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc