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 sea orm rocket #2431

Merged
merged 2 commits into from
Dec 24, 2024
Merged

Conversation

FrTerstappen
Copy link
Contributor

@FrTerstappen FrTerstappen commented Nov 30, 2024

PR Info

This updates the dependencies of sea-orm-rocket and all rocket based examples.

Building sea-orm-rocket works without any code changes.
Running the unit test also works.

I have also run rustclippy.sh and rustfmt.sh.
This leads to a lot of changes which I did not include as they are not related to the updated dependencies.

The example proxy_cloudflare_worker_example does not work without adjustments to its dependencies which currently includes a patch for the worker crate.
I have also not included those changes as they are not related to the updated dependencies.

  • No issue was creates. This relates to this If required I can create an issue and link it here.

  • Dependencies:

    • none
  • Dependents:

    • none

New Features

  • none

Bug Fixes

  • none

Breaking Changes

  • Update of dependencies

Changes

  • Updated the dependencies of sea-orm-rocket
  • Updated the dependencies of all rocket examples

@sawa-ko
Copy link

sawa-ko commented Dec 13, 2024

Error in pool.rs with rocket 0.5.1 and sea-orm 1.1.2.

error[E0277]: the trait bound `DatabaseConnection: Clone` is not satisfied
  --> crates\config\src\database\pool.rs:12:5
   |
10 | #[derive(Debug, Clone)]
   |                 ----- in this derive macro expansion
11 | pub struct SeaOrmPool {
12 |     pub conn: sea_orm::DatabaseConnection,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `DatabaseConnection`
   |
   = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)


@FrTerstappen
Copy link
Contributor Author

@sawa-ko Can you tell me in which situation you encounter this error?

I'm currently using the branch of this pull request together with rocket 0.5.1 and sea-orm 1.1.2 in one of my projects.
I have not encountered any errors.

@sawa-ko
Copy link

sawa-ko commented Dec 13, 2024

Well... no situation, as I simply copied and pasted your code and the error appeared.

But.. more info:

rocket = { version = "0.5.1", features = ["serde_json", "secrets"] }
sea-orm = { version = "1.1.2", features = ["sqlx-postgres", "runtime-tokio", "macros", "mock", "with-uuid", "with-time"] }

@FrTerstappen
Copy link
Contributor Author

FrTerstappen commented Dec 14, 2024

You have the mock feature activated.

If you look into src/database/db_connection.rs you see that DatabaseConnection only implements clone if you do not enable the mock feature.

#[cfg_attr(not(feature = "mock"), derive(Clone))]
pub enum DatabaseConnection {

This is not something that has changed as part of this PR.

You can try to also feature gate the derive of Clone for SeaOrmPool (which is implemented in the examples, or your own code and not a part of the sea-orm-rocket crate).

@sawa-ko
Copy link

sawa-ko commented Dec 14, 2024

Oh, i see, btw, what about this #2451?

@FrTerstappen
Copy link
Contributor Author

@tyt2y3

I just saw that I received an email with failing tests. After looking at them they all seem to be unrelated to the changes from this PR.

Is it enough to re-base this PR? Or should I wait until these errors/warnings are fixed on main (if they are not already)?

@tyt2y3
Copy link
Member

tyt2y3 commented Dec 24, 2024

sorry for the delay, yes let's try a rebase

@FrTerstappen
Copy link
Contributor Author

I just rebased this PR on the master branch. Does the CI only run when manually triggered?

Please let me know if additional changes are required.

Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@tyt2y3 tyt2y3 merged commit 13a3de6 into SeaQL:master Dec 24, 2024
36 checks passed
@tyt2y3
Copy link
Member

tyt2y3 commented Dec 26, 2024

I've released https://crates.io/crates/sea-orm-rocket/0.5.5

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.

3 participants