Procedural macros for the Prax ORM.
This crate provides compile-time code generation for Prax, transforming schema definitions into type-safe Rust code.
Macros
- [
prax_schema!] - Generate models from a.praxschema file - [
Model] - Derive macro for manual model definition
Plugins
Code generation can be extended with plugins enabled via environment variables:
# Enable debug information
PRAX_PLUGIN_DEBUG=1
# Enable JSON Schema generation
PRAX_PLUGIN_JSON_SCHEMA=1
# Enable GraphQL SDL generation
PRAX_PLUGIN_GRAPHQL=1
# Enable custom serialization helpers
PRAX_PLUGIN_SERDE=1
# Enable runtime validation
PRAX_PLUGIN_VALIDATOR=1
# Enable all plugins
PRAX_PLUGINS_ALL=1
Example
// Generate models from schema file
prax_schema!;
// Or manually define with derive macro