edgedb-deno
is the official EdgeDB
driver for Deno. 🦕
This repo is automatically generated from the source of the edgedb-js
driver.
For documentation, issues, or details about the development of edgedb-deno
,
please refer to the edgedb-js repo.
import * as edgedb from "https://deno.land/x/edgedb/mod.ts";
Following Deno convention it is recommended to always import a specific tagged
version of edgedb-deno
, and to not import from the underscored /_src
path
(all of edgedb-deno
's public API is exported from the /mod.ts
file).
The main
branch of this repo mirrors the latest commits to the master
branch of edgedb-js, though it not
recommended to import from this branch directly, as it may contain breaking
changes.
First install EdgeDB, then create and start an EdgeDB instance. The quickstart guide in the EdgeDB docs is a good place to get started: https://www.edgedb.com/docs/guides/quickstart
Now you're ready to import edgedb-deno
and start querying your database:
import * as edgedb from "https://deno.land/x/edgedb/mod.ts";
const client = edgedb.createClient();
console.log(await client.querySingle("SELECT 1 + <int64>$num", { num: 2 }));
await client.close();
For the full documentation see the edgedb-js docs.
The permissions edgedb-deno
may require are detailed below:
This permission is required to connect to EdgeDB instances.
edgedb-deno
uses the recently stabilized alpnProtocols
API on Deno.connectTls
.
If you are running an older version of Deno, you may need to enable this flag
Needed if connecting with an instance name, to get your home directory (where
the .edgedb
directory is located).
Needed if connecting with an instance name, to read the instance credentials
file from <home-dir>/.edgedb/credentials
.
Needed if connecting to an instance that is using self-signed certificates,
which is the case if running the server in insecure_dev_mode
or with
EDGEDB_SERVER_TLS_CERT_MODE=generate_self_signed
.
Follow the up to date guide here
- Create the file
importMap.json
in the root of your Deno project with the following content:
{
"imports": {
"edgedb": "https://deno.land/x/edgedb/mod.ts",
"edgedb/": "https://deno.land/x/edgedb/"
}
}
- Create the file
deno.json
with the following content:
{
"importMap": "./importMap.json"
}
deno run --allow-all --unstable https://deno.land/x/edgedb/generate.ts edgeql-js
deno run --allow-all --unstable https://deno.land/x/edgedb/generate.ts queries
deno run --allow-all --unstable https://deno.land/x/edgedb/generate.ts interfaces