Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust crate sea-orm to ^0.12.0 #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Feb 16, 2023

This PR contains the following updates:

Package Type Update Change
sea-orm (source) dependencies minor ^0.10.7 -> ^0.12.0

Release Notes

SeaQL/sea-orm (sea-orm)

v0.12.15

Compare Source

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(" ")
);

v0.12.14

Compare Source

v0.12.12

Compare Source

Bug Fixes
Enhancements
  • Added ConnectOptions::test_before_acquire

v0.12.11

Compare Source

New Features
Enhancements
Bug Fixes
House keeping

v0.12.10

Compare Source

New Features
Enhancements
Upgrades

v0.12.9

Compare Source

Enhancements
Upgrades

v0.12.8

Compare Source

Enhancements
Upgrades

v0.12.7

Compare Source

Enhancements
Upgrades

v0.12.6

Compare Source

New Features

v0.12.5

Compare Source

Bug Fixes

v0.12.4

Compare Source

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

v0.12.3

Compare Source

New Features
Enhancements
Bug Fixes
Upgrades
House keeping

v0.12.2

Compare Source

Enhancements
Bug fixes

v0.12.1

v0.11.3

Compare Source

Enhancements
#[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,
}
Bug Fixes

v0.11.2

Compare Source

Enhancements

v0.11.1

Compare Source

Bug Fixes
#[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>,
}
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(),
        }
    }
}

v0.11.0

Compare Source

  • 2023-02-02: 0.11.0-rc.1
  • 2023-02-04: 0.11.0-rc.2
New Features
SeaORM Core
SeaORM CLI
SeaORM Migration
Enhancements
Upgrades
House Keeping
Bug Fixes
Breaking Changes
// 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)?;
        ..
    }
}
#[async_trait::async_trait]
impl ActiveModelBehavior for ActiveModel {
    async fn before_save<C>(self, db: &C, insert: bool) -> Result<Self, DbErr>
    where
        C: ConnectionTrait,
    {
        // ...
    }

    // ...
}
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
    • Method 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(),
        }
    }
}
Miscellaneous

Full Changelog: SeaQL/sea-orm@0.10.0...0.11.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.11.0 Update Rust crate sea-orm to ^0.11.1 Mar 10, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.11.1 Update Rust crate sea-orm to ^0.12.0 Mar 25, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.0 Update Rust crate sea-orm to ^0.11.2 Mar 26, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.11.2 Update Rust crate sea-orm to ^0.11.3 May 28, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.11.3 Update Rust crate sea-orm to ^0.12.1 Jul 28, 2023
@renovate
Copy link
Author

renovate bot commented Jul 28, 2023

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path Cargo.toml --workspace
    Updating crates.io index
error: failed to select a version for `libsqlite3-sys`.
    ... required by package `sqlx-sqlite v0.7.0`
    ... which satisfies dependency `sqlx-sqlite = "=0.7.0"` of package `sqlx v0.7.0`
    ... which satisfies dependency `sqlx = "^0.7"` of package `sea-orm v0.12.2`
    ... which satisfies dependency `sea-orm = "^0.12.0"` of package `http-api-rs v0.1.0 (/tmp/renovate/repos/github/daniel-samson/dynamic-table-rs)`
versions that meet the requirements `^0.26.0` are: 0.26.0

the package `libsqlite3-sys` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well:
package `libsqlite3-sys v0.24.1`
    ... which satisfies dependency `libsqlite3-sys = "^0.24.1"` of package `sqlx-core v0.6.1`
    ... which satisfies dependency `sqlx-core = "^0.6.1"` of package `sqlx v0.6.1`
    ... which satisfies dependency `sqlx = "^0.6"` of package `sea-orm v0.10.7`
    ... which satisfies dependency `sea-orm = "^0.10.7"` of package `sea-orm-migration v0.10.7`
    ... which satisfies dependency `sea-orm-migration = "^0.10.7"` of package `migration v0.1.0 (/tmp/renovate/repos/github/daniel-samson/dynamic-table-rs/migration)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "sqlite3"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `libsqlite3-sys` which could resolve this conflict

@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.1 Update Rust crate sea-orm to ^0.12.2 Aug 5, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.2 Update Rust crate sea-orm to ^0.12.3 Sep 23, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.3 Update Rust crate sea-orm to ^0.12.4 Oct 20, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.4 Update Rust crate sea-orm to ^0.12.5 Nov 13, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.5 Update Rust crate sea-orm to ^0.12.6 Nov 14, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.6 Update Rust crate sea-orm to ^0.12.7 Nov 23, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.7 Update Rust crate sea-orm to ^0.12.8 Dec 4, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.8 Update Rust crate sea-orm to ^0.12.9 Dec 9, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.9 Update Rust crate sea-orm to ^0.12.10 Dec 15, 2023
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.10 Update Rust crate sea-orm to ^0.12.11 Jan 15, 2024
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.11 Update Rust crate sea-orm to ^0.12.12 Jan 23, 2024
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.12 Update Rust crate sea-orm to ^0.12.14 Feb 6, 2024
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.14 Update Rust crate sea-orm to ^0.12.15 Mar 16, 2024
@renovate renovate bot changed the title Update Rust crate sea-orm to ^0.12.15 Update Rust crate sea-orm to ^0.12.0 May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants