AppDB

Your database,
in code.

Define tables and the functions that use them in DBL. AppDB gives your application a typed API and runs each call as a database transaction.

An exploded isometric drawing of a gridded data block, with a path of selected cells on its top face.

The database language

Give your data
an interface.

A DBL package holds your schema and the operations your app can call. Here, a unique index keeps email addresses distinct. The exported write function creates a user in one transaction.

Download the DBL example
people.dbl
namespace people;

table User {
    id: UInt8,
    email: Text,
    primary key(id),
    unique index by_email {
        key: (email),
        value: {id},
    },
}

export write fn create_user(id: UInt8, email: Text) -> () {
    User.insert({
        id: id,
        email: email,
    });
}

Working with AppDB

From package to application.

Publish a version

Submit a package to your database, inspect its contract, then activate the version your application will use.

Generate a client

Generate client methods from your exported functions. Your application can pass typed arguments and receive results from that package version.

Call your database

Connect over HTTPS using the database’s own hostname. AppDB checks the caller’s credentials and permissions before running the operation.