🐚 An async & dynamic ORM for Rust
APACHE-2.0 License
Bot releases are hidden (Show)
Published by tyt2y3 about 1 year ago
MigratorTrait::migration_table_name()
method to configure the name of migration table https://github.com/SeaQL/sea-orm/pull/1511
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
// Override the name of migration table
fn migration_table_name() -> sea_orm::DynIden {
Alias::new("override_migration_table_name").into_iden()
}
...
}
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cake")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
// By default, it's
// `JOIN `fruit` ON `cake`.`id` = `fruit`.`cake_id` AND `fruit`.`name` LIKE '%tropical%'`
#[sea_orm(
has_many = "super::fruit::Entity",
on_condition = r#"super::fruit::Column::Name.like("%tropical%")"#
)]
TropicalFruit,
// Or specify `condition_type = "any"` to override it,
// `JOIN `fruit` ON `cake`.`id` = `fruit`.`cake_id` OR `fruit`.`name` LIKE '%tropical%'`
#[sea_orm(
has_many = "super::fruit::Entity",
on_condition = r#"super::fruit::Column::Name.like("%tropical%")"#
condition_type = "any",
)]
OrTropicalFruit,
}
Identity
supports tuple of DynIden
with arity up to 12#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "primary_key_of_12")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id_1: String,
...
#[sea_orm(primary_key, auto_increment = false)]
pub id_12: bool,
}
DerivePartialModel
https://github.com/SeaQL/sea-orm/pull/1597
#[derive(DerivePartialModel, FromQueryResult)]
#[sea_orm(entity = "Cake")]
struct PartialCake {
name: String,
#[sea_orm(
from_expr = r#"SimpleExpr::FunctionCall(Func::upper(Expr::col((Cake, cake::Column::Name))))"#
)]
name_upper: String,
}
assert_eq!(
cake::Entity::find()
.into_partial_model::<PartialCake>()
.into_statement(DbBackend::Sqlite)
.to_string(),
r#"SELECT "cake"."name", UPPER("cake"."name") AS "name_upper" FROM "cake""#
);
DbErr::sql_err()
method to convert error into common database errors SqlErr
, such as unique constraint or foreign key violation errors. https://github.com/SeaQL/sea-orm/pull/1707
assert!(matches!(
cake.into_active_model().insert(db).await
.expect_err("Insert a row with duplicated primary key")
.sql_err(),
Some(SqlErr::UniqueConstraintViolation(_))
));
assert!(matches!(
fk_cake.insert(db).await
.expect_err("Insert a row with invalid foreign key")
.sql_err(),
Some(SqlErr::ForeignKeyConstraintViolation(_))
));
Select::find_with_linked
, similar to find_with_related
: https://github.com/SeaQL/sea-orm/pull/1728, https://github.com/SeaQL/sea-orm/pull/1743
fn find_with_related<R>(self, r: R) -> SelectTwoMany<E, R>
where R: EntityTrait, E: Related<R>;
fn find_with_linked<L, T>(self, l: L) -> SelectTwoMany<E, T>
where L: Linked<FromEntity = E, ToEntity = T>, T: EntityTrait;
// boths yields `Vec<(E::Model, Vec<F::Model>)>`
DeriveValueType
derive macro for custom wrapper types, implementations of the required traits will be provided, you can customize the column_type
and array_type
if needed https://github.com/SeaQL/sea-orm/pull/1720
#[derive(DeriveValueType)]
#[sea_orm(array_type = "Int")]
pub struct Integer(i32);
#[derive(DeriveValueType)]
#[sea_orm(column_type = "Boolean", array_type = "Bool")]
pub struct Boolbean(pub String);
#[derive(DeriveValueType)]
pub struct StringVec(pub Vec<String>);
DeriveDisplay
derive macro to implements std::fmt::Display
for enum https://github.com/SeaQL/sea-orm/pull/1726
#[derive(DeriveDisplay)]
enum DisplayTea {
EverydayTea,
#[sea_orm(display_value = "Breakfast Tea")]
BreakfastTea,
}
assert_eq!(format!("{}", DisplayTea::EverydayTea), "EverydayTea");
assert_eq!(format!("{}", DisplayTea::BreakfastTea), "Breakfast Tea");
UpdateMany::exec_with_returning()
https://github.com/SeaQL/sea-orm/pull/1677
let models: Vec<Model> = Entity::update_many()
.col_expr(Column::Values, Expr::expr(..))
.exec_with_returning(db)
.await?;
default_expr
in DeriveEntityModel
https://github.com/SeaQL/sea-orm/pull/1474
#[derive(DeriveEntityModel)]
#[sea_orm(table_name = "hello")]
pub struct Model {
#[sea_orm(default_expr = "Expr::current_timestamp()")]
pub timestamp: DateTimeUtc,
}
assert_eq!(
Column::Timestamp.def(),
ColumnType::TimestampWithTimeZone.def()
.default(Expr::current_timestamp())
);
ConnAcquireErr
https://github.com/SeaQL/sea-orm/pull/1737
enum DbErr {
ConnectionAcquire(ConnAcquireErr),
..
}
enum ConnAcquireErr {
Timeout,
ConnectionClosed,
}
Added Seaography integration https://github.com/SeaQL/sea-orm/pull/1599
Added DeriveEntityRelated
macro which will implement seaography::RelationBuilder
for RelatedEntity
enumeration when the seaography
feature is enabled
Added generation of seaography
related information to sea-orm-codegen
.
The RelatedEntity
enum is added in entities files by sea-orm-cli
when flag seaography
is set:
/// SeaORM Entity
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelatedEntity)]
pub enum RelatedEntity {
#[sea_orm(entity = "super::bakery::Entity")]
Bakery,
#[sea_orm(entity = "super::cake_baker::Entity")]
CakeBaker,
#[sea_orm(entity = "super::cake::Entity")]
Cake,
}
seaography_example
Option<T>
model field. A None
value will be filled when the select result does not contain the Option<T>
field without throwing an error. https://github.com/SeaQL/sea-orm/pull/1513
migrate init
command will create a .gitignore
file when the migration folder reside in a Git repository https://github.com/SeaQL/sea-orm/pull/1334
sea-orm-cli migrate generate "create accounts table"
command will create m20230503_000000_create_accounts_table.rs
for you https://github.com/SeaQL/sea-orm/pull/1570
Migration::name()
and Migration::status()
getters for the name and status of sea_orm_migration::Migration
https://github.com/SeaQL/sea-orm/pull/1519
let migrations = Migrator::get_pending_migrations(db).await?;
assert_eq!(migrations.len(), 5);
let migration = migrations.get(0).unwrap();
assert_eq!(migration.name(), "m20220118_000002_create_fruit_table");
assert_eq!(migration.status(), MigrationStatus::Pending);
postgres-array
feature will be enabled when sqlx-postgres
backend is selected https://github.com/SeaQL/sea-orm/pull/1565
String
parameters in API with Into<String>
https://github.com/SeaQL/sea-orm/pull/1439
IntoMockRow
for any BTreeMap
that is indexed by string impl IntoMockRow for BTreeMap<T, Value> where T: Into<String>
ConnectOptions
- impl From<T> for ConnectOptions where T: Into<String>
ConnectOptions::new(T) where T: Into<String>
to takes any string SQLStatement::from_string(DbBackend, T) where T: Into<String>
to takes any string SQLStatement::from_sql_and_values(DbBackend, T, I) where I: IntoIterator<Item = Value>, T: Into<String>
to takes any string SQLTransaction::from_sql_and_values(DbBackend, T, I) where I: IntoIterator<Item = Value>, T: Into<String>
to takes any string SQLConnectOptions::set_schema_search_path(T) where T: Into<String>
to takes any stringColumnTrait::like()
, ColumnTrait::not_like()
, ColumnTrait::starts_with()
, ColumnTrait::ends_with()
and ColumnTrait::contains()
to takes any stringsea_query::{DynIden, RcOrArc, SeaRc}
to entity prelude https://github.com/SeaQL/sea-orm/pull/1661
expr
, exprs
and expr_as
methods to QuerySelect
trait https://github.com/SeaQL/sea-orm/pull/1702
DatabaseConnection::ping
https://github.com/SeaQL/sea-orm/pull/1627
|db: DatabaseConnection| {
assert!(db.ping().await.is_ok());
db.clone().close().await;
assert!(matches!(db.ping().await, Err(DbErr::ConnectionAcquire)));
}
TryInsert
that does not panic on empty inserts https://github.com/SeaQL/sea-orm/pull/1708
// now, you can do:
let res = Bakery::insert_many(std::iter::empty())
.on_empty_do_nothing()
.exec(db)
.await;
assert!(matches!(res, Ok(TryInsertResult::Empty)));
let on = OnConflict::column(Column::Id).do_nothing().to_owned();
// Existing behaviour
let res = Entity::insert_many([..]).on_conflict(on).exec(db).await;
assert!(matches!(res, Err(DbErr::RecordNotInserted)));
// New API; now you can:
let res =
Entity::insert_many([..]).on_conflict(on).do_nothing().exec(db).await;
assert!(matches!(res, Ok(TryInsertResult::Conflicted)));
DeriveActiveEnum
throwing errors because string_value
consists non-UAX#31 compliant characters https://github.com/SeaQL/sea-orm/pull/1374
#[derive(DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(None)")]
pub enum StringValue {
#[sea_orm(string_value = "")]
Member1,
#[sea_orm(string_value = "$$")]
Member2,
}
// will now produce the following enum:
pub enum StringValueVariant {
__Empty,
_0x240x24,
}
Related<R>
with via
and to
methods will not be generated if there exists multiple paths via an intermediate table https://github.com/SeaQL/sea-orm/pull/1435
ActiveEnum::db_type()
return type does not implement ColumnTypeTrait
https://github.com/SeaQL/sea-orm/pull/1576
insert_many
failing if the models iterator is empty https://github.com/SeaQL/sea-orm/issues/873
Option<T>
model field. A None
value will be filled when the select result does not contain the Option<T>
field instead of throwing an error. https://github.com/SeaQL/sea-orm/pull/1513
sea-strum
dependency with upstream strum
in sea-orm
https://github.com/SeaQL/sea-orm/pull/1535
derive
and strum
features to sea-orm-macros
EnumIter
is now shipped by sea-orm-macros
Many
to Identity
https://github.com/SeaQL/sea-orm/pull/1508
hashable-value
feature in SeaQuery, thus Value::Float(NaN) == Value::Float(NaN)
would be true https://github.com/SeaQL/sea-orm/pull/1728, https://github.com/SeaQL/sea-orm/pull/1743
DeriveActiveEnum
derive macro no longer implement std::fmt::Display
. You can use the new DeriveDisplay
macro https://github.com/SeaQL/sea-orm/pull/1726
sea-query/derive
is no longer enabled by sea-orm
, as such, Iden
no longer works as a derive macro (it's still a trait). Instead, we are shipping a new macro DeriveIden
https://github.com/SeaQL/sea-orm/pull/1740 https://github.com/SeaQL/sea-orm/pull/1755
// then:
#[derive(Iden)]
#[iden = "category"]
pub struct CategoryEnum;
#[derive(Iden)]
pub enum Tea {
Table,
#[iden = "EverydayTea"]
EverydayTea,
}
// now:
#[derive(DeriveIden)]
#[sea_orm(iden = "category")]
pub struct CategoryEnum;
#[derive(DeriveIden)]
pub enum Tea {
Table,
#[sea_orm(iden = "EverydayTea")]
EverydayTea,
}
DbErr::ConnectionAcquire
changed to ConnectionAcquire(ConnAcquireErr)
https://github.com/SeaQL/sea-orm/pull/1737
FromJsonQueryResult
removed from entity preludesqlx
to 0.7
https://github.com/SeaQL/sea-orm/pull/1742
sea-query
to 0.30
https://github.com/SeaQL/sea-orm/pull/1742
sea-schema
to 0.14
https://github.com/SeaQL/sea-orm/pull/1742
syn
to 2
https://github.com/SeaQL/sea-orm/pull/1713
heck
to 0.4
https://github.com/SeaQL/sea-orm/pull/1520, https://github.com/SeaQL/sea-orm/pull/1544
strum
to 0.25
https://github.com/SeaQL/sea-orm/pull/1752
clap
to 4.3
https://github.com/SeaQL/sea-orm/pull/1468
ouroboros
to 0.17
https://github.com/SeaQL/sea-orm/pull/1724
bae
with sea-bae
https://github.com/SeaQL/sea-orm/pull/1739
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.11.1...0.12.1
Published by billy1624 over 1 year ago
sea_orm::ConnectionTrait
in sea_orm_migration::prelude
https://github.com/SeaQL/sea-orm/pull/1577
FromQueryResult
derive macro https://github.com/SeaQL/sea-orm/pull/1464, https://github.com/SeaQL/sea-orm/pull/1603
#[derive(FromQueryResult)]
struct GenericTest<T: TryGetable> {
foo: i32,
bar: T,
}
trait MyTrait {
type Item: TryGetable;
}
#[derive(FromQueryResult)]
struct TraitAssociateTypeTest<T>
where
T: MyTrait,
{
foo: T::Item,
}
tracing-subscriber
dependency to 0.3.17 https://github.com/SeaQL/sea-orm/pull/1609
Published by billy1624 over 1 year ago
syn
features https://github.com/SeaQL/sea-orm/pull/1556
sea_query::BlobSize
in sea_orm::entity::prelude
https://github.com/SeaQL/sea-orm/pull/1548
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.11.1...0.11.2
Published by billy1624 over 1 year ago
DeriveActiveEnum
(by qualifying ColumnTypeTrait::def
) https://github.com/SeaQL/sea-orm/issues/1478
sea-orm-cli generate entity -u '<DB-URL>'
will now generate the following code for each Binary
or VarBinary
columns in compact format https://github.com/SeaQL/sea-orm/pull/1529
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "binary")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(column_type = "Binary(BlobSize::Blob(None))")]
pub binary: Vec<u8>,
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(10)))")]
pub binary_10: Vec<u8>,
#[sea_orm(column_type = "Binary(BlobSize::Tiny)")]
pub binary_tiny: Vec<u8>,
#[sea_orm(column_type = "Binary(BlobSize::Medium)")]
pub binary_medium: Vec<u8>,
#[sea_orm(column_type = "Binary(BlobSize::Long)")]
pub binary_long: Vec<u8>,
#[sea_orm(column_type = "VarBinary(10)")]
pub var_binary: Vec<u8>,
}
sea-orm-cli generate entity -u '<DB-URL>' --expanded-format
will now generate the following code for each Binary
or VarBinary
columns in expanded format https://github.com/SeaQL/sea-orm/pull/1529
impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::Integer.def(),
Self::Binary => ColumnType::Binary(sea_orm::sea_query::BlobSize::Blob(None)).def(),
Self::Binary10 => {
ColumnType::Binary(sea_orm::sea_query::BlobSize::Blob(Some(10u32))).def()
}
Self::BinaryTiny => ColumnType::Binary(sea_orm::sea_query::BlobSize::Tiny).def(),
Self::BinaryMedium => ColumnType::Binary(sea_orm::sea_query::BlobSize::Medium).def(),
Self::BinaryLong => ColumnType::Binary(sea_orm::sea_query::BlobSize::Long).def(),
Self::VarBinary => ColumnType::VarBinary(10u32).def(),
}
}
}
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.11.0...0.11.1
Published by tyt2y3 over 1 year ago
https://www.sea-ql.org/blog/2023-02-08-whats-new-in-seaorm-0.11.0/
uuid::fmt
module https://github.com/SeaQL/sea-orm/pull/1325
ActiveEnum
field as primary key https://github.com/SeaQL/sea-orm/pull/1414
ActiveModelBehavior
receive db connection as a parameter https://github.com/SeaQL/sea-orm/pull/1145, https://github.com/SeaQL/sea-orm/pull/1328
execute_unprepared
method to DatabaseConnection
and DatabaseTransaction
https://github.com/SeaQL/sea-orm/pull/1327
Select::into_tuple
to select rows as tuples (instead of defining a custom Model) https://github.com/SeaQL/sea-orm/pull/1311
#[serde(skip_deserializing)]
for primary key columns https://github.com/SeaQL/sea-orm/pull/846, https://github.com/SeaQL/sea-orm/pull/1186, https://github.com/SeaQL/sea-orm/pull/1318
#[serde(skip)]
for hidden columns https://github.com/SeaQL/sea-orm/pull/1171, https://github.com/SeaQL/sea-orm/pull/1320
#[sea_orm(column_type = "JsonBinary")]
macro attribute https://github.com/SeaQL/sea-orm/pull/1346
MockDatabase::append_exec_results()
, MockDatabase::append_query_results()
, MockDatabase::append_exec_errors()
and MockDatabase::append_query_errors()
take any types implemented IntoIterator
trait https://github.com/SeaQL/sea-orm/pull/1367
find_by_id
and delete_by_id
take any Into
primary key value https://github.com/SeaQL/sea-orm/pull/1362
QuerySelect::offset
and QuerySelect::limit
takes in Into<Option<u64>>
where None
would reset them https://github.com/SeaQL/sea-orm/pull/1410
DatabaseConnection::close
https://github.com/SeaQL/sea-orm/pull/1236
is_null
getter for ColumnDef
https://github.com/SeaQL/sea-orm/pull/1381
ActiveValue::reset
to convert Unchanged
into Set
https://github.com/SeaQL/sea-orm/pull/1177
QueryTrait::apply_if
to optionally apply a filter https://github.com/SeaQL/sea-orm/pull/1415
sea-orm-internal
feature flag to expose some SQLx types
DatabaseConnection::get_*_connection_pool()
for accessing the inner SQLx connection pool https://github.com/SeaQL/sea-orm/pull/1297
axum
to 0.6.1
https://github.com/SeaQL/sea-orm/pull/1285
sea-query
to 0.28
https://github.com/SeaQL/sea-orm/pull/1366
sea-query-binder
to 0.3
https://github.com/SeaQL/sea-orm/pull/1366
sea-schema
to 0.11
https://github.com/SeaQL/sea-orm/pull/1366
1.67.0
https://github.com/SeaQL/sea-orm/pull/1426
vec!
macro https://github.com/SeaQL/sea-orm/pull/1367
DeriveColumn
(by qualifying IdenStatic::as_str
) https://github.com/SeaQL/sea-orm/pull/1280
RecordNotInserted
error if non of them are being inserted https://github.com/SeaQL/sea-orm/pull/1021
insert_many
with on_conflict
and do_nothing
panics if no rows are inserted on Postgres https://github.com/SeaQL/sea-orm/issues/899
last_insert_id
if not needed https://github.com/SeaQL/sea-orm/pull/1403
RecordNotInserted
and RecordNotUpdated
to DbErr
ConnectionTrait::execute_unprepared
method https://github.com/SeaQL/sea-orm/pull/1327
TryGetable
changed:// then
fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>;
// now; ColIdx can be `&str` or `usize`
fn try_get_by<I: ColIdx>(res: &QueryResult, index: I) -> Result<Self, TryGetError>;
So if you implemented it yourself:
impl TryGetable for XXX {
- fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError> {
+ fn try_get_by<I: sea_orm::ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError> {
- let value: YYY = res.try_get(pre, col).map_err(TryGetError::DbErr)?;
+ let value: YYY = res.try_get_by(idx).map_err(TryGetError::DbErr)?;
..
}
}
ActiveModelBehaviour
trait becomes async trait https://github.com/SeaQL/sea-orm/pull/1328.ActiveModelBehaviour
implementation:#[async_trait::async_trait]
impl ActiveModelBehavior for ActiveModel {
async fn before_save<C>(self, db: &C, insert: bool) -> Result<Self, DbErr>
where
C: ConnectionTrait,
{
// ...
}
// ...
}
DbErr::RecordNotFound("None of the database rows are affected")
is moved to a dedicated error variant DbErr::RecordNotUpdated
https://github.com/SeaQL/sea-orm/pull/1425
let res = Update::one(cake::ActiveModel {
name: Set("Cheese Cake".to_owned()),
..model.into_active_model()
})
.exec(&db)
.await;
// then
assert_eq!(
res,
Err(DbErr::RecordNotFound(
"None of the database rows are affected".to_owned()
))
);
// now
assert_eq!(res, Err(DbErr::RecordNotUpdated));
sea_orm::ColumnType
was replaced by sea_query::ColumnType
https://github.com/SeaQL/sea-orm/pull/1395
ColumnType::def
was moved to ColumnTypeTrait
ColumnType::Binary
becomes a tuple variant which takes in additional option sea_query::BlobSize
ColumnType::Custom
takes a sea_query::DynIden
instead of String
and thus a new method custom
is added (note the lowercase)// Compact Entity
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "fruit")]
pub struct Model {
- #[sea_orm(column_type = r#"Custom("citext".to_owned())"#)]
+ #[sea_orm(column_type = r#"custom("citext")"#)]
pub column: String,
}
// Expanded Entity
impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
- Self::Column => ColumnType::Custom("citext".to_owned()).def(),
+ Self::Column => ColumnType::custom("citext").def(),
}
}
}
axum
example should use tokio runtime https://github.com/SeaQL/sea-orm/pull/1428
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.0...0.11.0
Published by tyt2y3 over 1 year ago
See 0.11.0 release notes
Published by tyt2y3 over 1 year ago
See 0.11.0 release notes
Published by tyt2y3 almost 2 years ago
insert_many
with on_conflict
and do_nothing
panics if no rows are inserted on Postgres https://github.com/SeaQL/sea-orm/issues/899
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.6...0.10.7
Published by billy1624 almost 2 years ago
DeriveColumn
(by qualifying IdenStatic::as_str
) https://github.com/SeaQL/sea-orm/pull/1280
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.5...0.10.6
Published by tyt2y3 almost 2 years ago
QuerySelect::columns
method - select multiple columns https://github.com/SeaQL/sea-orm/pull/1264
DeriveEntityModel
derive macro: when parsing field type, always treat field with Option<T>
as nullable column https://github.com/SeaQL/sea-orm/pull/1257
Related
implementation for many-to-many relation with extra columns https://github.com/SeaQL/sea-orm/pull/1260
TryGetableFromJson::try_get_from_json()
- deserializing into Self
directly without the need of a intermediate serde_json::Value
https://github.com/SeaQL/sea-orm/pull/1249
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.4...0.10.5
Published by tyt2y3 almost 2 years ago
DbErr
to MockDatabase
https://github.com/SeaQL/sea-orm/pull/1241
IS IN
enum values expression https://github.com/SeaQL/sea-orm/pull/1183
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.3...0.10.4
Published by tyt2y3 almost 2 years ago
_
prefix to enum variant starts with number https://github.com/SeaQL/sea-orm/pull/1211
Insert::exec_without_returning
https://github.com/SeaQL/sea-orm/pull/1208
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.2...0.10.3
Published by tyt2y3 almost 2 years ago
sqlx_logging
to Config
https://github.com/SeaQL/sea-orm/pull/1192
query_one/all
https://github.com/SeaQL/sea-orm/pull/1165
StreamTrait
lifetime https://github.com/SeaQL/sea-orm/pull/1161
UpdateGetPrimaryKey
https://github.com/SeaQL/sea-orm/pull/1180
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.1...0.10.2
Published by billy1624 almost 2 years ago
-
in it https://github.com/SeaQL/sea-orm/pull/879, https://github.com/SeaQL/sea-orm/pull/1155
time
crate for SQLite https://github.com/SeaQL/sea-orm/pull/995
Related
for m-to-n relation https://github.com/SeaQL/sea-orm/pull/1075
-u
when executing migrate generate
command https://github.com/SeaQL/sea-orm/pull/1157
sea_orm::
inside DeriveActiveEnum
derive macros https://github.com/SeaQL/sea-orm/pull/1146, https://github.com/SeaQL/sea-orm/pull/1154
Vec<f32>
or Vec<f64>
should not derive Eq
on the model struct https://github.com/SeaQL/sea-orm/pull/1158
cli
feature to optionally include dependencies that are required by the CLI https://github.com/SeaQL/sea-orm/pull/978
sea-schema
to 0.10.2 https://github.com/SeaQL/sea-orm/pull/1153
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.10.0...0.10.1
Published by tyt2y3 almost 2 years ago
https://www.sea-ql.org/blog/2022-11-10-whats-new-in-0.10.x/
DeriveRelation
on empty Relation
enum https://github.com/SeaQL/sea-orm/pull/1019
Eq
if possible https://github.com/SeaQL/sea-orm/pull/988
distinct
& distinct_on
expression https://github.com/SeaQL/sea-orm/pull/902
fn column()
also handle enum type https://github.com/SeaQL/sea-orm/pull/973
acquire_timeout
on ConnectOptions
https://github.com/SeaQL/sea-orm/pull/897
migrate fresh
command will drop all PostgreSQL types https://github.com/SeaQL/sea-orm/pull/864, https://github.com/SeaQL/sea-orm/pull/991
IntoActiveValue
for Option
values https://github.com/SeaQL/sea-orm/pull/833
into_model
& into_json
to Cursor
https://github.com/SeaQL/sea-orm/pull/1112
set_schema_search_path
method to ConnectOptions
for setting schema search path of PostgreSQL connection https://github.com/SeaQL/sea-orm/pull/1056
time
types as serde_json::Value
https://github.com/SeaQL/sea-orm/pull/1042
fmt::Display
for ActiveEnum
https://github.com/SeaQL/sea-orm/pull/986
TryFrom<ActiveModel>
for Model
https://github.com/SeaQL/sea-orm/pull/990
usize
with u64
in PaginatorTrait
https://github.com/SeaQL/sea-orm/pull/789
DbErr
changed as a result of https://github.com/SeaQL/sea-orm/pull/1002
ColumnType::Enum
structure changed:enum ColumnType {
// then
Enum(String, Vec<String>)
// now
Enum {
/// Name of enum
name: DynIden,
/// Variants of enum
variants: Vec<DynIden>,
}
...
}
array_type
was added to ValueType
:impl sea_orm::sea_query::ValueType for MyType {
fn array_type() -> sea_orm::sea_query::ArrayType {
sea_orm::sea_query::ArrayType::TypeName
}
...
}
ActiveEnum::name()
changed return type to DynIden
:#[derive(Debug, Iden)]
#[iden = "category"]
pub struct CategoryEnum;
impl ActiveEnum for Category {
// then
fn name() -> String {
"category".to_owned()
}
// now
fn name() -> DynIden {
SeaRc::new(CategoryEnum)
}
...
}
dotenv
with dotenvy
in examples https://github.com/SeaQL/sea-orm/pull/1085
rocket_okapi
https://github.com/SeaQL/sea-orm/pull/1071
sea-query
to 0.26 https://github.com/SeaQL/sea-orm/pull/985
Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.9.0...0.10.0
Published by tyt2y3 about 2 years ago
fn column()
also handle enum type https://github.com/SeaQL/sea-orm/pull/973
DeriveRelation
on empty Relation
enum https://github.com/SeaQL/sea-orm/pull/1019
IntoActiveValue
for time
types https://github.com/SeaQL/sea-orm/pull/1041
FromJsonQueryResult
derive macro https://github.com/SeaQL/sea-orm/pull/1081
Published by tyt2y3 about 2 years ago
with-copy-enums
flag to conditional derive Copy
on ActiveEnum
https://github.com/SeaQL/sea-orm/pull/936
chrono
default features https://github.com/SeaQL/sea-orm/pull/950
1.60
https://github.com/SeaQL/sea-orm/pull/938
sea-query
to 0.26.3
In this minor release, we removed time
v0.1 from the dependency graph
Published by tyt2y3 about 2 years ago
VarBinary
column type https://github.com/SeaQL/sea-orm/pull/746
RelationDef
& RelationBuilder
should be Send
& Sync
https://github.com/SeaQL/sea-orm/pull/898
async_trait
https://github.com/SeaQL/sea-orm/pull/737
Published by tyt2y3 over 2 years ago
https://www.sea-ql.org/blog/2022-07-17-whats-new-in-0.9.0/
DeriveMigrationName
and sea_orm_migration::util::get_file_stem
(#736)FromJsonQueryResult
for deserializing Json
from query result (#794)sqlx_logging_level
to ConnectOptions
(#800)num_items_and_pages
to Paginator
(#768)TryFromU64
for time
(#849)Insert::on_conflict
(#791)QuerySelect::join_as
and QuerySelect::join_as_rev
(#852)TryGetError::Null
(#853)time
crate (#724)clap
to 3.2 (#706)time
to 0.3 (#834)sqlx
to 0.6 (#834)uuid
to 1.0 (#834)sea-query
to 0.26 (#834)sea-schema
to 0.9 (#834)SelectTwoMany::one()
has been dropped https://github.com/SeaQL/sea-orm/pull/813, you can get (Entity, Vec<RelatedEntity>)
by first querying a single model from Entity, then use [ModelTrait::find_related
] on the model.["sqlx-json", "sqlx-chrono", "sqlx-decimal", "sqlx-uuid", "sqlx-time"]
are not needed and now removed. Instead, with-time
will enable sqlx?/time
only if sqlx
is already enabled. As a consequence, now the features with-json
, with-chrono
, with-rust_decimal
, with-uuid
, with-time
will not be enabled as a side-effects of enabling sqlx
.Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.8.0...0.9.0
Published by tyt2y3 over 2 years ago
https://www.sea-ql.org/blog/2022-05-15-whats-new-in-0.8.0/
sea migrate generate
to generate a new, empty migration file https://github.com/SeaQL/sea-orm/pull/656
max_connections
option to CLI https://github.com/SeaQL/sea-orm/pull/670
Eq
, Clone
for DbErr
https://github.com/SeaQL/sea-orm/pull/677
is_changed
to ActiveModelTrait
https://github.com/SeaQL/sea-orm/pull/683
DerivePrimaryKey
with custom primary key column name https://github.com/SeaQL/sea-orm/pull/694
DeriveEntityModel
macros override column name https://github.com/SeaQL/sea-orm/pull/695
DEFAULT
https://github.com/SeaQL/sea-orm/pull/589
sea-orm-migration
. sea_schema::migration::prelude
should be replaced by sea_orm_migration::prelude
in all migration filessea-query
to 0.24.x, sea-schema
to 0.8.xFull Changelog: https://github.com/SeaQL/sea-orm/compare/0.7.1...0.8.0