Created
April 14, 2018 20:09
-
-
Save plentylife/205214044fc38758c5d4a2bd99e6e72e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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