sea-orm-typed-id
A Rust library that provides a macro for generating type-safe database ID types for SeaORM.
Caveat
You might not actually need this library; it’s just a macro, and you might be better off simply copying the code from src/lib.rs into your project.
Features
all: Enables all featuresrustls: Enables rustls TLS backend for SeaORMpostgres: Enables PostgreSQL array supportutoipa: Enables OpenAPI schema generation support
Installation
Add this to your Cargo.toml:
[]
= { = "0.2.0", = ["all"] }
Usage
use define_id;
define_id!;
define_id!;
Known Shortcomings
Typed IDs won't work with postgres arrays.
// ...
This won't compile because Vec<FillingId> doesn't implement sea_orm::TryGetable which we also can't add ourselves as both Vec and sea_orm::TryGetable are external.
One of possible workouts is to make fields private and add getter for it.
// ...
License
This project is licensed under the MIT License. See the LICENSE file for details.