fix in mysql
This commit is contained in:
@@ -7,14 +7,15 @@ use chrono::{DateTime, NaiveDateTime, Utc};
|
||||
use rand_core::{OsRng, RngCore};
|
||||
use serde::Serialize;
|
||||
use sqlx::FromRow;
|
||||
use sqlx::{Any, AnyRow, Row, Transaction};
|
||||
|
||||
use sqlx::{Any, Row, Transaction, any::AnyRow};
|
||||
|
||||
fn any_text(row: &AnyRow, column: &str) -> Result<String, sqlx::Error> {
|
||||
match row.try_get::<String, _>(column) {
|
||||
Ok(value) => Ok(value),
|
||||
Err(string_error) => match row.try_get::<Vec<u8>, _>(column) {
|
||||
Ok(value) => String::from_utf8(value).map_err(|error| sqlx::Error::Decode(Box::new(error))),
|
||||
Ok(value) => {
|
||||
String::from_utf8(value).map_err(|error| sqlx::Error::Decode(Box::new(error)))
|
||||
}
|
||||
Err(_) => Err(string_error),
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user