geldata / geldata/gel-cli

`gel` should connect to the next available branch when `main` doesn't exist

Open
#1,669 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
175
Forks
32
PR merge metrics
No merged PRs in 30d

Description

In my Gel projects, I like to have my database name and branch names be specific.

Gel expects there to be a `main` branch so running `gel` without parameters will always result in error. Here's my process:

```sh
gel instance create DATABASE_NAME
gel -I DATABASE_NAME branch create BRANCH_NAME
gel project init --server-instance DATABASE_NAME --link

gel --branch BRANCH_NAME
```

```sh
DROP BRANCH main;
\quit
```

Just like linking an instance will save it to my project, my desired default branch should be saved as well.

EDIT: I just learned about `branch switch` so this works:

```sh
gel instance create DATABASE_NAME
gel --instance DATABASE_NAME branch switch --create BRANCH_NAME
gel project init --server-instance DATABASE_NAME --link
```

Now I can run `gel` without params and automatically get connected to the instance and branch I want. Idk where this would go in the docs, maybe just refer people to this until `gel` understands `.env` files?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.