High-performance Rust library for automatic API generation from database schemas.It empowers you to create a blazingly fast REST API that mirrors your database structure, effortlessly handling tables, views, functions, and procedures with Rust's renowned memory safety and zero-cost abstractions. Focused on speed and resource efficiency, it's the ideal solution for microservices and high-traffic APIs.
The name axion not only hints at its foundation on Axum but also resonates with the Spanish word "acciรณn" (action), reflecting its core promise: to take decisive action in transforming your database schema into a fully functional API with minimal effort.
Note: This library is part of a broader ecosystem aimed at simplifying database-to-client workflows, which also includes Python (prism-py) and TypeScript (prism-ts) variants. Axion represents the high-performance Rust engine within this ecosystem.
Note: This is an early version of the library. While functional, it may not be fully stable. Please report any issues you encounter.
Key Features
๐ High Performance: Built on Tokio and Hyper for maximum throughput.
๐ Memory Safety: Rust's ownership model guarantees thread safety.
โก Async Everything: Fully asynchronous I/O operations without blocking.
๐ Automatic Route Generation: Create CRUD endpoints for database objects.
๐ Database Independence: Support for PostgreSQL, MySQL, and SQLite.
๐งฉ Schema-Based Organization: Routes organized by database schemas for clean API structure.
๐ Enhanced Filtering: Sorting, pagination, and complex query support.
๐ Metadata API: Explore your database structure programmatically.
๐ฅ Health Monitoring: Built-in health check endpoints.
๐ฆ Zero Boilerplate: Generate complete APIs with minimal code โ true "acciรณn"!
๐ Low Resource Usage: Minimal memory footprint and CPU utilization.
Installation
Add to your Cargo.toml
Quick Start
Here's a minimal example to get you started with axion:
use *;
async
Plans for the Future
- Full feature parity with prism-py and prism-ts.
- Comprehensive support for all database types (PostgreSQL, MySQL, SQLite, etc.).
- Support for all query types (CRUD, JOIN, etc.).
- Robust authentication mechanisms (JWT, OAuth, etc.).
- Flexible authorization models (RBAC, ABAC, etc.).
- Advanced error handling strategies (HTTP, custom, etc.).
- Versatile logging options (file, console, etc.).
- Customizable API routes and endpoints.
- Advanced filtering and sorting capabilities.
- Custom pagination solutions.
- Support for various response formats (e.g., JSON, XML, etc.).
- Custom request validation and sanitization.
Performance
axion is engineered for exceptional performance and minimal resource usage:
- Aims for significantly faster response times compared to equivalent dynamic language implementations.
- Minimal memory footprint with efficient connection pooling.
- High concurrency, capable of handling thousands of simultaneous connections.
- Low CPU usage, even under heavy load.
License
This project is licensed under the MIT License. See the LICENSE file for details.