@signalapp/better-sqlite3
Advanced tools
Comparing version 8.0.4 to 8.1.0
@@ -93,2 +93,4 @@ // Type definitions for better-sqlite3 7.6 | ||
SqliteError: typeof SqliteError; | ||
setLogHandler(fn: (code: number, value: string) => void): void; | ||
} | ||
@@ -95,0 +97,0 @@ } |
@@ -54,2 +54,3 @@ 'use strict'; | ||
addon.setErrorConstructor(SqliteError); | ||
addon.setLogHandler(logHandlerWrap); | ||
addon.isInitialized = true; | ||
@@ -69,2 +70,9 @@ } | ||
let logHandler; | ||
function logHandlerWrap(code, warning) { | ||
if (logHandler) { | ||
logHandler(code, warning); | ||
} | ||
} | ||
const wrappers = require('./methods/wrappers'); | ||
@@ -86,2 +94,7 @@ Database.prototype.prepare = wrappers.prepare; | ||
// Static | ||
Database.setLogHandler = function setLogHandler(fn) { | ||
logHandler = fn; | ||
} | ||
module.exports = Database; |
{ | ||
"name": "@signalapp/better-sqlite3", | ||
"version": "8.0.4", | ||
"version": "8.1.0", | ||
"description": "The fastest and simplest library for SQLite3 in Node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/WiseLibs/better-sqlite3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
229154
773