Skip to content

Instantly share code, notes, and snippets.

@pebblexe
Last active February 8, 2017 20:00
Show Gist options
  • Save pebblexe/a6306442885c96d7b4e85eebbe15bad3 to your computer and use it in GitHub Desktop.
Save pebblexe/a6306442885c96d7b4e85eebbe15bad3 to your computer and use it in GitHub Desktop.
var knex = require('knex')(require('./knexfile'));
var d = new Date();
var n = d.toISOString();
var insert1 = {"To": "+13",
"From": "+18",
"Text": "Test 1"};
console.log("insert1",insert1);
knex.insert(insert1).into("texts").then(function (id) {
console.log(id);
})
.finally(function() {
console.log("killing the connection");
knex.destroy();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment