Tuesday 30 May 2017

Knex Queries Not Running

I am trying to get a basic query in knex working but it's not executing the select or returning an error.

const knexfile = require('./knexfile.js');
knex = require('knex')(knexfile.development);

knex('views').select()
.then((data) => {
    console.log('test);
    console.log(data);
})
.catch((err) => {
    console.log(err);
});

When I run it, I don't see any output. I have migrations setup and those are working fine so the config file is good. The table also has data in it.

Why am I not getting any data back from my query?



via jesswonky

No comments:

Post a Comment