BranchesAdded in v5.0
Gel's branches are equivalent to PostgreSQL's databases and map to them directly. Gel comes with tooling to help manage branches and build a development workflow around them. E.g. when developing locally you can map your Gel branches to your Git branches, and when using Gel Cloud and GitHub you can have a branch per PR.
CLI commands
Refer to the gel branch command group for details on the CLI commands for managing branches.
DDL commands
These are low-level commands that are used to create, alter, and drop branches. You can use them when experimenting in REPL, of if you want to create your own tools to manage Gel branches.
Create empty branch
Create a new branch without schema or data.
create empty branch name ;
Description
The command create empty branch
creates a new Gel branch without schema
or data, aside from standard schemas.
Create schema branch
Create a new branch copying the schema (without data)of an existing branch.
create schema branch newbranch from oldbranch ;
Description
The command create schema branch
creates a new Gel branch with schema
copied from an already existing branch.
Create data branch
Create a new branch copying the schema and data of an existing branch.
create data branch newbranch from oldbranch ;
Description
The command create data branch
creates a new Gel branch with schema and
data copied from an already existing branch.
Drop branch
Remove a branch.
drop branch name ;
Description
The command drop branch
removes an existing branch. It cannot be executed
while there are existing connections to the target branch.
Executing drop branch
removes data permanently and cannot be undone.
Alter branch
Rename a branch.
alter branch oldname rename to newname ;
Description
The command alter branch … rename
changes the name of an existing branch.
It cannot be executed while there are existing connections to the target
branch.