Skip to content

Conversation

amyipdev
Copy link
Contributor

PR Info

New Features

  • Adds Rocket v0.5.1 compatibility via a new crate version (v0.6.0)

Bug Fixes

  • The current versions of sea-orm-rocket and sea-orm-rocket-codegen are not compatible with Rocket v0.5.1, which is not declared anywhere. This provides a new version, v0.6.0, which is compatible.

Breaking Changes

  • I haven't tested to be sure, but I'm pretty sure this patch would be incompatible with Rocket v0.5.0, which is why the proposed version number is bumped to v0.6.0 such that it indicates incompatibility with the prior v0.5.5. Especially given that the README is currently empty, it might be a good idea to put an explainer in there (or at least somewhere) of which crate versions are usable for which versions of Rocket. If this would be helpful, lemme know and I'll send another commit through!

The database API for Rocket has changed between 0.5.0 and 0.5.1,
and database pools must now use rocket_db_pools. This breaks
compatibility with the current implementation of sea-orm-rocket.

Based on the working implementation at
https://github.com/amyipdev/sea-orm-rocket, this patch updates the
code to use rocket_db_pools and bumps the version number to 0.6.0
to reflect that this version is NOT compatible with the prior v0.5.5.

A maintainer with push access to crates `sea-orm-rocket` and
`sea-orm-rocket-codegen` will need to update the crates upon acceptance
of this PR.

Signed-off-by: Amy Parker <amy@amyip.net>
Fixes: SeaQL#2730
@amyipdev
Copy link
Contributor Author

@Huliiiiii

@Huliiiiii
Copy link
Member

It would be helpful to add a compatibility table to the README.

@Huliiiiii
Copy link
Member

Could you please update the examples as well?

pub idle_timeout: Option<u64>,

/// Enable SQLx statement logging (default true)
#[serde(default)]
Copy link
Member

Choose a reason for hiding this comment

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

This change seems a bit unclear. What is it used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why it doesn't set the default correctly on newer versions, but it doesn't - without manually allowing it to set a default, it'll crash unless I manually set it.

Copy link
Member

Choose a reason for hiding this comment

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

this is inconsistent with the doc comment. I will change this to default true

Copy link
Member

Choose a reason for hiding this comment

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

I think maybe we need to manually implement the Default trait here. Or we should figure out what's causing this to crash.

@amyipdev
Copy link
Contributor Author

It would be helpful to add a compatibility table to the README.

Will do!

Could you please update the examples as well?

Where are these examples located?

@amyipdev
Copy link
Contributor Author

Nevermind, I see what you mean on the failing checks. I'll get those updated.

Is the clippy check supposed to fail like that? It's failing on something completely unrelated to the PR.

@Huliiiiii
Copy link
Member

Just ignore the Clippy check; Those will only fail on the 1.1.x branch.

As the patches to sea_orm_rocket require switching over from the
original structures to those from rocket_db_pools, the examples also
need to be switched over (see build #5177).

This patch updates examples `rocket_example` and `rocket_okapi_example`
to use the new sea_orm_rocket version.

Signed-off-by: Amy Parker <amy@amyip.net>
Because v0.6.0 is not backwards-compatible with v0.5.0 and Rocket
requires a different version depending on whether one is using
v0.5.0 (and/or its release candidates) or v0.5.1, the user should be
informed in the README/when viewing on crates.io that they may need a
different version of the package.

Per the suggestions in SeaQL#2732, this patch adds a compatibility table to
the sea-orm-rocket README.

Signed-off-by: Amy Parker <amy@amyip.net>
@amyipdev
Copy link
Contributor Author

@Huliiiiii requested patches added!

The current build (#5233) for PR SeaQL#2732 fails due to the lack of proper
formatting, which gets checked during the build stage.

This patch fixes the formatting by running `cargo fmt`.

Signed-off-by: Amy Parker <amy@amyip.net>
@amyipdev
Copy link
Contributor Author

amyipdev commented Oct 1, 2025

@Huliiiiii formatting fixed in most recent patch

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 all!

@tyt2y3 tyt2y3 merged commit cb26762 into SeaQL:1.1.x Oct 1, 2025
35 of 36 checks passed
tyt2y3 pushed a commit that referenced this pull request Oct 1, 2025
* sea-orm-rocket: update for compatibility with rocket 0.5.1

The database API for Rocket has changed between 0.5.0 and 0.5.1,
and database pools must now use rocket_db_pools. This breaks
compatibility with the current implementation of sea-orm-rocket.

Based on the working implementation at
https://github.com/amyipdev/sea-orm-rocket, this patch updates the
code to use rocket_db_pools and bumps the version number to 0.6.0
to reflect that this version is NOT compatible with the prior v0.5.5.

A maintainer with push access to crates `sea-orm-rocket` and
`sea-orm-rocket-codegen` will need to update the crates upon acceptance
of this PR.

Signed-off-by: Amy Parker <amy@amyip.net>
Fixes: #2730

* examples: update for sea_orm_rocket 0.6.0

As the patches to sea_orm_rocket require switching over from the
original structures to those from rocket_db_pools, the examples also
need to be switched over (see build #5177).

This patch updates examples `rocket_example` and `rocket_okapi_example`
to use the new sea_orm_rocket version.

Signed-off-by: Amy Parker <amy@amyip.net>

* sea-orm-rocket: add compatibility table to README

Because v0.6.0 is not backwards-compatible with v0.5.0 and Rocket
requires a different version depending on whether one is using
v0.5.0 (and/or its release candidates) or v0.5.1, the user should be
informed in the README/when viewing on crates.io that they may need a
different version of the package.

Per the suggestions in #2732, this patch adds a compatibility table to
the sea-orm-rocket README.

Signed-off-by: Amy Parker <amy@amyip.net>

* examples: cargo fmt

The current build (#5233) for PR #2732 fails due to the lack of proper
formatting, which gets checked during the build stage.

This patch fixes the formatting by running `cargo fmt`.

Signed-off-by: Amy Parker <amy@amyip.net>

---------

Signed-off-by: Amy Parker <amy@amyip.net>
Copy link

github-actions bot commented Oct 9, 2025

🎉 Released In 1.1.17 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

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.

sea-orm-rocket: update for 0.5.1 compatibility
3 participants