{"id":22039456,"url":"https://github.com/mpolinowski/postgres-node","last_synced_at":"2026-04-14T10:32:34.496Z","repository":{"id":111484093,"uuid":"415553110","full_name":"mpolinowski/postgres-node","owner":"mpolinowski","description":"Node.js Client for Postgres v14","archived":false,"fork":false,"pushed_at":"2021-10-10T15:54:28.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T23:03:24.368Z","etag":null,"topics":["nodejs","postgres-client","postgresql"],"latest_commit_sha":null,"homepage":"https://mpolinowski.github.io/devnotes/2021-09-14--postgres-refresher-node-json","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolinowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-10T10:29:14.000Z","updated_at":"2021-10-10T15:54:30.000Z","dependencies_parsed_at":"2023-05-09T17:16:44.755Z","dependency_job_id":null,"html_url":"https://github.com/mpolinowski/postgres-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpolinowski/postgres-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fpostgres-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fpostgres-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fpostgres-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fpostgres-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/postgres-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fpostgres-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31793212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","postgres-client","postgresql"],"created_at":"2024-11-30T11:10:52.219Z","updated_at":"2026-04-14T10:32:34.479Z","avatar_url":"https://github.com/mpolinowski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- TOC --\u003e\n\n- [Docker](#docker)\n    - [Run the Postgres Container](#run-the-postgres-container)\n- [Setting up the Database](#setting-up-the-database)\n    - [Create a Database](#create-a-database)\n    - [Add a Table](#add-a-table)\n    - [Add Data](#add-data)\n- [Node.js Client](#nodejs-client)\n    - [Start the Client](#start-the-client)\n\n\u003c!-- /TOC --\u003e\n\n\n## Docker\n\n### Run the Postgres Container\n\n```bash\ndocker run -d --rm \\\n    --name postgres \\\n    -e POSTGRES_PASSWORD=secretpassword \\\n    -p 5432:5432 \\\n    postgres:14\n```\n\nConnect to the Postgres CLI:\n\n\n```bash\ndocker exec -ti -u postgres postgres psql\n\npsql (14.0 (Debian 14.0-1.pgdg110+1))\nType \"help\" for help.\n\npostgres=#\n```\n\n## Setting up the Database\n\n### Create a Database\n\n```sql\nCREATE DATABASE books;\n```\n\nSwitch to using the new books table instead of the default postgres:\n\n\n```sql\n\\connect books;\nYou are now connected to database \"books\" as user \"postgres\".\n```\n\n\n### Add a Table\n\n```sql\nCREATE TABLE the_expanse (\n  book_id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,\n  title VARCHAR ( 25 ) UNIQUE NOT NULL,\n  isbn VARCHAR ( 25 ) UNIQUE NOT NULL,\n  year INT,\n  pages INT,\n  created_on TIMESTAMP NOT NULL\n);\n```\n\n### Add Data\n\n```sql\nINSERT INTO the_expanse \n  (title, isbn, year, pages, created_on)\nVALUES \n  ('Leviathan Wakes', '978-0-316-12908-4', 2011, 592, NOW() - interval '1256 days'),\n  ('Calibans War', '978-1-841-49990-1', 2012, 595, NOW() - interval '993 days'),\n  ('Abaddons Gate', '978-0-316-12907-7', 2013, 539, NOW() - interval '765 days'),\n  ('Cibola Burn', '978-0-316-21762-0', 2014, 583, NOW() - interval '543 days'),\n  ('Nemesis Games', '978-0-316-21758-3', 2015, 544, NOW() - interval '267 days'),\n  ('Babylons Ashes', '978-0-316-33474-7', 2016, 608, NOW() - interval '189 days'),\n  ('Persepolis Rising', '978-0-316-33283-5', 2017, 560, NOW() - interval '122 days'),\n  ('Tiamats Wrath', '978-0-316-33286-6', 2019, 544, NOW() - interval '98 days'),\n  ('Leviathan Falls', '978-0-356-51039-2', 2021, 528, NOW() - interval '21 days');\n```\n \n \n## Node.js Client\n \n### Start the Client\n \n```bash\n npm install\n node server_express.js\nrunning on http://localhost:8888\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fpostgres-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Fpostgres-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fpostgres-node/lists"}