tiberius-mappers
Row mappers for the Tiberius SQL Server driver.
- Allows you to map tiberius rows to structs
- Defines a FromRowZeroCopy trait that allows you to map rows to structs without copying the data
- Supports deriving the FromRowZeroCopy trait for structs via the tiberius-mappers-derive crate
- Handles null values where these map to Option fields in the struct
- Currently maps by name, not by index
The existing tiberius-derive crate currently offers more options for mapping, but does not seem to be maintained and doesn't work with newer versions of Tiberius. I have been maintaining a fork of this crate to support newer versions of Tiberius in internal builds, but I wanted to start from scratch with a simpler implementation.
Usage
This is a work in progress. Currently, only the FromRowZeroCopy
mapper is implemented.
// Derive the FromRowZeroCopy trait on our struct
pub async
TODO
- Add tests (proc macros are not as straightforward to test!)
- Support mapping by index
- Improve error messages
- Support renaming fields (maybe, not sure if this is a good idea!)