Skip to content

Instantly share code, notes, and snippets.

@plentylife
Created April 14, 2018 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plentylife/205214044fc38758c5d4a2bd99e6e72e to your computer and use it in GitHub Desktop.
Save plentylife/205214044fc38758c5d4a2bd99e6e72e to your computer and use it in GitHub Desktop.
import test from 'ava'
import { nSQL } from "nano-sql";
import { nSQLiteAdapter, sqlite3 } from "nano-sqlite";
sqlite3.verbose()
test('nsql should work', async t => {
await nSQL("MY_TABLE")
.model([
{key: 'test', type: 'uuid', props: ['pk']}
])
.config({
mode: new nSQLiteAdapter("./foobar.sqlite3", sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, function (err) {
if (err) console.log('sql error', err.message);
})
}).connect()
.then(r => {
console.log('connected', r)
})
console.log('test end')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment