Database & Async Runtime
We need your support! ⭐
Thank you for using SeaORM. Please star our GitHub repo!
First, add sea-orm to the [dependencies] section of Cargo.toml.
Cargo.toml
sea-orm = { version = "2.0.0-rc", features = [ <DATABASE_DRIVER>, <ASYNC_RUNTIME>, "macros" ] }
You must choose a DATABASE_DRIVER and an ASYNC_RUNTIME. macros is needed if you use SeaORM's generated entities (most likely).
DATABASE_DRIVER
You can choose one or more from:
sqlx-mysql- SQLx MySQL and MariaDBsqlx-postgres- SQLx PostgreSQLsqlx-sqlite- SQLx SQLite
See also: SQLx docs.
SQL Server (MSSQL) backend
The installation and configuration of MSSQL driver can be found here.
ASYNC_RUNTIME
You have to choose one from: runtime-tokio-native-tls, runtime-tokio-rustls
Basically, they are in the form of runtime-ASYNC_RUNTIME-TLS_LIB:
ASYNC_RUNTIMEcan betokioasync-stdhas been deprecated
TLS_LIBcan either benative-tlsorrustlsnative-tlsuses the platform's native security facilities, whilerustlsis an (almost) pure Rust implementation.
Extra features
debug-print- print every SQL statement to loggermock- mock interface for unit testingmacros- procedural macros, e.g. DeriveEntityModelrbac- role-based access controlseaography- enable GraphQL supportschema-sync- enable sync features in SchemaBuilder
with-chrono- supportchronotypeswith-time- supporttimetypeswith-json- supportserde-jsontypeswith-rust_decimal- supportrust_decimaltypeswith-bigdecimal- supportbigdecimaltypeswith-uuid- supportuuidtypeswith-ipnetwork- support Postgresipnetworkpostgres-vector- support Postgrespgvectorpostgres-array- support array types in Postgres, enabled by default
sqlite-use-returning-for-3_35- use returning for SQLite, enabled by defaultmariadb-use-returning- use returning for MariaDB