Releases: SeaQL/sea-orm
Releases Β· SeaQL/sea-orm
0.9.1
0.9.0
https://www.sea-ql.org/blog/2022-07-17-whats-new-in-0.9.0/
New Features
- Cursor pagination (#822)
- Custom join on conditions (#793)
DeriveMigrationName
andsea_orm_migration::util::get_file_stem
(#736)FromJsonQueryResult
for deserializingJson
from query result (#794)
Enhancements
- Added
sqlx_logging_level
toConnectOptions
(#800) - Added
num_items_and_pages
toPaginator
(#768) - Added
TryFromU64
fortime
(#849) - Added
Insert::on_conflict
(#791) - Added
QuerySelect::join_as
andQuerySelect::join_as_rev
(#852) - Include column name in
TryGetError::Null
(#853) - [sea-orm-cli] Improve logging (#735)
- [sea-orm-cli] Generate enum with numeric like variants (#588)
- [sea-orm-cli] Allow old pending migration to be applied (#755)
- [sea-orm-cli] Skip generating entity for ignored tables (#837)
- [sea-orm-cli] Generate code for
time
crate (#724) - [sea-orm-cli] Add various blob column types (#850)
- [sea-orm-cli] Generate entity files with Postgres's schema name (#422)
Upgrades
- Upgrade
clap
to 3.2 (#706) - Upgrade
time
to 0.3 (#834) - Upgrade
sqlx
to 0.6 (#834) - Upgrade
uuid
to 1.0 (#834) - Upgrade
sea-query
to 0.26 (#834) - Upgrade
sea-schema
to 0.9 (#834)
House keeping
- Refactor stream metrics (#778)
Bug Fixes
- [sea-orm-cli] skip checking connection string for credentials (#851)
Breaking changes
SelectTwoMany::one()
has been dropped #813, you can get(Entity, Vec<RelatedEntity>)
by first querying a single model from Entity, then use [ModelTrait::find_related
] on the model.-
Feature flag revamp
We now adopt the weak dependency syntax in Cargo. That means the flags["sqlx-json", "sqlx-chrono", "sqlx-decimal", "sqlx-uuid", "sqlx-time"]
are not needed and now removed. Instead,with-time
will enablesqlx?/time
only ifsqlx
is already enabled. As a consequence, now the featureswith-json
,with-chrono
,with-rust_decimal
,with-uuid
,with-time
will not be enabled as a side-effects of enablingsqlx
.
New Contributors
- @itsparser made their first contribution in #714
- @Eugeny made their first contribution in #716
- @SH11235 made their first contribution in #717
- @Technik97 made their first contribution in #718
- @frankhorv made their first contribution in #719
- @hilary888 made their first contribution in #741
- @aslamplr made their first contribution in #776
- @Tricked-dev made their first contribution in #712
- @kyoto7250 made their first contribution in #735
- @cache-missing made their first contribution in #792
- @POPPIN-FUMI made their first contribution in #803
- @xiaoquisme made their first contribution in #818
- @SandaruKasa made their first contribution in #800
- @liberwang1013 made their first contribution in #791
- @smonv made their first contribution in #706
- @fistons made their first contribution in #768
- @dragonnn made their first contribution in #769
- @lingdu1234 made their first contribution in #857
- @nahuakang made their first contribution in #724
- @a5huynh made their first contribution in #856
Full Changelog: 0.8.0...0.9.0
0.8.0
https://www.sea-ql.org/blog/2022-05-15-whats-new-in-0.8.0/
New Features
- [sea-orm-cli]
sea migrate generate
to generate a new, empty migration file #656
Enhancements
- Add
max_connections
option to CLI #670 - Derive
Eq
,Clone
forDbErr
#677 - Add
is_changed
toActiveModelTrait
#683
Bug Fixes
- Fix
DerivePrimaryKey
with custom primary key column name #694 - Fix
DeriveEntityModel
macros override column name #695 - Fix Insert with no value supplied using
DEFAULT
#589
Breaking changes
- Migration utilities are moved from sea-schema to sea-orm repo, under a new sub-crate
sea-orm-migration
.sea_schema::migration::prelude
should be replaced bysea_orm_migration::prelude
in all migration files
Upgrades
- Upgrade
sea-query
to 0.24.x,sea-schema
to 0.8.x - Upgrade example to Actix Web 4, Actix Web 3 remains #638
- Added Tonic gRPC example #659
- Upgrade GraphQL example to use axum 0.5.x
- Upgrade axum example to 0.5.x
Fixed Issues
- Failed to insert row with only default values #420
- Reduce database connections to 1 during codegen #511
- Column names with single letters separated by underscores are concatenated #630
- Update Actix Web examples #639
- Lower function missing #672
- is_changed on active_model #674
- Failing find_with_related with column_name attribute #693
New Contributors
- @niuhuan made their first contribution in #636
- @Chaostheorie made their first contribution in #638
- @giripriyadarshan made their first contribution in #659
- @fairingrey made their first contribution in #667
- @mibes404 made their first contribution in #673
- @benluelo made their first contribution in #670
- @SebastienGllmt made their first contribution in #677
- @viktorbahr made their first contribution in #656
- @kirawi made their first contribution in #683
Full Changelog: 0.7.1...0.8.0
0.7.0
https://www.sea-ql.org/blog/2022-03-26-whats-new-in-0.7.0/
New Features
- Update ActiveModel by JSON by @billy1624 in #492
- Supports
time
crate by @billy1624 #602 - Allow for creation of indexes for PostgreSQL and SQLite @nickb937 #593
- Added
delete_by_id
@ShouvikGhosh2048 #590 - Implement
PaginatorTrait
forSelectorRaw
@shinbunbun #617
Enhancements
- Added axum graphql example by @aaronleopold in #587
- Add example for integrate with jsonrpsee by @hunjixin #632
- Codegen add serde derives to enums, if specified by @BenJeau #463
- Codegen Unsigned Integer by @billy1624 #397
- Add
Send
bound toQueryStream
andTransactionStream
by @sebpuetz #471 - Add
Send
toStreamTrait
by @nappa85 #622 sea
as an alternative bin name tosea-orm-cli
by @ZhangHanDong #558
Bug Fixes
- Fix codegen with Enum in expanded format by @billy1624 #624
- Fixing and testing into_json of various field types by @billy1624 #539
Breaking changes
- Exclude
mock
from default features by @billy1624 #562 create_table_from_entity
will no longer create index for MySQL, please use the new methodcreate_index_from_entity
Documentations
- Describe default value of ActiveValue on document by @Ken-Miura in #556
- community: add axum-book-management by @lz1998 in #564
- Add Backpack to project showcase by @JSH32 in #567
- Add mediarepo to showcase by @Trivernis in #569
- COMMUNITY: add a link to Svix to showcase by @tasn in #537
- Update COMMUNITY.md by @naryand in #570
- Update COMMUNITY.md by @BobAnkh in #568
- Update COMMUNITY.md by @KaniyaSimeji in #566
- Update COMMUNITY.md by @aaronleopold in #565
- Update COMMUNITY.md by @gudaoxuri in #572
- Update Wikijump's entry in COMMUNITY.md by @ammongit in #573
- Update COMMUNITY.md by @koopa1338 in #574
- Update COMMUNITY.md by @gengteng in #580
- Update COMMUNITY.md by @Yama-Tomo in #582
- add oura-postgres-sink to COMMUNITY.md by @rvcas in #594
- Add rust-example-caster-api to COMMUNITY.md by @bkonkle in #623
Fixed Issues
- orm-cli generated incorrect type for #[sea_orm(primary_key)]. Should be u64. Was i64. #295
- how to update dynamicly from json value #346
- Make
DatabaseConnection
Clone
with the default features enabled #438 - Updating mutiple fields in a Model by passing a reference #460
- SeaORM CLI not adding serde derives to Enums #461
- sea-orm-cli generates wrong datatype for nullable blob #490
- Support the time crate in addition (instead of?) chrono #499
- PaginatorTrait for SelectorRaw #500
- sea_orm::DatabaseConnection should implement
Clone
by default #517 - How do you seed data in migrations using ActiveModels? #522
- Datetime fields are not serialized by
.into_json()
on queries #530 - Update / Delete by id #552
#[sea_orm(indexed)]
only works for MySQL #554sea-orm-cli generate --with-serde
does not work on Postegresql custom type #581sea-orm-cli generate --expanded-format
panic when postgres table contains enum type #614- UUID fields are not serialized by
.into_json()
on queries #619
New Contributors
- @aaronleopold made their first contribution in #565
- @BenJeau made their first contribution in #463
- @sebpuetz made their first contribution in #471
- @nickb937 made their first contribution in #593
- @shinbunbun made their first contribution in #617
- @ShouvikGhosh2048 made their first contribution in #590
- @hunjixin made their first contribution in #632
- @ZhangHanDong made their first contribution in #558
Full Changelog: 0.6.0...0.7.0
0.6.0
https://www.sea-ql.org/blog/2022-02-07-whats-new-in-0.6.0/
New Features
- Migration Support by @billy1624 in #335
- Support
DateTime<Utc>
&DateTime<Local>
by @billy1624 in #489 - Add
max_lifetime
connection option by @billy1624 in #493
Enhancements
- Model with Generics by @billy1624 in #400
- Add Poem example by @sunli829 in #446
- Codegen
column_name
proc_macro attribute by @billy1624 in #433 - Easy joins with MockDatabase #447 by @cemoktra in #455
Bug Fixes
- CLI allow generate entity with url without password by @billy1624 in #436
- Support up to 6-ary composite primary key by @billy1624 in #423
- Fix FromQueryResult when Result is redefined by @tasn in #495
- Remove
r#
prefix when derivingFromQueryResult
by @smrtrfszm in #494
Breaking Changes
- Name conflict of foreign key constraints when two entities have more than one foreign keys by @billy1624 in #417
Fixed Issues
- Is it possible to have 4 values Composite Key? #352
- Support
DateTime<Utc>
&DateTime<Local>
#381 - Codegen
column_name
proc_macro attribute if column name isn't in snake case #395 - Model with Generics #402
- Foreign key constraint collision when multiple keys exist between the same two tables #405
- sea-orm-cli passwordless database user causes "No password was found in the database url" error #435
- Testing joins with MockDatabase #447
- Surface max_lifetime connection option #475
New Contributors
- @sunli829 made their first contribution in #446
- @tasn made their first contribution in #495
- @smrtrfszm made their first contribution in #494
- @cemoktra made their first contribution in #455
Full Changelog: 0.5.0...0.6.0
0.5.0
https://www.sea-ql.org/blog/2022-01-01-whats-new-in-0.5.0/
Fixed Issues
- Why insert, update, etc return a ActiveModel instead of Model? #289
- Rework
ActiveValue
#321 - Some missing ActiveEnum utilities #338
Merged PRs
- First metric and tracing implementation by @nappa85 in #373
- Update sea-orm to depends on SeaQL/sea-query#202 by @billy1624 in #370
- Codegen ActiveEnum & Create Enum From ActiveEnum by @billy1624 in #348
- Axum example: update to Axum v0.4.2 by @ttys3 in #383
- Fix rocket version by @Gabriel-Paulucci in #384
- Insert & Update Return
Model
by @billy1624 in #339 - Rework
ActiveValue
by @billy1624 in #340 - Add wrapper method
ModelTrait::delete
by @billy1624 in #396 - Add docker create script for contributors to setup databases locally by @billy1624 in #378
- Log with tracing-subscriber by @billy1624 in #399
- Codegen SQLite by @billy1624 in #386
- PR without clippy warmings in file changed tab by @billy1624 in #401
- Rename
sea-strum
lib back tostrum
by @billy1624 in #361
Breaking Changes
ActiveModel::insert
andActiveModel::update
returnModel
instead ofActiveModel
- Method
ActiveModelBehavior::after_save
takesModel
as input instead ofActiveModel
- Rename method
sea_orm::unchanged_active_value_not_intended_for_public_use
tosea_orm::Unchanged
- Rename method
ActiveValue::unset
toActiveValue::not_set
- Rename method
ActiveValue::is_unset
toActiveValue::is_not_set
PartialEq
ofActiveValue
will also check the equality of state instead of just checking the equality of value
New Contributors
- @ttys3 made their first contribution in #383
- @Gabriel-Paulucci made their first contribution in #384
Full Changelog: 0.4.2...0.5.0
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