A Giter8 template for DGraph with Scala!
How to use
You can import the template using
sbt new knoldus/dgraph-with-scala.g8
You will need to install DGraph on your local machine for using this template. For information on how to install DGraph, please refer to Let's Start Exploring Dgraph: How to get started.
The application picks two values from configuration, the host for DGraph and it's port. For local machines, the following exports would work -
export DGRAPH_HOST="localhost" export DGRAPH_PORT="9080"
Then all you will have to do is run the project, you can use the following command for doing so -
The application will -
- Create a connection to the DGraph using the host and port provided through the environment variables.
- Create a schema. Schema could be found in the file
schema.confpresent in the
- Mutate some data in DGraph. It will be evident what is getting mutated in the main file of the application, i.e.,
- Read some data from DGraph.
- Delete the read data.
- Read the data again to confirm deletion.
Hope this template comes in handy and you find it useful. Please reach out to me at - firstname.lastname@example.org in case of any queries.
Written in 2019 by Knoldus Inc.
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this template to the public domain worldwide. This template is distributed without any warranty. See http://creativecommons.org/publicdomain/zero/1.0/.