$ dgraph-admin help
Usage: dgraph-admin [--url <url>] [--auth <auth>] <command> [<args>]
dgraph-admin is a simple tool for managing dgraph.
Options:
--url dgraph url
--auth auth header to include with the request
Commands:
update-schema add or modify schema
get-schema get the current schema
drop-all drop all data and schema
drop-data drop all data only (keep schema)
get-health get status of nodes
dgraph-admin can be used to manage dgraph that is running locally as well as in dgraph cloud
if dgraph is available on default url (localhost:8080) and token is not set:
$ dgraph-admin get-health
if token was provided in dgraph's --security flag (see dgraph cli ref):
$ dgraph-admin --auth X-Dgraph-AuthToken:token get-health
to be able to use it with dgraph cloud you will need to create an admin api key (see authentication)
$ dgraph-admin --url https://something.cloud.dgraph.io --auth Dg-Auth:key get-health
you will need rust and cargo
$ git clone https://github.com/blukai/dgraph-admin.git
$ cd dgraph-admin
$ cargo install --path .
during development (other project) i found an often need to modify schema or drop all data. while it is possible without this tool, it is not as convenient, easy and fast.
also i wanted to write something useful in rust xd.