From 23ee592daef8cbe1f0a8bf1a25e525ddb3fd2f29 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Tue, 10 Jan 2023 15:29:02 +0800 Subject: [PATCH] Changelog --- CHANGELOG.md | 8 ++++++++ src/executor/query.rs | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b91300652..a0a753156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * Execute unprepared statements https://github.com/SeaQL/sea-orm/pull/1327 * Added `DatabaseConnection::execute_unprepared` method https://github.com/SeaQL/sea-orm/pull/1327 * Added `DatabaseTransaction::execute_unprepared` method https://github.com/SeaQL/sea-orm/pull/1327 +* Added `Select::into_tuple` to select rows as tuples instead of having to define a custom Model https://github.com/SeaQL/sea-orm/pull/1311 ### Enhancements @@ -46,6 +47,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Breaking changes * Added `ConnectionTrait::execute_unprepared` method https://github.com/SeaQL/sea-orm/pull/1327 +* As part of https://github.com/SeaQL/sea-orm/pull/1311, the required method of `TryGetable` changed: +```rust +// then +fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result; +// now; ColIdx can be `&str` or `usize` +fn try_get_by(res: &QueryResult, index: I) -> Result; +``` ## 0.10.6 - 2022-12-23 diff --git a/src/executor/query.rs b/src/executor/query.rs index c5e20513a..00fb8cd49 100644 --- a/src/executor/query.rs +++ b/src/executor/query.rs @@ -133,26 +133,26 @@ impl TryGetable for Option { } } -/// Column Index, used by [`TryGetable`] +/// Column Index, used by [`TryGetable`]. Implemented for `&str` and `usize` pub trait ColIdx: std::fmt::Debug + Copy { #[cfg(feature = "sqlx-mysql")] - /// Type shenanigans + /// Type surrogate type SqlxMySqlIndex: sqlx::ColumnIndex; #[cfg(feature = "sqlx-postgres")] - /// Type shenanigans + /// Type surrogate type SqlxPostgresIndex: sqlx::ColumnIndex; #[cfg(feature = "sqlx-sqlite")] - /// Type shenanigans + /// Type surrogate type SqlxSqliteIndex: sqlx::ColumnIndex; #[cfg(feature = "sqlx-mysql")] - /// Basically a no-op; only to satisfy a trait bound + /// Basically a no-op; only to satisfy trait bounds fn as_sqlx_mysql_index(&self) -> Self::SqlxMySqlIndex; #[cfg(feature = "sqlx-postgres")] - /// Basically a no-op; only to satisfy a trait bound + /// Basically a no-op; only to satisfy trait bounds fn as_sqlx_postgres_index(&self) -> Self::SqlxPostgresIndex; #[cfg(feature = "sqlx-sqlite")] - /// Basically a no-op; only to satisfy a trait bound + /// Basically a no-op; only to satisfy trait bounds fn as_sqlx_sqlite_index(&self) -> Self::SqlxSqliteIndex; /// Self must be `&str`, return `None` otherwise