- Notifications
You must be signed in to change notification settings - Fork0
Node.js Client for Postgres v14
NotificationsYou must be signed in to change notification settings
mpolinowski/postgres-node
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
docker run -d --rm \ --name postgres \ -e POSTGRES_PASSWORD=secretpassword \ -p 5432:5432 \ postgres:14
Connect to the Postgres CLI:
dockerexec -ti -u postgres postgres psqlpsql (14.0 (Debian 14.0-1.pgdg110+1))Type"help"for help.postgres=#
CREATEDATABASEbooks;
Switch to using the new books table instead of the default postgres:
\connect books;You are now connected to database"books"as user"postgres".
CREATETABLEthe_expanse ( book_idINTEGERPRIMARY KEY GENERATED ALWAYSAS IDENTITY, titleVARCHAR (25 ) UNIQUENOT NULL, isbnVARCHAR (25 ) UNIQUENOT NULL, yearINT, pagesINT, created_onTIMESTAMPNOT NULL);
INSERT INTO the_expanse (title, isbn, year, pages, created_on)VALUES ('Leviathan Wakes','978-0-316-12908-4',2011,592, NOW()- interval'1256 days'), ('Calibans War','978-1-841-49990-1',2012,595, NOW()- interval'993 days'), ('Abaddons Gate','978-0-316-12907-7',2013,539, NOW()- interval'765 days'), ('Cibola Burn','978-0-316-21762-0',2014,583, NOW()- interval'543 days'), ('Nemesis Games','978-0-316-21758-3',2015,544, NOW()- interval'267 days'), ('Babylons Ashes','978-0-316-33474-7',2016,608, NOW()- interval'189 days'), ('Persepolis Rising','978-0-316-33283-5',2017,560, NOW()- interval'122 days'), ('Tiamats Wrath','978-0-316-33286-6',2019,544, NOW()- interval'98 days'), ('Leviathan Falls','978-0-356-51039-2',2021,528, NOW()- interval'21 days');
npm install node server_express.jsrunning on http://localhost:8888
About
Node.js Client for Postgres v14
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published