🐚 An async & dynamic ORM for Rust
APACHE-2.0 License
Bot releases are visible (Hide)
Published by tyt2y3 over 2 years ago
https://www.sea-ql.org/blog/2022-03-26-whats-new-in-0.7.0/
time
crate by @billy1624 https://github.com/SeaQL/sea-orm/pull/602
delete_by_id
@ShouvikGhosh2048 https://github.com/SeaQL/sea-orm/pull/590
PaginatorTrait
for SelectorRaw
@shinbunbun https://github.com/SeaQL/sea-orm/pull/617
Send
bound to QueryStream
and TransactionStream
by @sebpuetz https://github.com/SeaQL/sea-orm/pull/471
Send
to StreamTrait
by @nappa85 https://github.com/SeaQL/sea-orm/pull/622
sea
as an alternative bin name to sea-orm-cli
by @ZhangHanDong https://github.com/SeaQL/sea-orm/pull/558
mock
from default features by @billy1624 https://github.com/SeaQL/sea-orm/pull/562
create_table_from_entity
will no longer create index for MySQL, please use the new method create_index_from_entity
DatabaseConnection
Clone
with the default features enabled https://github.com/SeaQL/sea-orm/issues/438
Clone
by default https://github.com/SeaQL/sea-orm/issues/517
.into_json()
on queries https://github.com/SeaQL/sea-orm/issues/530
#[sea_orm(indexed)]
only works for MySQL https://github.com/SeaQL/sea-orm/issues/554
sea-orm-cli generate --with-serde
does not work on Postegresql custom type https://github.com/SeaQL/sea-orm/issues/581
sea-orm-cli generate --expanded-format
panic when postgres table contains enum type https://github.com/SeaQL/sea-orm/issues/614
.into_json()
on queries https://github.com/SeaQL/sea-orm/issues/619
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.6.0...0.7.0
Published by tyt2y3 over 2 years ago
https://www.sea-ql.org/blog/2022-02-07-whats-new-in-0.6.0/
DateTime<Utc>
& DateTime<Local>
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/489
max_lifetime
connection option by @billy1624 in https://github.com/SeaQL/sea-orm/pull/493
column_name
proc_macro attribute by @billy1624 in https://github.com/SeaQL/sea-orm/pull/433
r#
prefix when deriving FromQueryResult
by @smrtrfszm in https://github.com/SeaQL/sea-orm/pull/494
DateTime<Utc>
& DateTime<Local>
https://github.com/SeaQL/sea-orm/issues/381
column_name
proc_macro attribute if column name isn't in snake case https://github.com/SeaQL/sea-orm/issues/395
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.5.0...0.6.0
Published by tyt2y3 over 2 years ago
https://www.sea-ql.org/blog/2022-01-01-whats-new-in-0.5.0/
ActiveValue
https://github.com/SeaQL/sea-orm/issues/321
Model
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/339
ActiveValue
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/340
ModelTrait::delete
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/396
sea-strum
lib back to strum
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/361
ActiveModel::insert
and ActiveModel::update
return Model
instead of ActiveModel
ActiveModelBehavior::after_save
takes Model
as input instead of ActiveModel
sea_orm::unchanged_active_value_not_intended_for_public_use
to sea_orm::Unchanged
ActiveValue::unset
to ActiveValue::not_set
ActiveValue::is_unset
to ActiveValue::is_not_set
PartialEq
of ActiveValue
will also check the equality of state instead of just checking the equality of valueFull Changelog: https://github.com/SeaQL/sea-orm/compare/0.4.2...0.5.0
Published by tyt2y3 almost 3 years ago
Delete::many()
with TableRef
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/363
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.4.1...0.4.2
Published by tyt2y3 almost 3 years ago
DateTime<FixedOffset>
. by @kev0960 in https://github.com/SeaQL/sea-orm/pull/331
axum_example
fail to compile by @billy1624 in https://github.com/SeaQL/sea-orm/pull/355
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.4.0...0.4.1
Published by tyt2y3 almost 3 years ago
https://www.sea-ql.org/blog/2021-11-19-whats-new-in-0.4.0/
sea-orm-cli
cannot pass clippy https://github.com/SeaQL/sea-orm/issues/296
DateTimeWithTimeZone
does not implement Serialize
and Deserialize
https://github.com/SeaQL/sea-orm/issues/319
PaginatorTrait
and CountTrait
for more constrains by @YoshieraHuang in https://github.com/SeaQL/sea-orm/pull/306
PaginatorTrait
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/307
Schema
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/309
ouroboros
missing docs warnings by @billy1624 in https://github.com/SeaQL/sea-orm/pull/288
with-json
feature requires chrono/serde
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/320
entity.table_ref()
instead of just entity
. by @josh-codes in https://github.com/SeaQL/sea-orm/pull/318
ActiveEnum
by @billy1624 in https://github.com/SeaQL/sea-orm/pull/324
paginate()
& count()
utilities into PaginatorTrait
. You can use the paginator as usual but you might need to import PaginatorTrait
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>
}
Schema
converting EntityTrait
into different sea-query
statement now has to be initialized with DbBackend
.
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);
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
Published by tyt2y3 almost 3 years ago
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
Published by tyt2y3 almost 3 years ago
is_null
and is_not_null
to ColumnTrait
#267Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.3.0...0.3.1
Published by tyt2y3 about 3 years ago
https://www.sea-ql.org/blog/2021-10-15-whats-new-in-0.3.0/
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?;
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 })
);
ActiveValue::take()
& ActiveValue::into_value()
without unwrap()
Default
trait bound of PrimaryKeyTrait::ValueType
ActiveModelBehavior
APIDeriveIntoActiveModel
and IntoActiveValue
trait#[automatically_derived]
to all derived implementationsPublished by tyt2y3 about 3 years ago
r#
raw identifierPublished by tyt2y3 about 3 years ago
https://www.sea-ql.org/blog/2021-10-01-whats-new-in-0.2.4/
find_linked
join with aliaspostgres://
and postgresql://
chrono::NaiveDate
& chrono::NaiveTime
Condition::not
(from sea-query)Published by tyt2y3 about 3 years ago
Clone
TryGetableMany
for diffrent types of genericsTimestampWithTimeZone
fixupPublished by tyt2y3 about 3 years ago
insert
& update
set
method to UpdateMany
FromQueryResult::find_by_statement
Published by tyt2y3 about 3 years ago
Published by tyt2y3 about 3 years ago
log
crate and env-logger
InsertResult
to return the primary key's typeLinked
TableCreateStatement
Published by tyt2y3 about 3 years ago
Published by tyt2y3 about 3 years ago
DateTimeWithTimeZone
as supported attribute typePublished by tyt2y3 about 3 years ago