bugfix: streamline and fix AnyQueryResult::last_insert_id() for SQLite#4205
Draft
migus-rs wants to merge 6 commits intolaunchbadge:mainfrom
Draft
bugfix: streamline and fix AnyQueryResult::last_insert_id() for SQLite#4205migus-rs wants to merge 6 commits intolaunchbadge:mainfrom
migus-rs wants to merge 6 commits intolaunchbadge:mainfrom
Conversation
…nt & robust - replaced custom map_result function with From<T> implementation
- replaced custom map_result function with From<T> implementation
…_insert_rowid - replaced custom map_result function with From<T> implementation - fixed bug causing AnyQueryResult.last_insert_id to always be None for Sqlite backend
- added test - updated required-features
- added test - updated required-features
- added test - updated required-features
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 is an alternative for #4178.
This patch series addresses the problem outlined in #2982 where
AnyQueryResult::last_insert_id()always returnsNonefor SQLite and PostgreSQL database backends.From<SqliteQueryResult>implementation for SQLite already has the correct behavior but is not used.PgQueryResultsources, the feature is not supported at all for PostreSQL, but there is also two redundant implementations.This PR therefore does the following things:
From<SqliteQueryResult>implementation and setlast_insert_idcorrectly.From<PgQueryResult>implementation.From<MySqlQueryResult>implementation.From<XQueryResult> for AnyQueryResultto the (appropriate)<db>/src/any.rsfiles together with the remainder ofAny-specific code.Does your PR solve an issue?
Fixes #2982
Is this a breaking change?
No, as I believe the current behavior to be incorrect (and inconsistent) which should be considered a bug.