graphql-engine/cli
Aravind c258fa75cb
cli: add --goto flag in hasura migrate apply (close #2689) (#3715)
* cli: add --goto <version> flag to migrate command

* cli: fix error encoutered in goto, when on version -1

* do down migrations one step down

* reorganize code

* in case of up "gotos" make sure that all previous migration in migration chain are applied

* modify readUp and readDown functions to account for --goto use case

* refactor to clean up and adopt a better implementation addressing the comments

* remove empty error handling step

* return ErrNoChange when no migrations were applied

* respect m.stop() can panic so place conditional cases after that and add a couple other small fixes

* fix bug caused by early checking of versions

* fix to add migration_mode and nil version check

* add some more examples for migrate apply command

Co-authored-by: Aravind Shankar <face11301@gmail.com>
Co-authored-by: Shahidh K Muhammed <muhammedshahid.k@gmail.com>
2020-02-03 12:33:32 +05:30
..
assets fix various version-related issues with cli (close #3706) (#3709) 2020-01-16 09:23:18 +05:30
build [cli] add docs and build tools (#3) 2018-06-28 11:10:18 +05:30
cmd/hasura fix typos is multiple files (#728) 2018-10-15 12:29:51 +05:30
commands cli: add --goto flag in hasura migrate apply (close #2689) (#3715) 2020-02-03 12:33:32 +05:30
migrate cli: add --goto flag in hasura migrate apply (close #2689) (#3715) 2020-02-03 12:33:32 +05:30
telemetry cli: add directory name as an argument to init cmd (#3590) 2019-12-25 14:01:29 +05:30
update cli: fix version constraint for update check (close #3719) (#3730) 2020-01-30 14:41:03 +05:30
util fix various version-related issues with cli (close #3706) (#3709) 2020-01-16 09:23:18 +05:30
version fix various version-related issues with cli (close #3706) (#3709) 2020-01-16 09:23:18 +05:30
.gitignore [cli] commit realize, update docs 2018-06-28 11:35:34 +05:30
.realize.yaml cli: update go-binddata, fix realize (close #3588) (#3687) 2020-01-13 15:24:41 +05:30
cli_test.go rename access-key to admin-secret (close #1347) (#1540) 2019-02-14 15:07:47 +05:30
cli.go fix various version-related issues with cli (close #3706) (#3709) 2020-01-16 09:23:18 +05:30
CONTRIBUTING.md cli(build): migrate to go modules (close #3476) (#3493) 2019-12-12 11:07:26 +05:30
directory.go rename access-key to admin-secret (close #1347) (#1540) 2019-02-14 15:07:47 +05:30
get.sh cli(installer): add -f flag to curl (fix #1871) (#3477) 2019-12-12 11:00:19 +05:30
global_config.go rename access-key to admin-secret (close #1347) (#1540) 2019-02-14 15:07:47 +05:30
go.mod cli: use json logs on non-terminal envs (close #2770) (#3528) 2019-12-25 20:14:02 +05:30
go.sum export metadata without nulls, empty arrays & default values (#3393) 2019-12-14 00:47:38 -06:00
Makefile cli: update go-binddata, fix realize (close #3588) (#3687) 2020-01-13 15:24:41 +05:30
README.md rename access-key to admin-secret (close #1347) (#1540) 2019-02-14 15:07:47 +05:30

Hasura GraphQL Engine CLI

GoDoc

Installation

Download GraphQL Engine CLI bundled with Hasura CLI

  • Linux/macOS
curl -L https://cli.hasura.io/install.sh | bash

Download using go get

go get github.com/hasura/graphql-engine/cli/cmd/hasura

Build from source

git clone https://github.com/hasura/graphql-engine
cd graphql-engine/cli
make deps
make build
# binaries will be in _output directory

Usage

hasura init --directory <my-project> --endpoint <graphql-endpoint> --admin-secret <admin-secret>
cd <my-project>
hasura console

Contributing

Checkout the contributing guide.