EdgeQL over HTTP
EdgeDB can expose an HTTP endpoint for EdgeQL queries. Since HTTP is a stateless protocol, no DDL, transaction commands, can be executed using this endpoint. Only one query per request can be executed.
In order to set up HTTP access to the database add the following to the schema:
using extension edgeql_http;
Then create a new migration and apply it using edgedb migration create and edgedb migrate, respectively.
Your instance can now receive EdgeQL queries over HTTP at http://<hostname>:<port>/db/<database-name>/edgeql
.
In development:
The
hostname
will belocalhost
Find the
port
by runningedgedb instance list
. This will print a table of all EdgeDB instances on your machine, including their associated port number.In most cases,
database_name
will beedgedb
. An EdgeDB instance can contain multiple databases. On initialization, a default database callededgedb
is created; all queries are executed against this database unless otherwise specified.