diff --git a/Cargo.lock b/Cargo.lock index c669dc527..2579e3a8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -387,7 +387,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] @@ -788,7 +788,7 @@ version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.80", @@ -1322,12 +1322,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.3.1" @@ -1345,7 +1339,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.1", + "event-listener", "pin-project-lite", ] @@ -1754,22 +1748,13 @@ checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "hashlink" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.5.0" @@ -2326,9 +2311,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" dependencies = [ "cc", "pkg-config", @@ -2597,7 +2582,7 @@ dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "event-listener 5.3.1", + "event-listener", "futures-util", "once_cell", "parking_lot", @@ -3659,9 +3644,9 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78046161564f5e7cd9008aff3b2990b3850dc8e0349119b98e8f251e099f24d" +checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" dependencies = [ "bitflags 2.6.0", "fallible-iterator 0.3.0", @@ -4067,6 +4052,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -4149,9 +4137,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" +checksum = "27144619c6e5802f1380337a209d2ac1c431002dd74c6e60aebff3c506dc4f0c" dependencies = [ "sqlx-core", "sqlx-macros", @@ -4162,23 +4150,23 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" +checksum = "a999083c1af5b5d6c071d34a708a19ba3e02106ad82ef7bbd69f5e48266b613b" dependencies = [ - "ahash", "atoi", "byteorder", "bytes", "crc", "crossbeam-queue", "either", - "event-listener 2.5.3", + "event-listener", "futures-channel", "futures-core", "futures-intrusive", "futures-io", "futures-util", + "hashbrown 0.14.5", "hashlink", "hex", "indexmap 2.6.0", @@ -4201,26 +4189,26 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" +checksum = "a23217eb7d86c584b8cbe0337b9eacf12ab76fe7673c513141ec42565698bb88" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] name = "sqlx-macros-core" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" +checksum = "1a099220ae541c5db479c6424bdf1b200987934033c2584f79a0e1693601e776" dependencies = [ "dotenvy", "either", - "heck 0.4.1", + "heck", "hex", "once_cell", "proc-macro2", @@ -4230,8 +4218,9 @@ dependencies = [ "sha2", "sqlx-core", "sqlx-mysql", + "sqlx-postgres", "sqlx-sqlite", - "syn 1.0.109", + "syn 2.0.79", "tempfile", "tokio", "url", @@ -4239,12 +4228,12 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" +checksum = "5afe4c38a9b417b6a9a5eeffe7235d0a106716495536e7727d1c7f4b1ff3eba6" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", "bitflags 2.6.0", "byteorder", "bytes", @@ -4281,12 +4270,12 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" +checksum = "b1dbb157e65f10dbe01f729339c06d239120221c9ad9fa0ba8408c4cc18ecf21" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", "bitflags 2.6.0", "byteorder", "crc", @@ -4319,9 +4308,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" +checksum = "9b2cdd83c008a622d94499c0006d8ee5f821f36c89b7d625c900e5dc30b5c5ee" dependencies = [ "atoi", "flume", @@ -4334,10 +4323,10 @@ dependencies = [ "log", "percent-encoding", "serde", + "serde_urlencoded", "sqlx-core", "tracing", "url", - "urlencoding", ] [[package]] @@ -4966,12 +4955,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "usvg" version = "0.36.0" diff --git a/Cargo.toml b/Cargo.toml index 8ed9582af..1b51f5567 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,7 +80,7 @@ size_format = "1.0.2" spreet = { version = "0.11", default-features = false } sqlite-compressions = { version = "0.2.15", default-features = false, features = ["bsdiffraw", "gzip"] } sqlite-hashes = { version = "0.7.6", default-features = false, features = ["md5", "aggregate", "hex"] } -sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] } +sqlx = { version = "0.8", features = ["sqlite", "runtime-tokio"] } static-files = "0.2" subst = { version = "0.3", features = ["yaml"] } thiserror = "1" diff --git a/justfile b/justfile index 8784f757e..a1d0fc3b8 100644 --- a/justfile +++ b/justfile @@ -62,6 +62,11 @@ clean-martin-ui: clean-test: rm -rf tests/output +# Update dependencies, including breaking changes +update: + cargo +nightly -Z unstable-options update --breaking + cargo update + # Start a test database start: (docker-up "db") docker-is-ready diff --git a/mbtiles/.sqlx/query-176e99c6945b0789119d0d21a99de564de47dde1d588f17e68ec58115ac73a39.json b/mbtiles/.sqlx/query-176e99c6945b0789119d0d21a99de564de47dde1d588f17e68ec58115ac73a39.json index 25354e993..8e6f5e748 100644 --- a/mbtiles/.sqlx/query-176e99c6945b0789119d0d21a99de564de47dde1d588f17e68ec58115ac73a39.json +++ b/mbtiles/.sqlx/query-176e99c6945b0789119d0d21a99de564de47dde1d588f17e68ec58115ac73a39.json @@ -6,7 +6,7 @@ { "name": "has_rows", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { diff --git a/mbtiles/.sqlx/query-208681caa7185b4014e7eda4120962954cdd3d913e8a786599da8a3f9799ed4b.json b/mbtiles/.sqlx/query-208681caa7185b4014e7eda4120962954cdd3d913e8a786599da8a3f9799ed4b.json index 3550f54e0..7995f68d1 100644 --- a/mbtiles/.sqlx/query-208681caa7185b4014e7eda4120962954cdd3d913e8a786599da8a3f9799ed4b.json +++ b/mbtiles/.sqlx/query-208681caa7185b4014e7eda4120962954cdd3d913e8a786599da8a3f9799ed4b.json @@ -6,7 +6,7 @@ { "name": "page_size", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { diff --git a/mbtiles/.sqlx/query-41798c456136acb48ce59769a8abd1c6fb638f84d35457093b5dfbb3c8005433.json b/mbtiles/.sqlx/query-41798c456136acb48ce59769a8abd1c6fb638f84d35457093b5dfbb3c8005433.json index b389139d1..52857b067 100644 --- a/mbtiles/.sqlx/query-41798c456136acb48ce59769a8abd1c6fb638f84d35457093b5dfbb3c8005433.json +++ b/mbtiles/.sqlx/query-41798c456136acb48ce59769a8abd1c6fb638f84d35457093b5dfbb3c8005433.json @@ -6,22 +6,22 @@ { "name": "zoom", "ordinal": 0, - "type_info": "Int64" + "type_info": "Integer" }, { "name": "count", "ordinal": 1, - "type_info": "Int" + "type_info": "Integer" }, { "name": "smallest", "ordinal": 2, - "type_info": "Int" + "type_info": "Integer" }, { "name": "largest", "ordinal": 3, - "type_info": "Int" + "type_info": "Integer" }, { "name": "average", @@ -31,22 +31,22 @@ { "name": "min_tile_x", "ordinal": 5, - "type_info": "Int" + "type_info": "Integer" }, { "name": "min_tile_y", "ordinal": 6, - "type_info": "Int" + "type_info": "Integer" }, { "name": "max_tile_x", "ordinal": 7, - "type_info": "Int" + "type_info": "Integer" }, { "name": "max_tile_y", "ordinal": 8, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { diff --git a/mbtiles/.sqlx/query-5b298df51dccbf0d8a22433a99febc59c27dbf204d09a9c1fb0b3bf9aaad284b.json b/mbtiles/.sqlx/query-5b298df51dccbf0d8a22433a99febc59c27dbf204d09a9c1fb0b3bf9aaad284b.json index b73b48bb2..60ca153c9 100644 --- a/mbtiles/.sqlx/query-5b298df51dccbf0d8a22433a99febc59c27dbf204d09a9c1fb0b3bf9aaad284b.json +++ b/mbtiles/.sqlx/query-5b298df51dccbf0d8a22433a99febc59c27dbf204d09a9c1fb0b3bf9aaad284b.json @@ -6,12 +6,12 @@ { "name": "tile_column", "ordinal": 0, - "type_info": "Int64" + "type_info": "Integer" }, { "name": "tile_row", "ordinal": 1, - "type_info": "Int64" + "type_info": "Integer" }, { "name": "tile_data", diff --git a/mbtiles/.sqlx/query-7341bfc10beb4719811556a57ae8098085994c8fba93e0293359afd43079c50c.json b/mbtiles/.sqlx/query-7341bfc10beb4719811556a57ae8098085994c8fba93e0293359afd43079c50c.json index 2b9d7474d..df630d0b5 100644 --- a/mbtiles/.sqlx/query-7341bfc10beb4719811556a57ae8098085994c8fba93e0293359afd43079c50c.json +++ b/mbtiles/.sqlx/query-7341bfc10beb4719811556a57ae8098085994c8fba93e0293359afd43079c50c.json @@ -6,14 +6,14 @@ { "name": "is_valid", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { "Right": 0 }, "nullable": [ - null + false ] }, "hash": "7341bfc10beb4719811556a57ae8098085994c8fba93e0293359afd43079c50c" diff --git a/mbtiles/.sqlx/query-73b5d12b379c0fb2d8560d99653729d96dd1288005f47872c6a79b5bbf1ca8de.json b/mbtiles/.sqlx/query-73b5d12b379c0fb2d8560d99653729d96dd1288005f47872c6a79b5bbf1ca8de.json index e72960107..c73c455e9 100644 --- a/mbtiles/.sqlx/query-73b5d12b379c0fb2d8560d99653729d96dd1288005f47872c6a79b5bbf1ca8de.json +++ b/mbtiles/.sqlx/query-73b5d12b379c0fb2d8560d99653729d96dd1288005f47872c6a79b5bbf1ca8de.json @@ -6,7 +6,7 @@ { "name": "page_count", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { diff --git a/mbtiles/.sqlx/query-748436831449877b242d6e167a2f8fe1b1e7b6fb87c4e04ad7406a2bbfd35bec.json b/mbtiles/.sqlx/query-748436831449877b242d6e167a2f8fe1b1e7b6fb87c4e04ad7406a2bbfd35bec.json index ad0518d11..6f43f10c8 100644 --- a/mbtiles/.sqlx/query-748436831449877b242d6e167a2f8fe1b1e7b6fb87c4e04ad7406a2bbfd35bec.json +++ b/mbtiles/.sqlx/query-748436831449877b242d6e167a2f8fe1b1e7b6fb87c4e04ad7406a2bbfd35bec.json @@ -6,17 +6,17 @@ { "name": "zoom_level", "ordinal": 0, - "type_info": "Int64" + "type_info": "Integer" }, { "name": "tile_column", "ordinal": 1, - "type_info": "Int64" + "type_info": "Integer" }, { "name": "tile_row", "ordinal": 2, - "type_info": "Int64" + "type_info": "Integer" }, { "name": "tile_data", diff --git a/mbtiles/.sqlx/query-77b2f46851c4e991230ec6a5d33aaca18373bbdd548a8378ae7fbeed351b4b87.json b/mbtiles/.sqlx/query-77b2f46851c4e991230ec6a5d33aaca18373bbdd548a8378ae7fbeed351b4b87.json index acb0b2ecc..677e780d8 100644 --- a/mbtiles/.sqlx/query-77b2f46851c4e991230ec6a5d33aaca18373bbdd548a8378ae7fbeed351b4b87.json +++ b/mbtiles/.sqlx/query-77b2f46851c4e991230ec6a5d33aaca18373bbdd548a8378ae7fbeed351b4b87.json @@ -6,14 +6,14 @@ { "name": "is_valid", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { "Right": 0 }, "nullable": [ - null + false ] }, "hash": "77b2f46851c4e991230ec6a5d33aaca18373bbdd548a8378ae7fbeed351b4b87" diff --git a/mbtiles/.sqlx/query-809e89c3b223e28c6716d405e13ba30fbf018805fe9ca2acd2b2e225183d1f13.json b/mbtiles/.sqlx/query-809e89c3b223e28c6716d405e13ba30fbf018805fe9ca2acd2b2e225183d1f13.json index faf6b51f7..e8a351f93 100644 --- a/mbtiles/.sqlx/query-809e89c3b223e28c6716d405e13ba30fbf018805fe9ca2acd2b2e225183d1f13.json +++ b/mbtiles/.sqlx/query-809e89c3b223e28c6716d405e13ba30fbf018805fe9ca2acd2b2e225183d1f13.json @@ -6,14 +6,14 @@ { "name": "is_valid", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { "Right": 0 }, "nullable": [ - null + false ] }, "hash": "809e89c3b223e28c6716d405e13ba30fbf018805fe9ca2acd2b2e225183d1f13" diff --git a/mbtiles/.sqlx/query-85b46712c445679053e768cc98b22ea61633c21afb45d3d2b9aeec068d72cce0.json b/mbtiles/.sqlx/query-85b46712c445679053e768cc98b22ea61633c21afb45d3d2b9aeec068d72cce0.json index 45fdc4f2a..ab4bd17ba 100644 --- a/mbtiles/.sqlx/query-85b46712c445679053e768cc98b22ea61633c21afb45d3d2b9aeec068d72cce0.json +++ b/mbtiles/.sqlx/query-85b46712c445679053e768cc98b22ea61633c21afb45d3d2b9aeec068d72cce0.json @@ -6,14 +6,14 @@ { "name": "is_valid", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { "Right": 0 }, "nullable": [ - null + false ] }, "hash": "85b46712c445679053e768cc98b22ea61633c21afb45d3d2b9aeec068d72cce0" diff --git a/mbtiles/.sqlx/query-96f3201d2151fbef63593c0e87648a2991e05060e71aa96141ece0867afa2d6c.json b/mbtiles/.sqlx/query-96f3201d2151fbef63593c0e87648a2991e05060e71aa96141ece0867afa2d6c.json index 855a012f9..7d5f576d6 100644 --- a/mbtiles/.sqlx/query-96f3201d2151fbef63593c0e87648a2991e05060e71aa96141ece0867afa2d6c.json +++ b/mbtiles/.sqlx/query-96f3201d2151fbef63593c0e87648a2991e05060e71aa96141ece0867afa2d6c.json @@ -6,12 +6,12 @@ { "name": "min_zoom", "ordinal": 0, - "type_info": "Int" + "type_info": "Integer" }, { "name": "max_zoom", "ordinal": 1, - "type_info": "Int" + "type_info": "Integer" } ], "parameters": { diff --git a/mbtiles/src/queries.rs b/mbtiles/src/queries.rs index 427ccc1d3..bdac8b541 100644 --- a/mbtiles/src/queries.rs +++ b/mbtiles/src/queries.rs @@ -61,12 +61,7 @@ where ) AS is_valid;" ); - Ok(sql - .fetch_one(&mut *conn) - .await? - .is_valid - .unwrap_or_default() - == 1) + Ok(sql.fetch_one(&mut *conn).await?.is_valid == 1) } /// Check if `MBTiles` has a table or a view named `tiles_with_hash` with needed fields @@ -90,12 +85,7 @@ where ) as is_valid;" ); - Ok(sql - .fetch_one(&mut *conn) - .await? - .is_valid - .unwrap_or_default() - == 1) + Ok(sql.fetch_one(&mut *conn).await?.is_valid == 1) } pub async fn is_flat_with_hash_tables_type(conn: &mut T) -> MbtResult @@ -115,7 +105,7 @@ where let is_valid = sql.fetch_one(&mut *conn).await?.is_valid; - Ok(is_valid.unwrap_or_default() == 1 && has_tiles_with_hash(&mut *conn).await?) + Ok(is_valid == 1 && has_tiles_with_hash(&mut *conn).await?) } pub async fn is_flat_tables_type(conn: &mut T) -> MbtResult @@ -144,12 +134,7 @@ where ) as is_valid;" ); - Ok(sql - .fetch_one(&mut *conn) - .await? - .is_valid - .unwrap_or_default() - == 1) + Ok(sql.fetch_one(&mut *conn).await?.is_valid == 1) } pub async fn create_metadata_table(conn: &mut T) -> MbtResult<()> @@ -409,8 +394,10 @@ FROM tiles;" .fetch_one(conn) .await?; - let min_zoom = validate_zoom(info.min_zoom, "zoom_level")?; - let max_zoom = validate_zoom(info.max_zoom, "zoom_level")?; + #[allow(clippy::cast_possible_truncation)] + let min_zoom = validate_zoom(info.min_zoom.map(|v| v as i32), "zoom_level")?; + #[allow(clippy::cast_possible_truncation)] + let max_zoom = validate_zoom(info.max_zoom.map(|v| v as i32), "zoom_level")?; match (min_zoom, max_zoom) { (Some(min_zoom), Some(max_zoom)) => Ok(Some((min_zoom, max_zoom))),