Package Exports
- @open-fidias/marv-better-sqlite3-driver
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@open-fidias/marv-better-sqlite3-driver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
marv-better-sqlite3-driver
A sqlite driver for marv using better-sqlite3.
Install
npm install --save marv @open-fidias/marv-better-sqlite3-driverUsage
migrations/
|- 001.create-table.sql
|- 002.create-another-table.sqlconst marv = require('marv')
const sqliteDriver = require('@open-fidias/marv-better-sqlite3-driver')
const directory = path.join(process.cwd(), 'migrations' )
const driver = sqliteDriver({
table: 'db_migrations', // defaults to 'migrations'
connection: {
path: 'app.sqlite',
options: {
memory: false,
fileMustExist: false,
timeout: 5000,
verbose: null // function or null
} // See https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/api.md#new-databasepath-options
}
})
marv.scan(directory, (err, migrations) => {
if (err) throw err
marv.migrate(migrations, driver, (err) => {
if (err) throw err
})
})Attach Databases
const driver = sqliteDriver({
connection: {
path: 'app.sqlite',
databases: [
{
path: 'aux.sqlite',
as: 'aux'
}
]
}
})Testing
npm install # or yarn
npm test