Cont. feat: expose database connection to ActiveModelBehaviour's methods#1328
Merged
Cont. feat: expose database connection to ActiveModelBehaviour's methods#1328
ActiveModelBehaviour's methods#1328Conversation
Member
Author
|
Hey @tyt2y3, we can include this in the upcoming release |
tyt2y3
requested changes
Jan 11, 2023
Member
tyt2y3
left a comment
There was a problem hiding this comment.
We need to have a test entity and some test cases for this
Member
Author
|
Tests added |
Member
|
I feel like we will have a lot of documentation to write |
Member
Author
Yes, lots of breaking changes to be documented not to mention the new features lolll |
denwong47
pushed a commit
to denwong47/sea-orm
that referenced
this pull request
Jan 20, 2023
…thods (SeaQL#1328) * feat: expose database connection to `ActiveModelBehaviour`'s methods (SeaQL#1145) * Make ActiveModelTrait async * Add tests * refactoring Co-authored-by: teenjuna <[email protected]>
billy1624
added a commit
to SeaQL/seaql.github.io
that referenced
this pull request
Feb 2, 2023
tyt2y3
added a commit
to SeaQL/seaql.github.io
that referenced
this pull request
Feb 3, 2023
* Update 02-writing-migration.md * Update SeaORM/docs/03-migration/02-writing-migration.md * Support various UUID formats that are available in `uuid::fmt` module (SeaQL/sea-orm#1325) * Casting columns as a different data type on select, insert and update (SeaQL/sea-orm#1304) * Methods of `ActiveModelBehavior` receive db connection as a parameter (SeaQL/sea-orm#1145, SeaQL/sea-orm#1328) * Added `execute_unprepared` method to `DatabaseConnection` and `DatabaseTransaction` (SeaQL/sea-orm#1327) * Added `Select::into_tuple` to select rows as tuples (instead of defining a custom Model) (SeaQL/sea-orm#1311) * Generate `#[serde(skip)]` for hidden columns (SeaQL/sea-orm#1171, SeaQL/sea-orm#1320) * Generate entity with extra derives and attributes for model struct (SeaQL/sea-orm#1124, SeaQL/sea-orm#1321) * Generate entity with extra derives and attributes for model struct (SeaQL/sea-orm#1124, SeaQL/sea-orm#1321) * async_trait * Migrations are now performed inside a transaction for Postgres (SeaQL/sea-orm#1379) * `MockDatabase::append_exec_results()`, `MockDatabase::append_query_results()`, `MockDatabase::append_exec_errors()` and `MockDatabase::append_query_errors()` take any types implemented `IntoIterator` trait (SeaQL/sea-orm#1367) * Cleanup the use of `vec!` macros * Added `DatabaseConnection::close` (SeaQL/sea-orm#1236) * Added `ActiveValue::reset` to convert `Unchanged` into `Set` (SeaQL/sea-orm#1177) * Added `QueryTrait::apply_if` to optionally apply a filter (SeaQL/sea-orm#1415) * Added the `sea-orm-internal` feature flag to expose some SQLx types (SeaQL/sea-orm#1297, SeaQL/sea-orm#1434) * Add `QuerySelect::columns` method - select multiple columns (SeaQL/sea-orm#1264) * Edit * Update SeaORM/docs/02-install-and-config/02-connection.md Co-authored-by: Chris Tsang <[email protected]> * Update SeaORM/docs/05-basic-crud/03-insert.md Co-authored-by: Chris Tsang <[email protected]> * fmt * Edit --------- Co-authored-by: Chris Tsang <[email protected]>
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.
PR Info
ActiveModelBehaviour's methods #1145New Features
before_save,after_save,before_deleteandafter_deletemethods ofActiveModelBehaviorreceive db connection as the parameterBreaking Changes
ActiveModelBehaviourtrait becomes async traitActiveModelBehaviourwith default implementation (no-op). No code changes is required.