Availability
To run locally, use the Docker imagedgraph/standalone:v25.0.0-preview6
.
Features
The following new features are currently available in the preview release:- Namespaces β logically isolate environments for multi-customer apps
- v2 APIs β write less code with simplified client creation and DQL execution
- Model Context Protocol (MCP) Server β stay in flow by making your Dgraph schema and queries available to your AI coding assistants
- Backups (formerly Binary Backups β non-S3 support has been dropped due to the deprecation of MinIO Gateway and is planned for a future release)
- Query Logs (formerly Audit Logs)
- Database Encryption (formerly Encryption at Rest)
- Learner Nodes
- Change Data Capture
Namespaces
Namespaces allow you to create logically separated environments for your data, enabling multi-customer apps without the overhead of managing a database per customer. The default namespace is created when the cluster is provisioned. It is namedroot
.
Namespace APIs are part of the v2 APIs. The v2 APIs are available in
the dgo/v250
package today. Other SDKs are being updated currently.
Creating a new namespace
To create a namespace, use theCreateNamespace
function.
SetSchema
, RunDQL
or similar functions.
Dropping a namespace
To drop a namespace, use theDropNamespace
function.
Rename a namespace
To rename a namespace, use theRenameNamespace
function.
List all namespaces
To list all namespaces, use theListNamespaces
function.
v2 APIs
Version 25 introduces support for v2 APIs, including simpler client creation and DQL execution. The v2 APIs are available in thedgo/v250
package today. Other
clients are being updated currently.
Open a connection
The dgo package supports connecting to a Dgraph cluster using connection strings. Dgraph connection strings take the formdgraph://host:port?arguments
with support for the following arguments:
Argument | Value | Description |
---|---|---|
bearertoken | <token> | an access token |
sslmode | disable require verify-ca | TLS option, the default is disable . If verify-ca is set, the TLS certificate configured in the Dgraph cluster must be from a valid certificate authority. |
Open
function with a connection string.
Advanced client creation
For more control, you can create a client using theNewClient
function.
NewRoundRobinClient
.
Set schema
To set the schema, use theSetSchema
function.
Run a mutation
To run a mutation, use theRunDQL
function.
Run a query
To run a query, use the sameRunDQL
function.
Run a query with variables
To run a query with variables, usingRunDQLWithVars
.
Run a best effort query
To run aBestEffort
query, use the same RunDQL
function with TxnOption
.
Run a read-only query
To run aReadOnly
query, use the same RunDQL
function with TxnOption
.
Run a query with RDF response
To get the query response in RDF format instead of JSON format, use the followingTxnOption
.
Run an upsert
TheRunDQL
function also allows you to run upserts as well.
@if
directive.
Drop all data
In order to drop all data in the cluster and start fresh, use theDropAllNamespaces
function.
Model Context Protocol (MCP) Server
The Model Context Protocol (MCP) is a standard for making tools, data, and prompts available to AI models. It can be especially useful in bringing context on your stack into coding assistants. Version 25 of Dgraph introduces two MCP servers with common tools for AI coding assistants:mcp
β a server that provides tools and data from your Dgraph clustermcp-ro
β a server that provides tools and data from your Dgraph cluster in read-only mode
Configuration
To add the MCP server to your coding assistant, add the following to your configuration file:Tools
The MCP servers provide the following tools:Get-Schema
β fetch the schema of your clusterRun-Query
β run a query on your clusterRun-Mutation
β run a mutation on your clusterAlter-Schema
β modify the schema of your clusterGet-Common-Queries
β provides reference queries to aide in query syntax