2.0.0-rc.29
- Add missing lifetime hint to
EntityName::table_name(#2907) - [sea-orm-cli] Fix codegen to not generate relations to filtered entities (#2913)
- [sea-orm-cli] Fix enum variants starting with digits (#2905)
- Add wrapper type for storing Uuids as TEXT (#2914)
- Optimize exists;
PaginatorTrait::existsis moved toSelectExt(#2909) - Add tracing spans for database operations (#2885)
- Fix derive enums without per-case rename (#2922)
- Fix DeriveIntoActiveModel (#2926)
#[derive(DeriveIntoActiveModel)]
#[sea_orm(active_model = "<fruit::Entity as EntityTrait>::ActiveModel")]
struct PartialFruit {
cake_id: Option<i32>,
}
assert_eq!(
PartialFruit { cake_id: Some(1) }.into_active_model(),
fruit::ActiveModel {
id: NotSet,
name: NotSet,
cake_id: Set(Some(1)),
}
);- FromQueryResult now supports nullable left join (#2845)
#[derive(FromQueryResult)]
struct CakeWithOptionalBakeryModel {
#[sea_orm(alias = "cake_id")]
id: i32,
#[sea_orm(alias = "cake_name")]
name: String,
#[sea_orm(nested)]
bakery: Option<bakery::Model>,
}2.0.0-rc.28
- Deprecate
do_nothingandon_empty_do_nothing(#2883) - Add
set_if_not_equals_andtoActiveValue(#2888) - Add
sqlx-allfeature insea-orm-migration(#2887) - Add debug log for entity registry (#2900)
- Set
auto_incrementto false for String / Uuid primary key by default (#2881)
1.1.19
- Add
find_linked_recursivemethod to ModelTrait https://github.com/SeaQL/sea-orm/pull/2480 - Skip drop extension type in fresh https://github.com/SeaQL/sea-orm/pull/2716
- Handle null values in
from_sqlx_*_row_to_proxy_rowfunctions https://github.com/SeaQL/sea-orm/pull/2744
1.1.17
- Added
map_sqlx_mysql_opts,map_sqlx_postgres_opts,map_sqlx_sqlite_optstoConnectOptionshttps://github.com/SeaQL/sea-orm/pull/2731
let mut opt = ConnectOptions::new(url);
opt.map_sqlx_postgres_opts(|pg_opt: PgConnectOptions| {
pg_opt.ssl_mode(PgSslMode::Require)
});
- Added
mariadb-use-returningto use returning syntax for MariaDB https://github.com/SeaQL/sea-orm/pull/2710 - Released
sea-orm-rocket0.6 https://github.com/SeaQL/sea-orm/pull/2732
1.1.16
- Fix enum casting in DerivePartialModel https://github.com/SeaQL/sea-orm/pull/2719 https://github.com/SeaQL/sea-orm/pull/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""#,
);
- [sea-orm-cli] Use tokio (optional) instead of async-std https://github.com/SeaQL/sea-orm/pull/2721
1.1.15
- Allow
DerivePartialModelto have nested aliases https://github.com/SeaQL/sea-orm/pull/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_sethttps://github.com/SeaQL/sea-orm/pull/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>;
- [sea-orm-cli] Fix compilation issue https://github.com/SeaQL/sea-orm/pull/2713
1.1.14
- [sea-orm-cli] Mask sensitive ENV values https://github.com/SeaQL/sea-orm/pull/2658
FromJsonQueryResult: panic on serialization failures https://github.com/SeaQL/sea-orm/pull/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
- [sea-orm-cli] New
--frontend-formatflag to generate entities in pure Rust https://github.com/SeaQL/sea-orm/pull/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> ,
}
- Remove potential panics in
Loaderhttps://github.com/SeaQL/sea-orm/pull/2637
1.1.12
- Make sea-orm-cli & sea-orm-migration dependencies optional https://github.com/SeaQL/sea-orm/pull/2367
- Relax TransactionError's trait bound for errors to allow
anyhow::Errorhttps://github.com/SeaQL/sea-orm/pull/2602
- Include custom
column_namein DeriveColumnColumn::from_strimpl https://github.com/SeaQL/sea-orm/pull/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
- 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
IntoConditionforRelationDefhttps://github.com/SeaQL/sea-orm/pull/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 https://github.com/SeaQL/sea-orm/pull/2569
- Add proxy transaction impl https://github.com/SeaQL/sea-orm/pull/2573
- [sea-orm-cli] Fix
PgVectorcodegen https://github.com/SeaQL/sea-orm/pull/2589
- Quote type properly in
AsEnumcasting https://github.com/SeaQL/sea-orm/pull/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 https://github.com/SeaQL/sea-orm/pull/2218
- Upgrade
heckto0.5https://github.com/SeaQL/sea-orm/pull/2218 - Upgrade
sea-queryto0.32.5 - Upgrade
sea-schemato0.16.2