| Crates.io | gelx_macros |
| lib.rs | gelx_macros |
| version | 0.8.5 |
| created_at | 2025-05-16 08:54:42.612494+00 |
| updated_at | 2025-08-02 07:55:47.253259+00 |
| description | The proc-macro crate for the `gelx` crate. |
| homepage | https://geldata.com |
| repository | https://github.com/ifiokjr/gelx |
| max_upload_size | |
| id | 1676237 |
| size | 95,111 |
gelx_macrosProcedural macros for the
gelxcrate, enabling compile-time generation of typed Rust code from Gel queries.
The gelx_macros crate provides the gelx_raw! procedural macro, which is the primary way users interact with gelx for inline query code generation.
When you use gelx_raw!(module_name, query: "select ...") or gelx_raw!(module_name, file: "path/to/query.edgeql") in your Rust code, this crate is responsible for:
gelx_core to fetch query descriptions from a Gel instance.gelx_core to generate the Rust TokenStream for the query module, including input/output structs and query functions.TokenStream to the Rust compiler to be included in your crate.This crate is an internal dependency of the main gelx crate and is not intended to be used directly by end-users, other than through the gelx! macro re-exported by the gelx crate.
The main macro provided is gelx!. It can be used in two ways:
Inline Query:
use gelx::gelx; // Assuming gelx re-exports the macro
gelx!(my_query_module, "SELECT { message := <str>$arg }");
// This generates a `my_query_module` with Input/Output structs and query
// functions.
File-based Query:
use gelx::gelx;
// Assuming a file `queries/get_user.edgeql` exists relative to your Cargo.toml
gelx!(get_user_module, file: "queries/get_user.edgeql");
// Or, if the filename matches the module name (e.g.,
// `queries/my_module.edgeql`):
gelx!(my_module);
For detailed usage examples and configuration, please refer to the documentation of the main gelx crate.
gelx_macros forwards its features to gelx_core. The available features are:
with_bigintwith_bigdecimalwith_chronowith_allqueryserdebuilderstrumThese features are typically controlled via the gelx crate's own features when you add gelx as a dependency.
This crate is part of the gelx workspace. Please refer to the main project's contributing guide for details on how to set up the development environment and contribute.
Unlicense, see the license file in the root of the workspace.