Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: knex
node v8.17.0
endpoint
share
tweet
require('sqlite3'); const Knex = require('knex'); const knexSqlite = Knex({ client: 'sqlite', connection: ':memory:' }); await knexSqlite.schema.createTable('test', t => { t.increments('id').primary(); t.string('data'); }); knexSqlite.on('start', (builder) => { // calling to string for logging purposes only console.log('SQL', builder.toString()); }); await knexSqlite('test').insert([{ data: 'foo' }, { data: 'bar' }]); console.log('test table data:', await knexSqlite('test'));
Created from: https://npm.runkit.com/knex
Loading…
Clone and edit this document