Skip to content

Instantly share code, notes, and snippets.

@urcoilbisurco
Created May 14, 2020 08:39
Show Gist options
  • Save urcoilbisurco/f42fcfc9e9bd04317507c8bfb724e9c2 to your computer and use it in GitHub Desktop.
Save urcoilbisurco/f42fcfc9e9bd04317507c8bfb724e9c2 to your computer and use it in GitHub Desktop.
import { Client } from "https://deno.land/x/postgres/mod.ts";
async function main() {
const client = new Client({
user: "user",
database: "test",
host: "localhost",
port: "5432"
});
await client.connect();
const result = await client.query("SELECT * FROM people;");
console.log(result.rows);
await client.end();
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment