chore: Merge branch v1 into v2 (#702)

This commit is contained in:
Fabian-Lars
2023-11-14 01:50:13 +01:00
committed by GitHub
parent d4d1633c4d
commit 251852ccbc
42 changed files with 1663 additions and 5522 deletions
+4 -4
View File
@@ -19,11 +19,11 @@ tauri = { workspace = true }
log = { workspace = true }
thiserror = { workspace = true }
futures-core = "0.3"
sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "json", "time" ] }
sqlx = { version = "0.7", features = ["json", "time"] }
time = "0.3"
tokio = { version = "1", features = [ "sync" ] }
[features]
sqlite = [ "sqlx/sqlite" ]
mysql = [ "sqlx/mysql" ]
postgres = [ "sqlx/postgres" ]
sqlite = ["sqlx/sqlite", "sqlx/runtime-tokio"]
mysql = ["sqlx/mysql", "sqlx/runtime-tokio-rustls"]
postgres = ["sqlx/postgres", "sqlx/runtime-tokio-rustls"]
-1
View File
@@ -114,7 +114,6 @@ export default class Database {
values: bindValues ?? [],
},
);
return {
lastInsertId,
rowsAffected,
+1 -1
View File
@@ -25,7 +25,7 @@
"LICENSE"
],
"devDependencies": {
"tslib": "2.6.0"
"tslib": "2.6.2"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.11"
+8 -1
View File
@@ -21,7 +21,14 @@ pub(crate) fn to_json(v: MySqlValueRef) -> Result<JsonValue, Error> {
JsonValue::Null
}
}
"FLOAT" | "DOUBLE" => {
"FLOAT" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<f32>() {
JsonValue::from(v)
} else {
JsonValue::Null
}
}
"DOUBLE" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<f64>() {
JsonValue::from(v)
} else {
+23 -2
View File
@@ -21,14 +21,35 @@ pub(crate) fn to_json(v: PgValueRef) -> Result<JsonValue, Error> {
JsonValue::Null
}
}
"FLOAT4" | "FLOAT8" => {
"FLOAT4" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<f32>() {
JsonValue::from(v)
} else {
JsonValue::Null
}
}
"FLOAT8" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<f64>() {
JsonValue::from(v)
} else {
JsonValue::Null
}
}
"INT2" | "INT4" | "INT8" => {
"INT2" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<i16>() {
JsonValue::Number(v.into())
} else {
JsonValue::Null
}
}
"INT4" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<i32>() {
JsonValue::Number(v.into())
} else {
JsonValue::Null
}
}
"INT8" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<i64>() {
JsonValue::Number(v.into())
} else {