Skip to content

Instantly share code, notes, and snippets.

@brianc
Created March 17, 2025 18:27
Show Gist options
  • Save brianc/b5e092325607bf6a010b9af9d8effcc6 to your computer and use it in GitHub Desktop.
Save brianc/b5e092325607bf6a010b9af9d8effcc6 to your computer and use it in GitHub Desktop.

Revisions

  1. brianc created this gist Mar 17, 2025.
    7 changes: 7 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import pg from "pg";

    const client = new pg.Client();
    await client.connect();
    const { rows } = await client.query("SELECT NOW()");
    console.log("rows:", rows);
    await client.end();
    10 changes: 10 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    {
    "name": "esmpgtest",
    "version": "1.0.0",
    "type": "module",
    "main": "index.js",
    "license": "MIT",
    "dependencies": {
    "pg": "^8.14.1"
    }
    }