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 v6.17.1
endpoint
share
tweet
require('sqlite3-offline'); const Knex = require("knex"); const Dialect = require(`knex/lib/dialects/sqlite3/index.js`); Dialect.prototype._driver = () => require('sqlite3-offline'); const knex = Knex({ client: Dialect, connection: ':memory:' }); console.log( knex.select(knex.raw(1)).toSQL() ); await knex.schema.createTable('fooobar', (t) => { t.bigincrements('id'); t.string('data'); }); await knex('fooobar').insert({ data: 'nomnom' }); console.log("Gimme all the data:", await knex('fooobar'));
Created from: https://npm.runkit.com/knex
Loading…
Clone and edit this document