How to use the sqlite.close function in sqlite

To help you get started, we’ve selected a few sqlite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antonycourtney / tad / test / reltabSqliteTests.js View on Github external
htest('sqlite test shutdown', t => {
    db.close()
      .then(() => {
        console.log('shut down sqlite')
        t.ok(true, 'finished db.close')
        t.end()
        // And exit on next tick:
        setImmediate(() => { process.exit(0) })
      })
  })
}
github antonycourtney / tad / test / runQuery.js View on Github external
let hrQueryStart = 0
    await db.open(':memory:')
    await csvimport.importSqlite(testPath, ',', {noHeaderRow: false})
    // await db.open('/Users/antony/data/testdb.sqlite')
    const [es, ens] = process.hrtime(hrProcStart)
    console.info('runQuery: import completed in %ds %dms', es, ens / 1e6)
    // console.log('table import complete: ', md.tableName)
    console.log('running query:\n', tq)
    hrQueryStart = process.hrtime()

    const rows = await db.all(tq)
    const [qes, qens] = process.hrtime(hrQueryStart)
    console.log('read rows from sqlite table.')
    console.table(rows)
    console.info('runQuery: evaluated query in %ds %dms', qes, qens / 1e6)
    await db.close()
  } catch (err) {
    console.error('caught exception running query: ', err, err.stack)
  }
}
github antonycourtney / tad / test / reltabTestUtils.js View on Github external
      .then(() => db.close())
      .catch(err => console.error('error in runSqlite promise chain: ', err, err.stack))

sqlite

SQLite client for Node.js applications with SQL-based migrations API written in Typescript

MIT
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis