Changelog

This commit is contained in:
Chris Tsang 2023-01-10 15:29:02 +08:00
parent 4210526ec1
commit 23ee592dae
2 changed files with 15 additions and 7 deletions

View File

@ -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<Self, TryGetError>;
// now; ColIdx can be `&str` or `usize`
fn try_get_by<I: ColIdx>(res: &QueryResult, index: I) -> Result<Self, TryGetError>;
```
## 0.10.6 - 2022-12-23

View File

@ -133,26 +133,26 @@ impl<T: TryGetable> TryGetable for Option<T> {
}
}
/// 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<sqlx::mysql::MySqlRow>;
#[cfg(feature = "sqlx-postgres")]
/// Type shenanigans
/// Type surrogate
type SqlxPostgresIndex: sqlx::ColumnIndex<sqlx::postgres::PgRow>;
#[cfg(feature = "sqlx-sqlite")]
/// Type shenanigans
/// Type surrogate
type SqlxSqliteIndex: sqlx::ColumnIndex<sqlx::sqlite::SqliteRow>;
#[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