Releases: SeaQL/sea-orm
Releases Β· SeaQL/sea-orm
0.4.2
Fixed Issues
- Delete::many() doesn't work when schema_name is defined #362
- find_with_related panic #374
- How to define rust type of TIMESTAMP? #344
- Add Table on the generated Column enum #356
Merged PRs
Delete::many()
withTableRef
by @billy1624 in #363- Fix related & linked with enum columns by @billy1624 in #376
- Temporary Fix: Handling MySQL & SQLite timestamp columns by @billy1624 in #379
- Add feature to generate table Iden by @Sytten in #360
New Contributors
Full Changelog: 0.4.1...0.4.2
0.4.1
Fixed Issues
- Is it possible to have 4 values Composite Key? #352
- [sea-orm-cli] Better handling of relation generations #239
Merged PRs
- Add TryFromU64 trait for
DateTime<FixedOffset>
. by @kev0960 in #331 - add offset and limit by @lz1998 in #351
- For some reason the
axum_example
fail to compile by @billy1624 in #355 - Support Up to 6 Values Composite Primary Key by @billy1624 in #353
- Codegen Handle Self Referencing & Multiple Relations to the Same Related Entity by @billy1624 in #347
New Contributors
Full Changelog: 0.4.0...0.4.1
0.4.0
https://www.sea-ql.org/blog/2021-11-19-whats-new-in-0.4.0/
Fixed Issues
- Disable SQLx query logging #290
- Code generated by
sea-orm-cli
cannot pass clippy #296 - Should return detailed error message for connection failure #310
DateTimeWithTimeZone
does not implementSerialize
andDeserialize
#319- Support returning clause to avoid database hits #183
Merged PRs
- chore: update to Rust 2021 Edition by @sno2 in #273
- Enumeration - 3 by @billy1624 in #274
- Enumeration - 2 by @billy1624 in #261
- Codegen fix clippy warnings by @billy1624 in #303
- Add axum example by @YoshieraHuang in #297
- Enumeration by @billy1624 in #258
- Add
PaginatorTrait
andCountTrait
for more constrains by @YoshieraHuang in #306 - Continue
PaginatorTrait
by @billy1624 in #307 - Refactor
Schema
by @billy1624 in #309 - Detailed connection errors by @billy1624 in #312
- Suppress
ouroboros
missing docs warnings by @billy1624 in #288 with-json
feature requireschrono/serde
by @billy1624 in #320- Pass the argument
entity.table_ref()
instead of justentity
. by @Josh-codes in #318 - Unknown types could be a newtypes instead of
ActiveEnum
by @billy1624 in #324 - Returning by @billy1624 in #292
Breaking Changes
- Refactor
paginate()
&count()
utilities intoPaginatorTrait
. You can use the paginator as usual but you might need to importPaginatorTrait
manually when upgrading from previous version.use futures::TryStreamExt; use sea_orm::{entity::*, query::*, tests_cfg::cake}; let mut cake_stream = cake::Entity::find() .order_by_asc(cake::Column::Id) .paginate(db, 50) .into_stream(); while let Some(cakes) = cake_stream.try_next().await? { // Do something on cakes: Vec<cake::Model> }
- The helper struct
Schema
convertingEntityTrait
into differentsea-query
statement now has to be initialized withDbBackend
.use sea_orm::{tests_cfg::*, DbBackend, Schema}; use sea_orm::sea_query::TableCreateStatement; // 0.3.x let _: TableCreateStatement = Schema::create_table_from_entity(cake::Entity); // 0.4.x let schema: Schema = Schema::new(DbBackend::MySql); let _: TableCreateStatement = schema.create_table_from_entity(cake::Entity);
- When performing insert or update operation on
ActiveModel
against PostgreSQL,RETURNING
clause will be used to perform select in a single SQL statement.// For PostgreSQL cake::ActiveModel { name: Set("Apple Pie".to_owned()), ..Default::default() } .insert(&postgres_db) .await?; assert_eq!( postgres_db.into_transaction_log(), vec![Transaction::from_sql_and_values( DbBackend::Postgres, r#"INSERT INTO "cake" ("name") VALUES ($1) RETURNING "id", "name""#, vec!["Apple Pie".into()] )]);
// For MySQL & SQLite cake::ActiveModel { name: Set("Apple Pie".to_owned()), ..Default::default() } .insert(&other_db) .await?; assert_eq!( other_db.into_transaction_log(), vec![ Transaction::from_sql_and_values( DbBackend::MySql, r#"INSERT INTO `cake` (`name`) VALUES (?)"#, vec!["Apple Pie".into()] ), Transaction::from_sql_and_values( DbBackend::MySql, r#"SELECT `cake`.`id`, `cake`.`name` FROM `cake` WHERE `cake`.`id` = ? LIMIT ?"#, vec![15.into(), 1u64.into()] )]);
New Contributors
- @sno2 made their first contribution in #273
- @YoshieraHuang made their first contribution in #297
- @Josh-codes made their first contribution in #318
Full Changelog: 0.3.2...0.4.0
0.3.2
Fixed Issues
- Support for BYTEA Postgres primary keys #286
Merged PRs
- Documentation for sea-orm by @charleschege in #280
- Support
Vec<u8>
primary key by @billy1624 in #287
New Contributors
- @charleschege made their first contribution in #280
Full Changelog: 0.3.1...0.3.2
0.3.1
Fixed Issues
Merged PRs
- Changed manual url parsing to use Url crate by @AngelOnFira in #253
- Test self referencing relation by @billy1624 in #256
- Unify case-transform using the same crate by @billy1624 in #264
- CI cleaning by @AngelOnFira in #263
- CI install sea-orm-cli in debug mode by @billy1624 in #265
New Contributors
- @AngelOnFira made their first contribution in #253
Full Changelog: 0.3.0...0.3.1
0.3.0
https://www.sea-ql.org/blog/2021-10-15-whats-new-in-0.3.0/
- Built-in Rocket support
ConnectOptions
let mut opt = ConnectOptions::new("protocol://username:password@host/database".to_owned());
opt.max_connections(100)
.min_connections(5)
.connect_timeout(Duration::from_secs(8))
.idle_timeout(Duration::from_secs(8));
let db = Database::connect(opt).await?;
- [#211] Throw error if none of the db rows are affected
assert_eq!(
Update::one(cake::ActiveModel {
name: Set("Cheese Cake".to_owned()),
..model.into_active_model()
})
.exec(&db)
.await,
Err(DbErr::RecordNotFound(
"None of the database rows are affected".to_owned()
))
);
assert_eq!(
Update::many(cake::Entity)
.col_expr(cake::Column::Name, Expr::value("Cheese Cake".to_owned()))
.filter(cake::Column::Id.eq(2))
.exec(&db)
.await,
Ok(UpdateResult { rows_affected: 0 })
);
- [#223]
ActiveValue::take()
&ActiveValue::into_value()
withoutunwrap()
- [#205] Drop
Default
trait bound ofPrimaryKeyTrait::ValueType
- [#222] Transaction & streaming
- [#210] Update
ActiveModelBehavior
API - [#240] Add derive
DeriveIntoActiveModel
andIntoActiveValue
trait - [#237] Introduce optional serde support for model code generation
- [#246] Add
#[automatically_derived]
to all derived implementations
0.2.6
0.2.5
0.2.4
https://www.sea-ql.org/blog/2021-10-01-whats-new-in-0.2.4/
- [[#186]] [sea-orm-cli] Foreign key handling
- [[#191]] [sea-orm-cli] Unique key handling
- [[#182]]
find_linked
join with alias - [[#202]] Accept both
postgres://
andpostgresql://
- [[#208]] Support feteching T, (T, U), (T, U, P) etc
- [[#209]] Rename column name & column enum variant
- [[#207]] Support
chrono::NaiveDate
&chrono::NaiveTime
- Support
Condition::not
(from sea-query)