{"id":13942708,"url":"https://github.com/pthom/northwind_psql","last_synced_at":"2025-11-24T21:30:16.647Z","repository":{"id":30259980,"uuid":"33811356","full_name":"pthom/northwind_psql","owner":"pthom","description":"Northwind sample database for postgres","archived":false,"fork":false,"pushed_at":"2024-08-31T08:38:22.000Z","size":527,"stargazers_count":813,"open_issues_count":2,"forks_count":916,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-02-15T20:47:58.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pthom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2015-04-12T09:46:52.000Z","updated_at":"2025-02-13T18:01:10.000Z","dependencies_parsed_at":"2024-11-07T16:37:09.237Z","dependency_job_id":"1db6d4a8-d1c8-4d90-89a1-15b644183802","html_url":"https://github.com/pthom/northwind_psql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthom%2Fnorthwind_psql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthom%2Fnorthwind_psql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthom%2Fnorthwind_psql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthom%2Fnorthwind_psql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pthom","download_url":"https://codeload.github.com/pthom/northwind_psql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239634977,"owners_count":19672186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-08T02:01:59.864Z","updated_at":"2025-11-24T21:30:16.537Z","avatar_url":"https://github.com/pthom.png","language":null,"funding_links":[],"categories":["Others","Reference Materials"],"sub_categories":["Sample Schemas"],"readme":"# Northwind database for Postgres\n\nA simple sql script that will populate a database with the famous northwind example, adapted for postgres.\n\n\u003cimg src=ER.png /\u003e\n\n## Getting started:\n\n### Manually\n\nUse the provided sql file `nortwhind.sql` in order to populate your database.\n\n### With Docker and docker compose\n\n#### Pre-requirement: install docker and docker-compose\n\n https://www.docker.com/get-started\n\n https://docs.docker.com/compose/install/\n\n\n#### 1. Run docker-compose\n\n````bash\n\u003e docker-compose up\n...\n... Lots of messages...\n...\nCreating network \"northwind_psql_db\" with driver \"bridge\"\nCreating volume \"northwind_psql_db\" with default driver\nCreating volume \"northwind_psql_pgadmin\" with default driver\nCreating pgadmin ... done\nCreating db      ... done\n````\n\n#### 2. Run psql client:\n\n##### Method 1: Via the docker-compose container\n\nOpen another terminal window, and type:\n\n````bash\n\u003e docker-compose exec db psql -U postgres -d northwind\n\npsql (13.2 (Debian 13.2-1.pgdg100+1))\nType \"help\" for help.\n\nnorthwind=# select * from us_states;\n state_id |      state_name      | state_abbr | state_region\n----------+----------------------+------------+--------------\n        1 | Alabama              | AL         | south\n        2 | Alaska               | AK         | north\n        ...\n````\n\nAlternatively, you can launch bash, then psql:\n````bash\ndocker-compose exec db /bin/bash\n\n# You are now inside the \"db\" docker container\npsql -U postgres northwind\n````\n\n##### Method 2: Direct access via the port 55432\n\nThe \"db\" docker exposes postgres on the port 55432. If you have psql on your path, you may connect to it via:\n\n````bash\n# Run this directly from your computer (this will connect to the docker db)\npsql -U postgres northwind -p 55432\n````\n\n#### 3. Connect PgAdmin\n\nAccess to PgAdmin at the url: http://localhost:5050\n\nAdd a new server in PgAdmin:\n- General Tab:\n  - Name = db\n- Connection Tab:\n  - Host name: db\n  - Username: postgres\n  - Password: postgres\n\nThen, select database \"northwind\".\n\n#### 4. Stop docker-compose\n\nStop the server that was launched by `docker compose up` via `Ctrl-C`, then remove the containers via:\n\n```bash\ndocker-compose down\n```\n\n#### 5. Files \u0026 persistence\n\nYour modifications to the postgres database(s)will be persisted in the `postgresql_data` docker volume, and can be retrieved once you restart `docker compose up`. \n\nIf you need to delete the database data, run `docker-compose down -v` (the database will then be repopulated from scratch when running `docker-compose up`).\n\nIf you need to upload any files into your db container, just copy and paste them to the `files` local folder. They will be available at the `/files` path inside the db container.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthom%2Fnorthwind_psql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpthom%2Fnorthwind_psql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthom%2Fnorthwind_psql/lists"}