Skip to content

Commit

Permalink
Updated sqlite-async to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
GerbenAaltink committed Aug 30, 2024
1 parent 4adbf03 commit e9165f7
Show file tree
Hide file tree
Showing 3 changed files with 1,716 additions and 4,463 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const Database = require('sqlite-async')
const TableProxy = require('./proxy')

/**
Expand All @@ -22,9 +21,10 @@ const TableProxy = require('./proxy')
* @param {string} [name=":memory:"]
* @returns {Object} new Alopex instance.
*/
function connect(name) {
async function connect(name) {
const dbName = name || ':memory:'
return Database.open(dbName).then((db) => {
const sqlite3Async = await import('sqlite-async');
return sqlite3Async.Database.open(dbName).then((db) => {
db.dbName = dbName
return new Proxy(db, TableProxy)
})
Expand Down
Loading

0 comments on commit e9165f7

Please sign in to comment.