chore(deps): update sea-orm monorepo to v2#491
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
renovate
Bot
force-pushed
the
renovate/major-sea-orm-monorepo
branch
from
July 27, 2026 04:29
fa6c09d to
06896a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.1.2→2.0.01.1.2→2.0.0Release Notes
SeaQL/sea-orm (sea-orm)
v2.0.0Compare Source
Release Candidates
BelongsTorelation type (opt-in, compile-time FK cardinality), CLI generation-option errors,has_relatedCondition::any()& PG enum-array codegen fixesHasOnereplace/delete,ActiveHasOne/ActiveHasManyrename, codegenColumnTypefixesSelectFourMany,update_without_returning,cargo binstall sea-orm-cli, junctionActiveModelBehavior& schema-sync PG-schema fixesfind_both_related,set_ne, pool options, schema sync fixestry_from_u64for DeriveValueTypeMigratorTraitwithself, PostgreSQLapplication_namene_all, typedTextUuid, COUNT overflow fixsea-querybumpsqlx-allin migration,set_if_not_equals_and, auto_increment for String/Uuid PKsDeriveValueTypeimplementsNotU8for PostgreSQL arrayspostgres-use-serial-pkfeature for legacy serial PKssea-querybumpsea-querybump to rc.27DeriveValueTypeimplementsIntoActiveValue, removeNotU8DatabaseExecutorunified type, value array refactorsea-orm-synccrate,existson PaginatorTraitNew Features
Split
belongs_tofromhas_onewith a newBelongsTorelation type #3118A
belongs_torelation can now be typedBelongsTo<Entity>(required) orBelongsTo<Option<Entity>>(optional), encoding the foreign-key cardinality in the type,paired with the write-side companion
ActiveBelongsTo.BelongsTois the recommendedtype for
belongs_to; the legacyHasOne<Entity>field type remains supported forbackward compatibility.
Role Based Access Control #2683
*to grant all permissions or resourcesRestrictedConnection.it implements
ConnectionTrait, and will audit all queries and perform permission check,and reject them accordingly. all Entity operations except raw SQL are supported.
complex joins, insert select from, and even CTE queries are supported.
Entity::insert_many. We've made a number of changes #2628InsertMany,last_insert_idis nowOption<Value>Noneorvec![]is returned on exec operationsTryInsertAPI is unchangedPreviously,
insert_manyshares the same helper struct withinsert_one, which led to an awkard API.last_insert_idis nowOption<Value>:Which means the awkardness is removed:
Same on conflict API as before:
Exec with returning now returns a
Vec<Model>, so it feels intuitive:ActiveModel::from_json. Consider the following Entity #2599Previously, the following would result in error "missing field
id":Now, the ActiveModel will be partially filled:
Modelcan now be used asPartialModelin nested query #2642DeriveValueTypecan now be used as primary key #2643ConnectionTraitAPI:execute,query_one,query_all,streamnow takes in SeaQuery statement instead of raw SQL statement #2657raw_sqlmacro for ergonomic parameter injectionconsolidatemethod toSelectThree. This output has different shape depending on the topology of the join.Select::has_relatedNested ActiveModel (ActiveModelEx) and cascade operations #2818
The following operation saves a new set of user + profile + post + tag + post_tag into the database atomically:
Enhancements
serdefeatureTextUuidnow derivesSerializeandDeserializewhen theserdefeature is enabled--column-extra-derives#2212--big-integer-type=i32to use i32 for bigint (for SQLite)--experimental-preserve-user-modifications#2755 #2964Model::try_setBackendNotSupported. Previously, it panics with e.g. "Database backend doesn't support RETURNING" #2630PrimaryKeyNotSet. Previously, it panics with "PrimaryKey is not set" #2627Schema::create_enum_from_active_enum#2634ColumnTrait::eq_anyas a shorthand for the= ANYoperator. Postgres only.ActiveModelTrait::try_setLinkedcan now be used in partial select, in caseRelatedcannot be definedRelationDefnow implementsClone.on_conditionis changed toArcbut this is a minor breaking change.extraon column attribute:ColumnTrait::avg, in addition tosum,min,maxetcSchemaBuilder::synccan now be used in migrationsmax_lifetimeandidle_timeoutParameters #2748u32in Postgres asi32#2753DeriveActiveEnumnow also implIntoActiveValue#1972DeriveValueTypenow also supports any structs that can be converted to / from string #2811DeriveIntoActiveModelonOption<T>fields #2926FromQueryResultnow supports nullable nested model #2845try_from_u64toDeriveValueType#2958ArrowSchema,DeriveArrowSchemaHashMapandBTreeMapfor JSON columns viaTryGetableFromJson#3009Entity,Column,PrimaryKey, andActiveModel#3029Bug Fixes
drop_everythingnow drops custom types withCASCADEBreaking Changes
Please read SeaQuery's breaking changes as well. But for most compile errors, you can simply add
use sea_orm::ExprTrait;in scope.runtime-actixfeature flag. It's been an alias ofruntime-tokiofor more than a year, so there should be no impact.sqlite-use-returning-for-3_35by default. SQLite3.35was released in 2021, it should be the default by now.impl<T: ModelTrait + FromQueryResult> PartialModelTrait for T, there may be a potential conflict #2642DeriveValueTypewill alsoTryFromU64if applicable, there may be a potential conflict #2643DeriveValueTypealso implIntoActiveValueandNotU8, there may be a potential conflictTryIntoModelandSerializeto trait bounds ofActiveModel::from_json. There should be no impact if your models are derived withDeriveEntityModel#2599DerivePartialModelnow implementFromQueryResultby default, so there may be a potential conflict. RemoveFromQueryResultin these cases #2653IdenStaticandEntityNamedefinition #2667DeriveCustomColumnanddefault_as_str#2667execute,query_one,query_all,streamnow takes in SeaQuery statement instead of raw SQL statement. a new set of methodsexecute_raw,query_one_raw,query_all_raw,stream_rawis added #2657DatabaseConnectionis changed from enum to struct. The original enum is moved intoDatabaseConnection::inner. The new enum is namedDatabaseConnectionType#2671DeleteOneandUpdateOneno longer implementQueryFilterandQueryTraitdirectly. Those implementations could expose an incomplete SQL query with an
incomplete condition that touches too many records. To generate the right
condition, we must make sure that the primary key is set on the input
ActiveModel. If you need to access the generated SQL query, convert intoValidatedDeleteOne/ValidatedUpdateOnefirst.Call the
validate()method:DbBackend::get_query_builder()becauseQueryBuilderis not longer object safe.SelectTwoMany:into_partial_model,into_json,stream. These methods are same as those inSelectTwo.Please use
Cake::find().find_also_related(Fruit).into_json()instead.delete_by_idmethod has changed to returningDeleteOneinstead ofDeleteMany. It doesn't change normalexecusage, but would change return type ofexec_with_returningtoOption<Model>DeriveActiveEnumnow also automatically implIntoActiveValue, if you have a custom impl before, there would be a collisionwith-bigdecimalis now removed from default featuresRuntimeErr::SqlxErroris now held inArcto makeDbErrclonable and smaller:Upgrades
strumto0.27Configuration
📅 Schedule: (UTC)
* 0-3 * * 1)🚦 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 these updates again.
This PR was generated by Mend Renovate. View the repository job log.