Wrapper functions that perform read operations to database asynchronously

interface Person {
name: string;
age: number;
birthday: string;
}
let allRows = await asyncDatabaseRead<Array<Person>>(db, "SELECT * FROM people;", (rows) => { return rows; });
  • Type Parameters

    • Type

    Parameters

    • database: Database

      sqlite3 database object

    • sqlQuery: string

      SQL query to execute

    • callback: asyncDatabaseRowsCallbackFunction

      callback to perform further operations on each row

    Returns Promise<Type>

    Promise for database operation