SeaORM 2.0.1
Enhancements
- Add
set_pagetoPaginatorto set the current page #2963 - Add
as_option/into_optiontoActiveValue<Option<V>>, flattening the outer active-value state and the inner option #3155 - Add
set_unsetand friends toActiveValue: set the value only when currentlyNotSet#3083 - Add
is_set_and/is_unchanged_andtoActiveValue#3125 - Add
ConnectOptions::test_before_acquire_if_idle_for(Duration)— ping a pooled connection before it is handed out only once it has been idle for at least the given duration, instead of on every acquire; setting it disablestest_before_acquire. Alsomap_sqlx_postgres_before_acquire/map_sqlx_mysql_before_acquire/map_sqlx_sqlite_before_acquireto install a per-backend SQLxbefore_acquirecallback (composes with the idle-ping shorthand: idle-ping first, then the callback), plus the corresponding getters #3143 - Add
MigratorTrait::get_pending_migrations_read_only/get_applied_migrations_read_only/get_migration_with_status_read_only(and thewith-selfequivalents) — query migration status without runningCREATE TABLE, so a database user without DDL privileges can check pending migrations; if the migration table does not exist, all migrations are reported as pending #3144
Bug Fixes
-
Require
TransactionTrait::Transactionto be a fixed point, fixing nested-transaction recursion (E0275/future_not_send) in#[sea_orm::model]generated save methods #3153Compatibility note: if you implement
TransactionTraityourself,Selfmust beSync, and yourTransactiontype must beSendand its own transaction type (Transaction::Transaction = Transaction). Implementations delegating toDatabaseConnection/DatabaseTransaction, and virtually all#[async_trait]implementations, already satisfy this. Callers are unaffected.
Upgrades
- Loco examples upgraded to
loco-rs1.0 (which runs on SeaORM 2.0 stable) #3152