2022-11-30

Knex select always returns pending promise [duplicate]

I am writing a simple function to query my database with Knex in Node. Everything I've tried returns Promise { <pending> }

Function to query the DB:

const queryTable = async () => {
  const data = await knex
    .select("*")
    .from(TABLE_NAME)

  return data;
};

I've tried calling the function in it's own async/await wrapper, and I've tried the .then() callback after... No luck. Any leads appreciated!



No comments:

Post a Comment