Skip to content

Commit

Permalink
Rename crates from edgedb to gel (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen authored Jan 16, 2025
1 parent 1e4f496 commit b0fee41
Show file tree
Hide file tree
Showing 130 changed files with 480 additions and 482 deletions.
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ A clear and concise description of what you expected to happen. If applicable, a
**Versions (please complete the following information):**

<!--
For EdgeDB version: Run `edgedb` from your project directory copying the first line of output or query `select sys::get_version_as_str();`
For EdgeDB CLI version: Run `edgedb --version` from anywhere
For Rust compiler version: Run `rustc --version`
For Cargo version: Run `cargo --version`
For EdgeDB Rust versions: Run `cargo tree | grep edgedb` from your project directory and copy/paste the entire output
Gel instance version: Run `gel` from your project directory copying the first line of output or query `select sys::get_version_as_str();`
Gel CLI version: Run `gel --version` from anywhere
Rust compiler version: Run `rustc --version`
Cargo version: Run `cargo --version`
Gel rust binding versions: Run `cargo tree | grep gel-` from your project directory and copy/paste the entire output
-->

- OS:
- EdgeDB version:
- EdgeDB CLI version:
- Gel instance version:
- Gel CLI version:
- Rust compiler version:
- Cargo version:
- EdgeDB Rust versions:
- Gel rust bindings versions:

**Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest a feature for the EdgeDB Rust binding
about: Suggest a feature for Gel Rust bindings
---

<!-- Please search existing issues to avoid creating duplicates. -->
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-edgedb-derive.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
tags:
- releases/edgedb-derive/v*
- releases/gel-derive/v*

name: Release edgedb-derive
name: Release gel-derive

jobs:
test_and_publish:
Expand All @@ -23,16 +23,16 @@ jobs:

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-derive
run: nix develop --command cargo test --all-features --package=gel-derive

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
| jq -r '.packages[] | select(.name=="edgedb-derive") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/edgedb-derive/v}"
| jq -r '.packages[] | select(.name=="gel-derive") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/gel-derive/v}"
test "$cargo_version" = "$tag_version"
- working-directory: ./edgedb-derive
- working-directory: ./gel-derive
run: |
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/publish-edgedb-errors.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
tags:
- releases/edgedb-errors/v*
- releases/gel-errors/v*

name: Release edgedb-errors
name: Release gel-errors

jobs:
test_and_publish:
Expand All @@ -23,16 +23,16 @@ jobs:

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-errors
run: nix develop --command cargo test --all-features --package=gel-errors

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
| jq -r '.packages[] | select(.name=="edgedb-errors") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/edgedb-errors/v}"
| jq -r '.packages[] | select(.name=="gel-errors") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/gel-errors/v}"
test "$cargo_version" = "$tag_version"
- working-directory: ./edgedb-errors
- working-directory: ./gel-errors
run: |
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/publish-edgedb-protocol.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
tags:
- releases/edgedb-protocol/v*
- releases/gel-protocol/v*

name: Release edgedb-protocol
name: Release gel-protocol

jobs:
test_and_publish:
Expand All @@ -23,16 +23,16 @@ jobs:

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-protocol
run: nix develop --command cargo test --all-features --package=gel-protocol

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
| jq -r '.packages[] | select(.name=="edgedb-protocol") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/edgedb-protocol/v}"
| jq -r '.packages[] | select(.name=="gel-protocol") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/gel-protocol/v}"
test "$cargo_version" = "$tag_version"
- working-directory: ./edgedb-protocol
- working-directory: ./gel-protocol
run: |
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/publish-edgedb-tokio.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
tags:
- releases/edgedb-tokio/v*
- releases/gel-tokio/v*

name: Release edgedb-tokio
name: Release gel-tokio

jobs:
test_and_publish:
Expand All @@ -23,16 +23,16 @@ jobs:

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-tokio
run: nix develop --command cargo test --all-features --package=gel-tokio

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
| jq -r '.packages[] | select(.name=="edgedb-tokio") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/edgedb-tokio/v}"
| jq -r '.packages[] | select(.name=="gel-tokio") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/gel-tokio/v}"
test "$cargo_version" = "$tag_version"
- working-directory: ./edgedb-tokio
- working-directory: ./gel-tokio
run: |
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ jobs:
- name: Check no default features
run: cargo check --no-default-features --workspace

- name: Check `fs` feature (edgedb-tokio)
run: cargo check --features=fs --package edgedb-tokio
- name: Check `fs` feature (gel-tokio)
run: cargo check --features=fs --package gel-tokio

- name: Check with env feature, edgedb-tokio
run: cargo check --features=env --package edgedb-tokio
- name: Check with env feature, gel-tokio
run: cargo check --features=env --package gel-tokio

- name: Test edgedb-protocol without default features
run: cargo test --package=edgedb-protocol --no-default-features
- name: Test gel-protocol without default features
run: cargo test --package=gel-protocol --no-default-features

- name: Test edgedb-protocol with "all-types" feature
run: cargo test --package=edgedb-protocol --features=all-types
- name: Test gel-protocol with "all-types" feature
run: cargo test --package=gel-protocol --features=all-types

- name: Run clippy
run: cargo clippy --workspace --all-features --all-targets
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[workspace]
resolver = "2"
members = [
"edgedb-errors",
"edgedb-derive",
"edgedb-protocol",
"edgedb-tokio",
"gel-errors",
"gel-derive",
"gel-protocol",
"gel-tokio",
"examples/globals",
"examples/query-error",
]
Expand Down
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
EdgeDB Rust Binding
Gel Rust Binding
===================

This workspace is a collection of Rust crates for EdgeDB support. Individual
This workspace is a collection of Rust crates for the Gel database. Individual
docs can currently be found on docs.rs:

* [edgedb-tokio](https://docs.rs/edgedb-tokio) -- client for Tokio
* [edgedb-derive](https://docs.rs/edgedb-derive) -- derive macro for data
structures fetched from the database
* Async-std bindings [edgedb-client](https://docs.rs/edgedb-client) (currently
deprecated, and moved to CLI tool repository)
* [gel-tokio](https://docs.rs/gel-tokio) -- client using Tokio async runtime,
* [gel-derive](https://docs.rs/gel-derive) -- derive macro for data
structures fetched from the database,
* [gel-protocol](https://docs.rs/gel-protocol) -- low-level definitions for
data model of the Gel protocol.
* [gel-errors](https://docs.rs/gel-protocol) -- low-level definitions for
data model of the Gel protocol.


Running Tests
=============

Due to cargo's limitation on propagation of "features", tests can only be
run as few separate command-lines:
```
cargo test --workspace
cd edgedb-protocol; cargo test --no-default-features
```
See [justfile](./justfile) for all commands to run the tests.

License
=======
Expand Down
6 changes: 3 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Releasing Rust Bindings
4. Tag release via `releases/<crate-name>/v<version_no>` tag

In case multiple crates are released here is the order:
* `edgedb-errors`
* `edgedb-derive` and `edgedb-protocol`
* `edgedb-client`
* `gel-errors`
* `gel-derive` and `gel-protocol`
* `gel-tokio`

Notes on releasing multiple crates
1. All of the version bumps can to in a single PR
Expand Down
2 changes: 0 additions & 2 deletions edgedb-tokio/src/errors.rs

This file was deleted.

4 changes: 2 additions & 2 deletions examples/globals/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false

[dependencies]
anyhow = "1.0"
edgedb-tokio = { version = "0.5.0", path="../../edgedb-tokio"}
edgedb-derive = { version = "0.5.0", path="../../edgedb-derive"}
gel-tokio = { version = "0.5.0", path="../../gel-tokio"}
gel-derive = { version = "0.5.0", path="../../gel-derive"}
tokio = {version="1.20", features=["macros", "rt", "rt-multi-thread"]}
env_logger = "0.11.3"
4 changes: 2 additions & 2 deletions examples/globals/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use edgedb_derive::GlobalsDelta;
use gel_derive::GlobalsDelta;

#[derive(GlobalsDelta)]
struct Globals<'a> {
Expand All @@ -8,7 +8,7 @@ struct Globals<'a> {
#[tokio::main]
async fn main() -> anyhow::Result<()> {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
let conn = edgedb_tokio::create_client().await?;
let conn = gel_tokio::create_client().await?;
let conn = conn.with_globals(&Globals { str_global: "val1" });
let val = conn
.query_required_single::<String, _>("SELECT (GLOBAL str_global)", &())
Expand Down
4 changes: 2 additions & 2 deletions examples/query-error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ publish = false

[dependencies]
anyhow = "1.0"
edgedb-tokio = { path = "../../edgedb-tokio", features = ["miette-errors"] }
edgedb-derive = { path = "../../edgedb-derive" }
gel-tokio = { path = "../../gel-tokio", features = ["miette-errors"] }
gel-derive = { path = "../../gel-derive" }
tokio = { version = "1.20", features = ["macros", "rt", "rt-multi-thread"] }
env_logger = "0.11.3"
miette = { version = "7.2.0", features = ["fancy"] }
6 changes: 3 additions & 3 deletions examples/query-error/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Context;

async fn do_something() -> anyhow::Result<()> {
let conn = edgedb_tokio::create_client().await?;
let conn = gel_tokio::create_client().await?;
conn.query::<String, _>("SELECT 1+2)", &())
.await
.context("Query `select 1+2`")?;
Expand All @@ -14,7 +14,7 @@ async fn main() {
match do_something().await {
Ok(res) => res,
Err(e) => {
e.downcast::<edgedb_tokio::Error>()
e.downcast::<gel_tokio::Error>()
.map(|e| eprintln!("{:?}", miette::Report::new(e)))
.unwrap_or_else(|e| eprintln!("{:#}", e));
std::process::exit(1);
Expand All @@ -26,7 +26,7 @@ async fn main() {
/// Alternative error handling if you use miette thorough your application
#[tokio::main]
async fn main() -> miette::Result<()> {
let conn = edgedb_tokio::create_client().await?;
let conn = gel_tokio::create_client().await?;
conn.query::<String, _>("SELECT 1+2)", &()).await?;
Ok(())
}
Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
description = "The EdgeDB CLI";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
Expand Down
7 changes: 4 additions & 3 deletions edgedb-derive/Cargo.toml → gel-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[package]
name = "edgedb-derive"
name = "gel-derive"
license = "MIT/Apache-2.0"
version = "0.5.2"
authors = ["MagicStack Inc. <[email protected]>"]
edition = "2018"
description = """
Derive macros for EdgeDB database client.
Derive macros for Gel database client.
Formerly published as gel-derive.
"""
readme = "README.md"
rust-version.workspace = true
Expand All @@ -18,7 +19,7 @@ trybuild = "1.0.19"

[dev-dependencies]
bytes = "1.0.1"
edgedb-protocol = {path="../edgedb-protocol"}
gel-protocol = {path="../gel-protocol"}
serde = {version="1.0", features=["derive"]}
serde_json = "1.0"

Expand Down
10 changes: 5 additions & 5 deletions edgedb-derive/README.md → gel-derive/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
EdgeDB Rust Binding: Derive Crate
=================================
Gel Rust Binding: Derive Crate
==============================

This crate contains derive macros for the EdgeDB client.
This crate contains derive macros for the Gel client.

* [Documentation](https://docs.rs/edgedb-derive)
* [Tokio Client](https://docs.rs/edgedb-tokio)
* [Documentation](https://docs.rs/gel-derive)
* [Tokio Client](https://docs.rs/gel-tokio)


License
Expand Down
4 changes: 2 additions & 2 deletions edgedb-derive/src/attrib.rs → gel-derive/src/attrib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl FieldAttrs {
pub fn from_syn(attrs: &[syn::Attribute]) -> syn::Result<FieldAttrs> {
let mut res = FieldAttrs::default();
for attr in attrs {
if matches!(attr.style, syn::AttrStyle::Outer) && attr.path().is_ident("edgedb") {
if matches!(attr.style, syn::AttrStyle::Outer) && attr.path().is_ident("gel") {
let chunk: FieldAttrList = attr.parse_args()?;
for item in chunk.0 {
match item {
Expand All @@ -89,7 +89,7 @@ impl ContainerAttrs {
pub fn from_syn(attrs: &[syn::Attribute]) -> syn::Result<ContainerAttrs> {
let mut res = ContainerAttrs::default();
for attr in attrs {
if matches!(attr.style, syn::AttrStyle::Outer) && attr.path().is_ident("edgedb") {
if matches!(attr.style, syn::AttrStyle::Outer) && attr.path().is_ident("gel") {
let chunk: ContainerAttrList = attr.parse_args()?;
for item in chunk.0 {
match item {
Expand Down
Loading

0 comments on commit b0fee41

Please sign in to comment.