Skip to content
Learni
View all tutorials
Bases de données

How to Get Started with EdgeDB for Beginners in 2026

Lire en français

Introduction

EdgeDB is a modern database that combines the strengths of relational and graph databases. It simplifies managing complex data while delivering excellent performance. This tutorial guides you step by step through installing EdgeDB, creating your first schema, and running simple queries. Ideal for developers getting started with this tool in 2026.

Prerequisites

  • Node.js 18 or higher
  • Basic command-line knowledge
  • A code editor like VS Code

Installing EdgeDB

terminal
curl https://www.edgedb.com/dist/install.sh | sh
edgedb --version

This command downloads and installs EdgeDB on your machine. Then verify the version to confirm the installation succeeded.

Initializing the Project

terminal
mkdir edgedb-demo
cd edgedb-demo
edgedb project init

Create a dedicated folder and initialize an EdgeDB project. This generates the necessary configuration files.

Defining the Schema

dbschema/default.esdl
module default {
  type User {
    required property name -> str;
    required property email -> str {
      constraint exclusive;
    }
  }
}

This file describes the schema with a User type. The email field is unique thanks to the exclusive constraint.

Applying the Migration

terminal
edgedb migration create
edgedb migrate

Generate and apply the migration to create the structure in your EdgeDB database.

Inserting Data

terminal
edgedb query "INSERT User { name := 'Alice', email := 'alice@example.com' }"

Insert your first user directly via the CLI to test your schema.

Best Practices

  • Always use constraints to ensure data integrity
  • Separate your schemas into logical modules
  • Test migrations in a development environment before production
  • Document every type and property

Common Mistakes to Avoid

  • Forgetting to run the migrate command after modifying the schema
  • Ignoring exclusive constraint errors on unique fields
  • Not backing up your EdgeDB instance before major updates

Going Further

Deepen your knowledge with our Learni courses.