fix(sql): bind `Value::Null` as `None`, fixes #11 (#278)

pull/281/head
Fabian-Lars 2 years ago committed by GitHub
parent 58defafd2a
commit c6502f673b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -210,7 +210,9 @@ async fn execute(
let db = instances.get_mut(&db).ok_or(Error::DatabaseNotLoaded(db))?;
let mut query = sqlx::query(&query);
for value in values {
if value.is_string() {
if value.is_null() {
query = query.bind(None::<JsonValue>);
} else if value.is_string() {
query = query.bind(value.as_str().unwrap().to_owned())
} else {
query = query.bind(value);

Loading…
Cancel
Save