Database & Async Runtime
Add sea-orm-x to the [dependencies] section of Cargo.toml. You can use either a local path or a git dependency.
Local Dependency
sea-orm = { version = "2.0.0-rc", path = "<SEA_ORM_X_ROOT>/sea-orm-x", features = [ <DATABASE_DRIVER>, <ASYNC_RUNTIME>, "macros" ] }
sea-orm-migration = { version = "2.0.0-rc", path = "<SEA_ORM_X_ROOT>/sea-orm-x/sea-orm-migration" }
Git Dependency
Requires SSH access to the sea-orm-x repository. See Git Authentication in the Cargo Book.
sea-orm = { git = "ssh://git@github.com/SeaQL/sea-orm-x.git", features = ["runtime-tokio-rustls", "sqlz-mssql", "macros"] }
sea-orm-migration = { git = "ssh://git@github.com/SeaQL/sea-orm-x.git" }
If Cargo's built-in SSH client fails, force it to use your system SSH client:
[net]
git-fetch-with-cli = true
You must choose a DATABASE_DRIVER and an ASYNC_RUNTIME. macros is needed if you use SeaORM's generated entities (most likely).
DATABASE_DRIVER
sqlz-mssql- SQLz MSSQL (SQL Server)
You can also enable drivers from the open-source SeaORM (sqlx-mysql, sqlx-postgres, sqlx-sqlite) alongside sqlz-mssql in the same codebase.
ASYNC_RUNTIME
You have to choose one from:
runtime-async-std-native-tls, runtime-tokio-native-tls, runtime-async-std-rustls, runtime-tokio-rustls
These are in the form of runtime-ASYNC_RUNTIME-TLS_LIB:
ASYNC_RUNTIMEcan beasync-stdortokioTLS_LIBcan either benative-tlsorrustls
| ASYNC_RUNTIME | Web Framework |
|---|---|
async-std | Tide |
tokio | Axum, Actix, Poem, Rocket |
native-tls uses the platform's native security facilities, while rustls is a pure Rust implementation.
Extra features
debug-print- print every SQL statement to loggermock- mock interface for unit testingmacros- procedural macros for your conveniencewith-chrono- supportchronotypeswith-time- supporttimetypeswith-json- supportserde-jsontypeswith-rust_decimal- supportrust_decimaltypeswith-bigdecimal- supportbigdecimaltypeswith-uuid- supportuuidtypesschema-sync- entity-first schema sync (create tables from entity definitions)sea-orm-internal- opt-in unstable internal APIs