Skip to content

Commit 8c89673

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents fa174eb + ddce689 commit 8c89673

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG.md
22

3+
## O.37.1
4+
- fixed decoding of UUID values
5+
36
## v0.37.0
47
- We now cryptographically sign the Windows app during releases, which proves the file hasn’t been tampered with. Once the production certificate is active, Windows will show a "verified publisher" and should stop showing screens saying "This app might harm your device", "Windows protected your PC" or "Are you sure you want to run this application ?".
58
- Thanks to https://signpath.io for providing us with a windows signing certificate !

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ panic = "abort"
2323
codegen-units = 2
2424

2525
[dependencies]
26-
sqlx = { package = "sqlx-oldapi", version = "0.6.47", default-features = false, features = [
26+
sqlx = { package = "sqlx-oldapi", version = "0.6.48", default-features = false, features = [
2727
"any",
2828
"runtime-tokio-rustls",
2929
"migrate",
@@ -33,6 +33,7 @@ sqlx = { package = "sqlx-oldapi", version = "0.6.47", default-features = false,
3333
"mssql",
3434
"chrono",
3535
"json",
36+
"uuid",
3637
] }
3738
chrono = "0.4.23"
3839
actix-web = { version = "4", features = ["rustls-0_23", "cookies"] }

src/webserver/database/sql_to_json.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ pub fn sql_nonnull_to_json<'r>(mut get_ref: impl FnMut() -> sqlx::any::AnyValueR
9696
"MONEY" | "SMALLMONEY" if matches!(db_type, Mssql(_)) => {
9797
decode_raw::<f64>(raw_value).into()
9898
}
99+
"UUID" | "UNIQUEIDENTIFIER" => decode_raw::<sqlx::types::uuid::Uuid>(raw_value)
100+
.to_string()
101+
.into(),
99102
"JSON" | "JSON[]" | "JSONB" | "JSONB[]" => decode_raw::<Value>(raw_value),
100103
"BLOB" | "BYTEA" | "FILESTREAM" | "VARBINARY" | "BIGVARBINARY" | "BINARY" | "IMAGE" => {
101104
blob_to_data_url::vec_to_data_uri_value(&decode_raw::<Vec<u8>>(raw_value))
@@ -194,7 +197,9 @@ mod tests {
194197
age('2024-03-14'::timestamp, '2024-01-01'::timestamp) as age_interval,
195198
justify_interval(interval '1 year 2 months 3 days') as justified_interval,
196199
1234.56::MONEY as money_val,
197-
'\\x68656c6c6f20776f726c64'::BYTEA as blob_data",
200+
'\\x68656c6c6f20776f726c64'::BYTEA as blob_data,
201+
'550e8400-e29b-41d4-a716-446655440000'::UUID as uuid
202+
",
198203
)
199204
.fetch_one(&mut c)
200205
.await?;
@@ -220,7 +225,8 @@ mod tests {
220225
"age_interval": "2 mons 13 days",
221226
"justified_interval": "1 year 2 mons 3 days",
222227
"money_val": "$1,234.56",
223-
"blob_data": "data:application/octet-stream;base64,aGVsbG8gd29ybGQ="
228+
"blob_data": "data:application/octet-stream;base64,aGVsbG8gd29ybGQ=",
229+
"uuid": "550e8400-e29b-41d4-a716-446655440000"
224230
}),
225231
);
226232
Ok(())
@@ -242,7 +248,8 @@ mod tests {
242248
INTERVAL '-01:02:03' as time_interval,
243249
'{\"key\": \"value\"}'::JSON as json,
244250
1234.56::MONEY as money_val,
245-
'\\x74657374'::BYTEA as blob_data
251+
'\\x74657374'::BYTEA as blob_data,
252+
'550e8400-e29b-41d4-a716-446655440000'::UUID as uuid
246253
where $1",
247254
)
248255
.bind(true)
@@ -258,7 +265,8 @@ mod tests {
258265
"time_interval": "-01:02:03",
259266
"json": {"key": "value"},
260267
"money_val": "", // TODO: fix this bug: https://github.com/sqlpage/SQLPage/issues/983
261-
"blob_data": "data:application/octet-stream;base64,dGVzdA=="
268+
"blob_data": "data:application/octet-stream;base64,dGVzdA==",
269+
"uuid": "550e8400-e29b-41d4-a716-446655440000",
262270
}),
263271
);
264272
Ok(())
@@ -419,7 +427,9 @@ mod tests {
419427
'ASCII String' as varchar,
420428
CAST(1234.56 AS MONEY) as money_val,
421429
CAST(12.34 AS SMALLMONEY) as small_money_val,
422-
CAST(0x6D7373716C AS VARBINARY(10)) as blob_data",
430+
CAST(0x6D7373716C AS VARBINARY(10)) as blob_data,
431+
CONVERT(UNIQUEIDENTIFIER, '6F9619FF-8B86-D011-B42D-00C04FC964FF') as unique_identifier
432+
"
423433
)
424434
.fetch_one(&mut c)
425435
.await?;
@@ -446,7 +456,8 @@ mod tests {
446456
"varchar": "ASCII String",
447457
"money_val": 1234.56,
448458
"small_money_val": 12.34,
449-
"blob_data": "data:application/octet-stream;base64,bXNzcWw="
459+
"blob_data": "data:application/octet-stream;base64,bXNzcWw=",
460+
"unique_identifier": "6f9619ff-8b86-d011-b42d-00c04fc964ff"
450461
}),
451462
);
452463
Ok(())

0 commit comments

Comments
 (0)