mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-25 11:46:06 +02:00
chore: Merge branch v1 into v2 (#702)
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -114,7 +114,6 @@ export default class Database {
|
||||
values: bindValues ?? [],
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
lastInsertId,
|
||||
rowsAffected,
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"devDependencies": {
|
||||
"tslib": "2.6.0"
|
||||
"tslib": "2.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.11"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user