{"id":17722701,"url":"https://github.com/kamranahmedse/db-playground","last_synced_at":"2025-04-15T01:29:22.238Z","repository":{"id":65974666,"uuid":"600238443","full_name":"kamranahmedse/db-playground","owner":"kamranahmedse","description":"Easily create a sandbox environment for your database exploration.","archived":false,"fork":false,"pushed_at":"2024-07-16T17:06:47.000Z","size":350,"stargazers_count":43,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-16T21:02:02.122Z","etag":null,"topics":["databases","databases-lab-assignments","mongodb","mysql","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/kamranahmedse.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":"2023-02-10T22:35:33.000Z","updated_at":"2024-07-16T17:06:50.000Z","dependencies_parsed_at":"2024-10-25T19:58:52.048Z","dependency_job_id":"fb5eea67-e1af-4e1b-9635-4a97a5bb9069","html_url":"https://github.com/kamranahmedse/db-playground","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/kamranahmedse%2Fdb-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamranahmedse%2Fdb-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamranahmedse%2Fdb-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamranahmedse%2Fdb-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamranahmedse","download_url":"https://codeload.github.com/kamranahmedse/db-playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248988584,"owners_count":21194445,"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":["databases","databases-lab-assignments","mongodb","mysql","postgresql"],"created_at":"2024-10-25T15:39:14.981Z","updated_at":"2025-04-15T01:29:22.215Z","avatar_url":"https://github.com/kamranahmedse.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# db-playground\n\n\u003e Setup any database playground with sample data in seconds\n\nThe repository has a simple docker-compose file and a few scripts to set up any database playground with sample data in\nseconds. It is a great way to test your database queries and learn about the database.\n\nYou can run a single command to setup [Northwind](https://en.wikiversity.org/wiki/Database_Examples/Northwind) dataset in PostgreSQL, MySQL, PostgreSQL and some sample indexes (omdb and shakespeare) in Elasticsearch.\n\n## Usage\n\nMake sure you have [Docker](https://docs.docker.com/get-docker/) installed and running.\n\nAfter that, you can clone the repository and run any of the available services either using `Makefile` or `playground.sh` script.\n\n### Using Makefile\n\nTo spin up any of the services, run any of the below commands in a terminal\n\n```shell\n# run any of the below commands to start the relevant service\nmake postgres\nmake mysql\nmake mongo\nmake elasticsearch\nmake redis\n```\n\nOnce the service is up, you can run the below command in another terminal to connect to the service\n```shell\nmake postgres-cli\nmake mysql-cli\nmake mongo-cli\nmake elasticsearch-cli\nmake redis-cli\n```\n\n### Using playground.sh\n\n```shell\n# See what you can do with playground\n./playground.sh -h\n\n# run all the services using one of the following\n./playground.sh\n./playground.sh -s all\n\n# run a single service\n./playground.sh -s mongo\n./playground.sh -s mysql\n./playground.sh -s posgres\n./playground.sh -s elasticsearch\n./playground.sh -s redis\n\n# clean up the playground\n./playground.sh -c\n\n# clean up the playground and run the services\n./playground.sh -c -s all\n./playground.sh -c -s mongo\n./playground.sh -c -s postgres\n./playground.sh -c -s elasticsearch\n./playground.sh -c -s redis\n./playground.sh -c -s mysql\n```\n\nYou can also ue the `docker-compose` command directly to run the services.\n\n```shell\n# run all the services\ndocker-compose up -d\n\n# run a single service\ndocker-compose up -d mongo\n\n# clean up the playground\ndocker-compose down\n```\n\n## Database Credentials\n\nGiven below are the default configuration for the databases.\n\n### PostgreSQL\n\nFollowing are the details to connect to the database\n\n```text\nHost:     localhost\nPort:     6432\nUsername: admin\nPassword: admin\nDatabase: northwind\n```\nYou can use the following command to run commands on the database\n```bash\ndocker exec -it db_playground_postgres psql -U admin -d northwind\n```\n\n### MySQL\n\nFollowing are the details to connect to the database\n\n```text\nHost:     localhost\nPort:     4306\nUsername: admin\nPassword: admin\nDatabase: northwind\n```\nYou can use the following command to run commands on the database\n```bash\ndocker exec -it db_playground_mysql mysql -uadmin -padmin\n```\n\n## MongoDB\n\nFollowing are the details to connect to MongoDB\n\n```text\nHost:     localhost\nPort:     37017\nDatabase: northwind\n```\n\nYou can use the following command to run commands on the database\n\n```bash\ndocker exec -it db_playground_mongo mongosh\n```\n\n## Elasticsearch\n\nFollowing are the details to connect to Elasticsearch\n\n```text\nHost:     localhost\nPort:     9200\nIndexes:  omdb, shakespear\n```\n\nYou can use the following command to run commands on the container\n\n```bash\ndocker exec -it db_playground_elasticsearch sh\n```\n\n## Redis\n\nFollowing are the details to connect to Redis\n\n```text\nHost:     localhost\nPort:     6379\n```\n\nYou can use the following command to run commands on the container\n\n```bash\ndocker exec -it db_playground_redis redis-cli\n```\n\n## Contributing\n\n* Add support for more databases\n* Suggest features\n* Discuss ideas in issues\n* Spread the word\n\n## License\n\nMIT © [Kamran Ahmed](https://twitter.com/kamranahmedse)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamranahmedse%2Fdb-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamranahmedse%2Fdb-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamranahmedse%2Fdb-playground/lists"}