https://github.com/blukai/dgraph-admin
a simple tool for managing dgraph
https://github.com/blukai/dgraph-admin
dgraph dgraph-cli
Last synced: about 1 year ago
JSON representation
a simple tool for managing dgraph
- Host: GitHub
- URL: https://github.com/blukai/dgraph-admin
- Owner: blukai
- Created: 2021-05-23T13:03:14.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-23T15:11:19.000Z (almost 5 years ago)
- Last Synced: 2025-03-16T18:12:39.813Z (about 1 year ago)
- Topics: dgraph, dgraph-cli
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# dgraph-admin
```
$ dgraph-admin help
Usage: dgraph-admin [--url ] [--auth ] []
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
```
## usage
dgraph-admin can be used to manage dgraph that is running locally as well as in dgraph cloud
### locally
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](https://dgraph.io/docs/deploy/cli-command-reference/#dgraph-core-commands)):
```
$ dgraph-admin --auth X-Dgraph-AuthToken:token get-health
```
### with dgraph cloud
to be able to use it with dgraph cloud you will need to create an admin api key (see [authentication](https://dgraph.io/docs/cloud/admin/authentication/))
```
$ dgraph-admin --url https://something.cloud.dgraph.io --auth Dg-Auth:key get-health
```
## installation
you will need [rust and cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
```
$ git clone https://github.com/blukai/dgraph-admin.git
$ cd dgraph-admin
$ cargo install --path .
```
## a piece of motivation
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.