Skip to content

Commit b1aade5

Browse files
committed
database driver updates
1 parent 006cc86 commit b1aade5

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

Diff for: .env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Set COMPOSE_PROFILES to one of the following: postgres, mysql, mssql. If set to mssql, you will need to change the depends_on propery in docker-compose.yml
2-
COMPOSE_PROFILES=mysql
2+
COMPOSE_PROFILES=postgres

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## unreleased (0.9.5)
44

55
- New `tab` component to create tabbed interfaces. See [the documentation](https://sql.ophir.dev/documentation.sql?component=tab#component).
6+
- Many improvements in database drivers.
7+
- performance and numeric precision improvements,
8+
- multiple fixes around passing NUMERIC, DECIMAL, and JSON values to SQLPage.
69

710
## 0.9.4 (2023-08-04)
811

Diff for: Cargo.lock

+19-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ panic = "abort"
1717
codegen-units = 2
1818

1919
[dependencies]
20-
sqlx = { package = "sqlx-oldapi", version = "0.6.9", features = ["any", "runtime-actix-rustls", "sqlite", "postgres", "mysql", "mssql", "chrono"] }
20+
sqlx = { package = "sqlx-oldapi", version = "0.6.10", features = ["any", "runtime-actix-rustls", "sqlite", "postgres", "mysql", "mssql", "chrono", "json" ] }
2121
chrono = "0.4.23"
2222
actix-web = { version = "4", features = ["rustls", "cookies"] }
2323
percent-encoding = "2.2.0"

Diff for: src/webserver/database/sql_to_json.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,13 @@ pub fn sql_nonnull_to_json<'r>(mut get_ref: impl FnMut() -> sqlx::any::AnyValueR
8484
try_decode_with!(
8585
get_ref(),
8686
[chrono::NaiveDateTime, chrono::DateTime<chrono::Utc>],
87-
|v| dbg!(v).to_string()
87+
|v| v.to_string()
8888
)
8989
.unwrap_or_else(|e| format!("Unable to decode date: {e:?}"))
9090
.into()
9191
}
9292
"JSON" | "JSON[]" | "JSONB" | "JSONB[]" => {
93-
<&[u8] as Decode<sqlx::any::Any>>::decode(raw_value)
94-
.and_then(|rv| {
95-
serde_json::from_slice::<Value>(rv)
96-
.map_err(|e| Box::new(e) as Box<dyn std::error::Error + Sync + Send>)
97-
})
93+
<Value as Decode<sqlx::any::Any>>::decode(raw_value)
9894
.unwrap_or_default()
9995
}
10096
// Deserialize as a string by default

0 commit comments

Comments
 (0)