kfrp / edgedb-js

JavaScript bindings for EdgeDB

Home Page:https://edgedb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The NodeJS driver for EdgeDB

Build Status NPM Join the community on Spectrum

edgedb is the official EdgeDB driver for JavaScript and TypeScript.

The library requires NodeJS 10 or later.

Installation

npm install edgedb --save

or

yarn add edgedb --save

Quick Start

Follow the EdgeDB tutorial to get EdgeDB installed and minimally configured.

Next, create the package.json file:

mkdir myproject
cd myproject
npm init

Next, install the "edgedb" library:

npm install edgedb --save

And here's a simple script to connect to an EdgeDB instance and run a simple query:

const edgedb = require("edgedb");

async function main() {
  const conn = await edgedb.connect({
    user: "edgedb",
    host: "127.0.0.1",
  });

  console.log(await conn.fetchOne("SELECT 1 + 1"));

  await conn.close();
}

main();

Development

We use yarn to develop edgedb-js.

Instructions for installing EdgeDB and edgedb-js locally can be found here.

To run the test suite, run yarn test.

License

edgedb-js is developed and distributed under the Apache 2.0 license.

About

JavaScript bindings for EdgeDB

https://edgedb.com

License:Apache License 2.0


Languages

Language:TypeScript 98.2%Language:JavaScript 1.3%Language:Shell 0.5%