12 KiB
12 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
0.4.1 - 2021-12-05
Fixed Issues
- Is it possible to have 4 values Composite Key? https://github.com/SeaQL/sea-orm/issues/352
- [sea-orm-cli] Better handling of relation generations https://github.com/SeaQL/sea-orm/issues/239
Merged PRs
- Add TryFromU64 trait for
DateTime<FixedOffset>
. by @kev0960 in https://github.com/SeaQL/sea-orm/pull/331 - add offset and limit by @lz1998 in https://github.com/SeaQL/sea-orm/pull/351
- For some reason the
axum_example
fail to compile by @billy1624 in https://github.com/SeaQL/sea-orm/pull/355 - Support Up to 6 Values Composite Primary Key by @billy1624 in https://github.com/SeaQL/sea-orm/pull/353
- Codegen Handle Self Referencing & Multiple Relations to the Same Related Entity by @billy1624 in https://github.com/SeaQL/sea-orm/pull/347
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.4.0...0.4.1
0.4.0 - 2021-11-19
Fixed Issues
- Disable SQLx query logging https://github.com/SeaQL/sea-orm/issues/290
- Code generated by
sea-orm-cli
cannot pass clippy https://github.com/SeaQL/sea-orm/issues/296 - Should return detailed error message for connection failure https://github.com/SeaQL/sea-orm/issues/310
DateTimeWithTimeZone
does not implementSerialize
andDeserialize
https://github.com/SeaQL/sea-orm/issues/319- Support returning clause to avoid database hits https://github.com/SeaQL/sea-orm/issues/183
Merged PRs
- chore: update to Rust 2021 Edition by @sno2 in https://github.com/SeaQL/sea-orm/pull/273
- Enumeration - 3 by @billy1624 in https://github.com/SeaQL/sea-orm/pull/274
- Enumeration - 2 by @billy1624 in https://github.com/SeaQL/sea-orm/pull/261
- Codegen fix clippy warnings by @billy1624 in https://github.com/SeaQL/sea-orm/pull/303
- Add axum example by @YoshieraHuang in https://github.com/SeaQL/sea-orm/pull/297
- Enumeration by @billy1624 in https://github.com/SeaQL/sea-orm/pull/258
- Add
PaginatorTrait
andCountTrait
for more constrains by @YoshieraHuang in https://github.com/SeaQL/sea-orm/pull/306 - Continue
PaginatorTrait
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/307 - Refactor
Schema
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/309 - Detailed connection errors by @billy1624 in https://github.com/SeaQL/sea-orm/pull/312
- Suppress
ouroboros
missing docs warnings by @billy1624 in https://github.com/SeaQL/sea-orm/pull/288 with-json
feature requireschrono/serde
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/320- Pass the argument
entity.table_ref()
instead of justentity
. by @josh-codes in https://github.com/SeaQL/sea-orm/pull/318 - Unknown types could be a newtypes instead of
ActiveEnum
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/324 - Returning by @billy1624 in https://github.com/SeaQL/sea-orm/pull/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()] )]);
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.3.2...0.4.0
0.3.2 - 2021-11-03
Fixed Issues
- Support for BYTEA Postgres primary keys https://github.com/SeaQL/sea-orm/issues/286
Merged PRs
- Documentation for sea-orm by @charleschege in https://github.com/SeaQL/sea-orm/pull/280
- Support
Vec<u8>
primary key by @billy1624 in https://github.com/SeaQL/sea-orm/pull/287
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.3.1...0.3.2
0.3.1 - 2021-10-23
(We are changing our Changelog format from now on)
Fixed Issues
- Align case trasforms across derive macros https://github.com/SeaQL/sea-orm/issues/262
- Added
is_null
andis_not_null
toColumnTrait
https://github.com/SeaQL/sea-orm/issues/267
(The following is generated by GitHub)
Merged PRs
- Changed manual url parsing to use Url crate by @AngelOnFira in https://github.com/SeaQL/sea-orm/pull/253
- Test self referencing relation by @billy1624 in https://github.com/SeaQL/sea-orm/pull/256
- Unify case-transform using the same crate by @billy1624 in https://github.com/SeaQL/sea-orm/pull/264
- CI cleaning by @AngelOnFira in https://github.com/SeaQL/sea-orm/pull/263
- CI install sea-orm-cli in debug mode by @billy1624 in https://github.com/SeaQL/sea-orm/pull/265
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.3.0...0.3.1
0.3.0 - 2021-10-15
https://www.sea-ql.org/SeaORM/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()
))
);
// update many remains the same
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 - 2021-10-09
- [#224] [sea-orm-cli] Date & Time column type mapping
- Escape rust keywords with
r#
raw identifier
0.2.5 - 2021-10-06
- [#227] Resolve "Inserting actual none value of Option results in panic"
- [#219] [sea-orm-cli] Add
--tables
option - [#189] Add
debug_query
anddebug_query_stmt
macro
0.2.4 - 2021-10-01
https://www.sea-ql.org/SeaORM/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)
0.2.3 - 2021-09-22
- [#152] DatabaseConnection impl
Clone
- [#175] Impl
TryGetableMany
for diffrent types of generics - Codegen
TimestampWithTimeZone
fixup
0.2.2 - 2021-09-18
- [#105] Compact entity format
- [#132] Add ActiveModel
insert
&update
- [#129] Add
set
method toUpdateMany
- [#118] Initial lock support
- [#167] Add
FromQueryResult::find_by_statement
0.2.1 - 2021-09-04
- Update dependencies
0.2.0 - 2021-09-03
- [#37] Rocket example
- [#114]
log
crate andenv-logger
- [#103]
InsertResult
to return the primary key's type - [#89] Represent several relations between same types by
Linked
- [#59] Transforming an Entity into
TableCreateStatement
0.1.3 - 2021-08-30
- [#108] Remove impl TryGetable for Option
0.1.2 - 2021-08-23
- [#68] Added
DateTimeWithTimeZone
as supported attribute type - [#70] Generate arbitrary named entity
- [#80] Custom column name
- [#81] Support join on multiple columns
- [#99] Implement FromStr for ColumnTrait
0.1.1 - 2021-08-08
- Early release of SeaORM