https://github.com/its-alex/hasura-playground
https://github.com/its-alex/hasura-playground
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/its-alex/hasura-playground
- Owner: Its-Alex
- License: mit
- Created: 2024-04-12T22:50:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-19T07:40:32.000Z (about 2 years ago)
- Last Synced: 2025-10-30T17:48:20.769Z (8 months ago)
- Language: Shell
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hasura playground
This repository is a playground for local [hasura](https://hasura.io/) instance.
## Requirements
- [`mise`](https://mise.jdx.dev/)
- [`docker`](https://www.docker.com/)
Execute these commands to install dependencies:
```sh
$ mise install
$ pip install -U pgcli
```
## Getting started
First you must launch hasura and setup it. A script done this automatically:
```sh
$ ./scripts/up.sh
[+] Running 3/3
✔ Container hasura-playground-data-connector-agent-1 Healthy 0.0s
✔ Container hasura-playground-postgres-1 Running 0.0s
✔ Container hasura-playground-graphql-engine-1 Running 0.0s
Waiting for graphql-engine:8080 . up!
Everything is up
INFO hasura cli is up to date version=2.38.1
INFO Metadata applied
```
You can then go to `http://localhost:8080` to access hasura dashboard.
By default some fixtures are automatically imported, you can see them in
[`./fixtures/index.sql`](./fixtures/index.sql).
## Reset hasura and database
You can reset hasura and postgres to default state by using
[`reset-local-database.sh`](./scripts/reset-local-database.sh):
```sh
$ ./scripts/reset-local-database.sh
NOTICE: drop cascades to 4 other objects
DETAIL: drop cascades to table users
drop cascades to table tags
drop cascades to table users_tags
drop cascades to table events
INFO Seeds planted
INFO migrations applied
INFO migrations applied
```
Hasura and database will be reset with default fixtures.
## Enter postgres database
A script is available to automatically connect to postgres shell using
[pgcli](https://www.pgcli.com/):
```sh
$ ./scripts/enter-postgres.sh
Server: PostgreSQL 15.6
Version: 4.0.1
Home: http://pgcli.com
hasura@127:hasura>
```
You can now execute any SQL commands.
## Down
You can cleanup project by using [`down.sh`](./scripts/down.sh):
```sh
$ ./scripts/down.sh
```
## License
[MIT](/LICENSE)