Gel Rust Binding

repository·master·Indexed 42 days ago

https://github.com/geldata/gel-rust

A collection of modular Rust crates for interacting with the Gel database, providing everything from low-level wire protocols to high-level asynchronous clients. Includes specialized crates such as gel-auth for authentication (SCRAM, JWT, mTLS), gel-connpool for QoS-optimized connection management, gel-jwt for token support, and gel-config for parsing configuration files.

Tokens
80K
Snippets
249
Records
336
Agent score
52%

What's inside Gel Rust Binding

  1. Overview of Gel Rust Binding crates

    master

    The gel-rust workspace is a collection of specialized Rust crates designed for interacting with the Gel database. Depending on your needs, you can use specific crates for authentication, protocol implementation, connection pooling, or high-level client usage.

    Core Crates

    CrateDescription
    gel-tokioThe primary Gel database client implementation for the tokio runtime.
    gel-connpoolA load-balancing connection pool for the Gel database featuring QoS optimization.
    gel-deriveDerive macros to simplify working with the Gel database client.
    gel-authHandles authentication and authorization for Gel.
    gel-dsnParses Data-source Names (DSN) for both Gel and PostgreSQL.
    gel-errorsProvides standard error types for the Gel database client.
    gel-babelfishA Gel socket frontend capable of speaking Gel, Postgres, and HTTP protocols.
    gel-db-protocol / gel-protocolLow-level implementations of the EdgeDB/Gel wire protocols.
    gel-pg-protocolThe Gel implementation of the PostgreSQL wire protocol.
    gel-captive / gel-pg-captiveTools to run captive Gel or PostgreSQL servers for testing purposes.
    gel-configA parser for Gel configuration files.
    gel-jwtJWT implementation for Gel.
    gel-streamLibrary for streaming data between clients and servers.
    gel-protogenMacros for easier parsing and serializing of PostgreSQL-like protocols.
  2. Overview of the gel-protocol crate

    master

    The gel-protocol crate provides the core data model types and the internal protocol implementation used by the Gel client. It serves as the foundational layer for communication and data representation within the Gel Rust ecosystem.

    For high-level client usage, developers should refer to the specific client implementations:

    • Tokio Client: For asynchronous client operations using the Tokio runtime.

    Detailed API documentation can be found on docs.rs/gel-protocol.

  3. Understand JWT support in gel-jwt

    master
    The gel-jwt crate provides support for JSON Web Tokens (JWT). It utilizes the jsonwebtoken crate for the core signing and verification logic. Key loading is handled internally using the pkcs1, pkcs8, and sec1 crates to support various cryptographic formats.
  4. Use gel-config to parse Gel configuration files

    master
    The gel-config crate provides a parser for the configuration file format used by the Gel CLI and Gel server. Use this crate when you need to programmatically read or validate the configuration files that govern Gel's behavior.
  5. Parse Data-source Names (DSN) for Gel and PostgreSQL

    master
    The gel-dsn crate provides functionality for parsing Data-source Names (DSN) compatible with both Gel and PostgreSQL. This allows developers to convert connection string URIs into structured configuration objects used for establishing database connections.
  6. Use gel-derive for Gel client derive macros

    master
    The gel-derive crate provides procedural derive macros specifically designed for use with the Gel client. These macros allow you to automatically implement necessary traits for your data structures to interface with Gel. For full API details and specific macro usage, refer to the official documentation.
  7. Use gel-captive to run a temporary gel-server

    master
    The gel-captive crate provides a simple way to spin up a temporary gel-server. This is primarily intended for use in testing environments where you need a live server instance without managing a persistent database or long-running process.
  8. Supported authentication methods in gel_auth

    master

    The gel_auth crate provides authentication routines for both PostgreSQL and Gel. The supported methods are:

    • Plaintext: Supported by PostgreSQL.
    • MD5: Supported by PostgreSQL.
    • SCRAM: Supported by both PostgreSQL and Gel (specifically SCRAM-SHA-256 only).
  9. Use gel-pg-captive to test client connections

    master
    The gel-pg-captive crate provides a simple, captive Postgres server designed for testing client connections. Each instance of the server is a freshly initialized Postgres server configured with the specific credentials you provide, ensuring a clean environment for every test run.