Skip to content

Releases: SeaQL/sea-orm

1.1.19

11 Nov 00:47

Choose a tag to compare

Enhancements

  • Add find_linked_recursive method to ModelTrait #2480
  • Skip drop extension type in fresh #2716

Bug Fixes

  • Handle null values in from_sqlx_*_row_to_proxy_row functions #2744

1.1.17

09 Oct 12:26

Choose a tag to compare

New Features

  • Added map_sqlx_mysql_opts, map_sqlx_postgres_opts, map_sqlx_sqlite_opts to ConnectOptions #2731
let mut opt = ConnectOptions::new(url);
opt.map_sqlx_postgres_opts(|pg_opt: PgConnectOptions| {
    pg_opt.ssl_mode(PgSslMode::Require)
});
  • Added mariadb-use-returning to use returning syntax for MariaDB #2710
  • Released sea-orm-rocket 0.6 #2732

1.1.16

11 Sep 16:28

Choose a tag to compare

Bug Fixes

  • Fix enum casting in DerivePartialModel #2719 #2720
#[derive(DerivePartialModel)]
#[sea_orm(entity = "active_enum::Entity", from_query_result, alias = "zzz")]
struct PartialWithEnumAndAlias {
    #[sea_orm(from_col = "tea")]
    foo: Option<Tea>,
}

let sql = active_enum::Entity::find()
    .into_partial_model::<PartialWithEnumAndAlias>()
    .into_statement(DbBackend::Postgres)
    .sql;

assert_eq!(
    sql,
    r#"SELECT CAST("zzz"."tea" AS "text") AS "foo" FROM "public"."active_enum""#,
);

Enhancements

  • [sea-orm-cli] Use tokio (optional) instead of async-std #2721

1.1.15

31 Aug 12:02

Choose a tag to compare

Enhancements

  • Allow DerivePartialModel to have nested aliases #2686
#[derive(DerivePartialModel)]
#[sea_orm(entity = "bakery::Entity", from_query_result)]
struct Factory {
    id: i32,
    #[sea_orm(from_col = "name")]
    plant: String,
}

#[derive(DerivePartialModel)]
#[sea_orm(entity = "cake::Entity", from_query_result)]
struct CakeFactory {
    id: i32,
    name: String,
    #[sea_orm(nested, alias = "factory")] // <- new
    bakery: Option<Factory>,
}
  • Add ActiveModelTrait::try_set #2706
fn set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value);
/// New: a non-panicking version of above
fn try_set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value) -> Result<(), DbErr>;

Bug Fixes

  • [sea-orm-cli] Fix compilation issue #2713

1.1.14

21 Jul 15:12

Choose a tag to compare

1.1.14 - 2025-07-21

Enhancements

  • [sea-orm-cli] Mask sensitive ENV values #2658

Bug Fixes

  • FromJsonQueryResult: panic on serialization failures #2635
#[derive(Clone, Debug, PartialEq, Deserialize, FromJsonQueryResult)]
pub struct NonSerializableStruct;

impl Serialize for NonSerializableStruct {
    fn serialize<S>(&self, _serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer,
    {
        Err(serde::ser::Error::custom(
            "intentionally failing serialization",
        ))
    }
}

let model = Model {
    json: Some(NonSerializableStruct),
};

let _ = model.into_active_model().insert(&ctx.db).await; // panic here

1.1.13

29 Jun 17:37

Choose a tag to compare

New Features

  • [sea-orm-cli] New --frontend-format flag to generate entities in pure Rust #2631
// for example, below is the normal (compact) Entity:
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "cake")]
pub struct Model {
    #[sea_orm(primary_key)]
    #[serde(skip_deserializing)]
    pub id: i32,
    #[sea_orm(column_type = "Text", nullable)]
    pub name: Option<String> ,
}
// this is the generated frontend model, there is no SeaORM dependency:
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Model {
    #[serde(skip_deserializing)]
    pub id: i32,
    pub name: Option<String> ,
}

Enhancements

  • Remove potential panics in Loader #2637

1.1.12

27 May 09:18

Choose a tag to compare

Enhancements

  • Make sea-orm-cli & sea-orm-migration dependencies optional #2367
  • Relax TransactionError's trait bound for errors to allow anyhow::Error #2602

Bug Fixes

  • Include custom column_name in DeriveColumn Column::from_str impl #2603
#[derive(DeriveEntityModel)]
pub struct Model {
    #[sea_orm(column_name = "lAsTnAmE")]
    last_name: String,
}

assert!(matches!(Column::from_str("lAsTnAmE").unwrap(), Column::LastName));

1.1.11

07 May 23:16

Choose a tag to compare

Enhancements

  • Added ActiveModelTrait::default_values
assert_eq!(
    fruit::ActiveModel::default_values(),
    fruit::ActiveModel {
        id: Set(0),
        name: Set("".into()),
        cake_id: Set(None),
        type_without_default: NotSet,
    },
);
  • Impl IntoCondition for RelationDef #2587
// This allows using `RelationDef` directly where sea-query expects an `IntoCondition`
let query = Query::select()
    .from(fruit::Entity)
    .inner_join(cake::Entity, fruit::Relation::Cake.def())
    .to_owned();
  • Loader: retain only unique key values in the query condition #2569
  • Add proxy transaction impl #2573
  • [sea-orm-cli] Fix PgVector codegen #2589

Bug fixes

  • Quote type properly in AsEnum casting #2570
assert_eq!(
    lunch_set::Entity::find()
        .select_only()
        .column(lunch_set::Column::Tea)
        .build(DbBackend::Postgres)
        .to_string(),
    r#"SELECT CAST("lunch_set"."tea" AS "text") FROM "lunch_set""#
    // "text" is now quoted; will work for "text"[] as well
);
  • Fix unicode string enum #2218

Upgrades

  • Upgrade heck to 0.5 #2218
  • Upgrade sea-query to 0.32.5
  • Upgrade sea-schema to 0.16.2

1.1.10

14 Apr 10:47

Choose a tag to compare

Upgrades

  • Upgrade sqlx to 0.8.4 #2562

1.1.9

13 Apr 23:32

Choose a tag to compare

Enhancements

  • [sea-orm-macros] Use fully-qualified syntax for ActiveEnum associated type #2552
  • Accept LikeExpr in like and not_like #2549

Bug fixes

  • Check if url is well-formed before parsing #2558
  • QuerySelect::column_as method cast ActiveEnum column #2551

House keeping

  • Remove redundant Expr::expr from internal code #2554