sea-orm

🐚 An async & dynamic ORM for Rust

APACHE-2.0 License

Downloads
13.1M
Stars
6.3K
Committers
202

Bot releases are hidden (Show)

sea-orm - 1.0.0-rc.7 Latest Release

Published by billy1624 4 months ago

Upgrades

sea-orm - 1.0.0-rc.6

Published by billy1624 4 months ago

Enhancements

Bug Fixes

sea-orm - 1.0.0-rc.5

Published by tyt2y3 5 months ago

New Features

fn get_arity_of<E: EntityTrait>() -> usize {
    E::PrimaryKey::iter().count() // before; runtime
    <<E::PrimaryKey as PrimaryKeyTrait>::ValueType as PrimaryKeyArity>::ARITY // now; compile-time
}
#[derive(DeriveEntityModel)]
#[sea_orm(table_name = "user", rename_all = "camelCase")]
pub struct Model {
    #[sea_orm(primary_key)]
    id: i32,
    first_name: String, // firstName
    #[sea_orm(column_name = "lAsTnAmE")]
    last_name: String, // lAsTnAmE
}

#[derive(EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)", rename_all = "camelCase")]
pub enum TestEnum {
    DefaultVariant, // defaultVariant
    #[sea_orm(rename = "kebab-case")]
    VariantKebabCase, // variant-kebab-case
    #[sea_orm(rename = "snake_case")]
    VariantSnakeCase, // variant_snake_case
    #[sea_orm(string_value = "CuStOmStRiNgVaLuE")]
    CustomStringValue, // CuStOmStRiNgVaLuE
}

Enhancements

sea-orm - 1.0.0-rc.4

Published by billy1624 6 months ago

Enhancements

Upgrades

  • Upgrade sea-query to 0.31.0-rc.6
  • Upgrade sea-schema to 0.15.0-rc.6

House Keeping

sea-orm - 1.0.0-rc.3

Published by billy1624 7 months ago

Enhancements

sea-orm - 0.12.15

Published by tyt2y3 7 months ago

Enhancements

#[derive(DerivePartialModel)]
#[sea_orm(entity = "<entity::Model as ModelTrait>::Entity")]
struct EntityNameNotAIdent {
    #[sea_orm(from_col = "foo2")]
    _foo: i32,
    #[sea_orm(from_col = "bar2")]
    _bar: String,
}
assert_eq!(
    cake::Entity::find()
        .join_as(
            JoinType::LeftJoin,
            cake_filling::Relation::Cake.def().rev(),
            cf.clone()
        )
        .join(
            JoinType::LeftJoin,
            cake_filling::Relation::Filling.def().from_alias(cf)
        )
        .build(DbBackend::MySql)
        .to_string(),
    [
        "SELECT `cake`.`id`, `cake`.`name` FROM `cake`",
        "LEFT JOIN `cake_filling` AS `cf` ON `cake`.`id` = `cf`.`cake_id`",
        "LEFT JOIN `filling` ON `cf`.`filling_id` = `filling`.`id`",
    ]
    .join(" ")
);
sea-orm - 1.0.0-rc.2

Published by tyt2y3 7 months ago

Breaking Changes

Enhancements

#[derive(DerivePartialModel)]
#[sea_orm(entity = "<entity::Model as ModelTrait>::Entity")]
struct EntityNameNotAIdent {
    #[sea_orm(from_col = "foo2")]
    _foo: i32,
    #[sea_orm(from_col = "bar2")]
    _bar: String,
}
assert_eq!(
    cake::Entity::find()
        .join_as(
            JoinType::LeftJoin,
            cake_filling::Relation::Cake.def().rev(),
            cf.clone()
        )
        .join(
            JoinType::LeftJoin,
            cake_filling::Relation::Filling.def().from_alias(cf)
        )
        .build(DbBackend::MySql)
        .to_string(),
    [
        "SELECT `cake`.`id`, `cake`.`name` FROM `cake`",
        "LEFT JOIN `cake_filling` AS `cf` ON `cake`.`id` = `cf`.`cake_id`",
        "LEFT JOIN `filling` ON `cf`.`filling_id` = `filling`.`id`",
    ]
    .join(" ")
);

Upgrades

  • Upgrade sea-schema to 0.15.0-rc.3

House keeping

sea-orm - 1.0.0-rc.1

Published by billy1624 9 months ago

New Features

Breaking Changes

sea-orm - 0.12.14

Published by tyt2y3 9 months ago

sea-orm - 0.12.12

Published by tyt2y3 9 months ago

Bug Fixes

Enhancements

  • Added ConnectOptions::test_before_acquire
sea-orm - 0.12.11

Published by tyt2y3 9 months ago

New Features

Enhancements

Bug Fixes

House keeping

sea-orm - 0.12.10

Published by tyt2y3 10 months ago

New Features

Enhancements

Upgrades

sea-orm - 0.12.9

Published by tyt2y3 11 months ago

Enhancements

Upgrades

sea-orm - 0.12.8

Published by tyt2y3 11 months ago

Enhancements

Upgrades

sea-orm - 0.12.7

Published by tyt2y3 11 months ago

Enhancements

  • Added method expr_as_ that accepts self

Upgrades

sea-orm - 0.12.6

Published by tyt2y3 11 months ago

New Features

Contributors

sea-orm - 0.12.5

Published by tyt2y3 11 months ago

Bug Fixes

Contributors

Full Changelog: https://github.com/SeaQL/sea-orm/compare/0.12.4...0.12.5

sea-orm - 0.12.4

Published by tyt2y3 about 1 year ago

New Features

#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "json_struct_vec")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i32,
    #[sea_orm(column_type = "Json")]
    pub struct_vec: Vec<JsonColumn>,
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)]
pub struct JsonColumn {
    pub value: String,
}

Enhancements

Upgrades

sea-orm - 0.12.3

Published by tyt2y3 about 1 year ago

New Features

Enhancements

Bug Fixes

Upgrades

House keeping

sea-orm - 0.12.2

Published by tyt2y3 about 1 year ago

Enhancements

Bug fixes