refactor: rename oracle-rs to rust-oracle and unify to git source

This commit is contained in:
t8y2
2026-05-07 15:41:39 +08:00
parent 84cc42a0d4
commit 0f904fc2a8
4 changed files with 118 additions and 175 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ tiberius = { version = "0.12.3", default-features = false, features = ["tds73",
reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls"] }
futures = "0.3"
mongodb = "3.2.5"
oracle-rs = { git = "https://github.com/t8y2/rust-oracle", branch = "main" }
rust-oracle = { git = "https://github.com/t8y2/rust-oracle", branch = "main" }
russh = "0.60"
portpicker = "0.1.1"
csv = "1"
+8 -8
View File
@@ -1,5 +1,5 @@
use log;
use oracle_rs::{Config, Connection};
use rust_oracle::{Config, Connection};
use std::time::Instant;
use super::{connection_timeout, CONNECTION_TIMEOUT_SECS};
@@ -23,16 +23,16 @@ pub async fn connect(
.map_err(|e| format!("Oracle connection failed: {e}"))
}
fn value_to_json(val: &oracle_rs::Value) -> serde_json::Value {
fn value_to_json(val: &rust_oracle::Value) -> serde_json::Value {
match val {
oracle_rs::Value::Null => serde_json::Value::Null,
oracle_rs::Value::String(s) => serde_json::Value::String(s.clone()),
oracle_rs::Value::Integer(n) => serde_json::Value::Number((*n).into()),
oracle_rs::Value::Float(f) => {
rust_oracle::Value::Null => serde_json::Value::Null,
rust_oracle::Value::String(s) => serde_json::Value::String(s.clone()),
rust_oracle::Value::Integer(n) => serde_json::Value::Number((*n).into()),
rust_oracle::Value::Float(f) => {
serde_json::Number::from_f64(*f).map(serde_json::Value::Number).unwrap_or(serde_json::Value::Null)
}
oracle_rs::Value::Boolean(b) => serde_json::Value::Bool(*b),
oracle_rs::Value::Json(v) => v.clone(),
rust_oracle::Value::Boolean(b) => serde_json::Value::Bool(*b),
rust_oracle::Value::Json(v) => v.clone(),
_ => serde_json::Value::String(format!("{val:?}")),
}
}