Skip to content

2.0.1

Choose a tag to compare

@tyt2y3 tyt2y3 released this 02 Aug 20:18

SeaORM 2.0.1

Enhancements

  • Add set_page to Paginator to set the current page #2963
  • Add as_option / into_option to ActiveValue<Option<V>>, flattening the outer active-value state and the inner option #3155
  • Add set_unset and friends to ActiveValue: set the value only when currently NotSet #3083
  • Add is_set_and / is_unchanged_and to ActiveValue #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 disables test_before_acquire. Also map_sqlx_postgres_before_acquire / map_sqlx_mysql_before_acquire / map_sqlx_sqlite_before_acquire to install a per-backend SQLx before_acquire callback (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 the with-self equivalents) β€” query migration status without running CREATE 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::Transaction to be a fixed point, fixing nested-transaction recursion (E0275 / future_not_send) in #[sea_orm::model] generated save methods #3153

    Compatibility note: if you implement TransactionTrait yourself, Self must be Sync, and your Transaction type must be Send and its own transaction type (Transaction::Transaction = Transaction). Implementations delegating to DatabaseConnection / DatabaseTransaction, and virtually all #[async_trait] implementations, already satisfy this. Callers are unaffected.

Upgrades

  • Loco examples upgraded to loco-rs 1.0 (which runs on SeaORM 2.0 stable) #3152