Skip to content

Commit

Permalink
Wrap await in an async function for easy copy paste
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmunda committed Apr 7, 2020
1 parent 1571482 commit 8275fea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ import { TinyPg } from 'tinypg'
// Options default to PG environment variables
const db = new TinyPg()

const result = await db.query(`SELECT 'Hello, World'`)
async function main() {
const result = await db.query(`SELECT 'Hello, World'`)

console.log(result)
console.log(result)
}

main()
// Prints:
// { row_count: 1,
// rows: [ { '?column?': 'Hello, World' } ],
Expand Down

0 comments on commit 8275fea

Please sign in to comment.