Developing EdgeDB​

This section describes how to build EdgeDB locally, how to use its internal tools, and how to contribute to it.

Building Locally​

The following instructions should be used to create a “dev” build on Linux or macOS. Windows is not currently supported.

Build Requirements

  • GNU make version 3.80 or newer;

  • C compiler (GCC or clang);

  • Rust compiler and Cargo 1.53 or later;

  • autotools;

  • Python 3.9 dev package;

  • Bison 1.875 or later;

  • Flex 2.5.31 or later;

  • Perl 5.8.3 or later;

  • Zlib (zlibg1-dev on Ubuntu);

  • Readline dev package;

  • Libuuid dev package.

Instructions

The easiest way to set up a development environment is to create a Python “venv” with all dependencies and commands installed into it.

  1. Make a new directory that will contain checkouts of edgedb and edgedb-python. The name of the directory is arbitrary, we will use “dev” in this guide:
  1. ```
  2. mkdir ~/dev
  3. ```
  4. ```
  5. cd ~/dev
  6. ```
  1. Clone the edgedb repository using --recursive to clone all submodules:
  1. ```
  2. git clone --recursive https://github.com/edgedb/edgedb.git
  3. ```
  1. Create a Python 3.9 virtual environment and activate it:
  1. ```
  2. python3.9 -m venv edgedb-dev
  3. ```
  4. ```
  5. source edgedb-dev/bin/activate
  6. ```
  1. Build edgedb (the build will take a while):
  1. ```
  2. cd edgedb
  3. ```
  4. ```
  5. pip install -v -e ".[test]"
  6. ```
  7. In addition to compiling EdgeDB and all dependencies, this will also install the `edb` and `edgedb` command line tools into the current Python virtual environment.
  8. It will also install libraries used during development.
  1. Run tests:
  1. ```
  2. edb test
  3. ```

The new virtual environment is now ready for development and can be activated at any time.

Running Tests​

To run all EdgeDB tests simply use the $ edb test command without arguments.

The command also supports running a few selected tests. To run all tests in a test case file:

  1. edb test tests/test_edgeql_calls.py
  1. # or run two files:
  1. edb test tests/test_edgeql_calls.py tests/test_edgeql_for.py

To pattern-match a test by its name:

  1. edb test -k test_edgeql_calls_01
  1. # or run all tests that contain "test_edgeql_calls":
  1. edb test -k test_edgeql_calls

See $ edb test --help for more options.

Dev Server​

Use the $ edb server command to start the development server.

You can then use another terminal to open a REPL to the server using the $ edgedb command, or connect to it using one of the language bindings.

Test Databases​

Use the $ edb inittestdb command to create and populate databases that are used by unit tests.