github SeaQL/sea-orm 0.10.0

latest releases: 1.0.1, 1.1.0-rc.1, 1.0.0...
23 months ago

This is a release candidate. We are still updating the documentation and examples, as well as fixing critical bugs if there are any (in that case the current version might be yanked). Please check it out and provide feedback to us!

New Features

  • Better error types (carrying SQLx Error) #1002
  • Support array datatype in PostgreSQL #1132
  • [sea-orm-cli] Generate entity files as a library or module #953
  • [sea-orm-cli] Generate a new migration template with name prefix of unix timestamp #947
  • [sea-orm-cli] Generate migration in modules #933
  • [sea-orm-cli] Generate DeriveRelation on empty Relation enum #1019
  • [sea-orm-cli] Generate entity derive Eq if possible #988
  • [sea-orm-cli] Run migration on any PostgreSQL schema #1056

Enhancements

  • Support distinct & distinct_on expression #902
  • fn column() also handle enum type #973
  • Added acquire_timeout on ConnectOptions #897
  • [sea-orm-cli] migrate fresh command will drop all PostgreSQL types #864, #991
  • Better compile error for entity without primary key #1020
  • Added blanket implementations of IntoActiveValue for Option values #833
  • Added into_model & into_json to Cursor #1112
  • Added set_schema_search_path method to ConnectOptions for setting schema search path of PostgreSQL connection #1056
  • Serialize time types as serde_json::Value #1042
  • Implements fmt::Display for ActiveEnum #986
  • Implements TryFrom<ActiveModel> for Model #990

Bug fixes

  • Trim spaces when paginating raw SQL #1094

Breaking changes

  • Replaced usize with u64 in PaginatorTrait #789
  • Type signature of DbErr changed as a result of #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>,
    }
    ...
}
  • A new method 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)
    }
    ...
}

House keeping

  • Documentation grammar fixes #1050
  • Replace dotenv with dotenvy in examples #1085
  • Exclude test_cfg module from SeaORM #1077

Integration

  • Support rocket_okapi #1071

Upgrades

  • Upgrade sea-query to 0.26 #985

New Contributors

Full Changelog: 0.9.0...0.10.0

Don't miss a new sea-orm release

NewReleases is sending notifications on new releases.