Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable sqlite returning with feature flag #2070

Merged
merged 6 commits into from
Jan 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
tyt2y3 authored Jan 24, 2024
commit ebdc8ddc40247740ea1e9c04d98958fcc0aaeb38
6 changes: 3 additions & 3 deletions src/driver/sqlx_sqlite.rs
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ impl SqlxSqliteConnector {
#[cfg(feature = "returning_clauses_for_sqlite_3_35")]
{
let version = get_version(&pool).await?;
enure_returning_version(&version)?;
ensure_returning_version(&version)?;
}

Ok(DatabaseConnection::SqlxSqlitePoolConnection(pool))
@@ -294,7 +294,7 @@ async fn get_version(conn: &SqlxSqlitePoolConnection) -> Result<String, DbErr> {
.try_get_by(0)
}

fn enure_returning_version(version: &str) -> Result<(), DbErr> {
fn ensure_returning_version(version: &str) -> Result<(), DbErr> {
let mut parts = version.trim().split(".").map(|part| {
part.parse::<u32>().map_err(|_| {
DbErr::Conn(RuntimeErr::Internal(
@@ -318,7 +318,7 @@ fn enure_returning_version(version: &str) -> Result<(), DbErr> {
Ok(())
} else {
Err(DbErr::Conn(RuntimeErr::Internal(
"SQLite library does not support returning".to_string(),
"SQLite version does not support returning".to_string(),
)))
}
}