This project is a type-safe database toolkit and object-relational mapper designed to enforce structural consistency between database schemas and application code. By leveraging compile-time validation, it ensures that SQL queries and data structures remain synchronized, preventing common errors before the application executes. It provides a comprehensive framework for relational data modeling, allowing developers to define table associations and map database results directly into strongly-typed language objects.
The library distinguishes itself through its focus on compile-time safety and automated schema management. It utilizes procedural macros to inspect database tables and generate corresponding code structures, eliminating the need for manual type definitions. Its expression-based query builder allows for the construction of complex, modular SQL statements that are automatically parameterized to mitigate security risks like SQL injection. Furthermore, the system supports extensive customization, enabling developers to register custom functions and operators or extend the query builder interface to accommodate specific database requirements.
Beyond its core mapping and validation capabilities, the toolkit provides a full suite of operations for managing data persistence. This includes support for batch insertions, relational joins, upsert operations, and the retrieval of related records. The library also handles the bidirectional transformation of data, automatically mapping application structures to database columns for updates and insertions while inferring return types for query results.
Comprehensive documentation and tooling are provided to assist with schema synchronization, ensuring that local code representations remain aligned with the underlying database throughout the development lifecycle.