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 knex = Knex({ client: 'sqlite', connection: ':memory:' }); await knex.schema.createTable('test', t => { t.increments('id').primary(); t.string('data'); }); await knex('test').insert([{ data: 'foo' }, { data: 'bar' }]); console.dir( await knex('test').select('*', knex.raw('? as ??', ['Patrol', '$type'])) );
Created from: https://npm.runkit.com/knex
Loading…
Clone and edit this document