Upgrade sqlx 0.8

This commit is contained in:
cosmod 2024-07-23 15:42:33 +08:00
parent 919142e13e
commit 776775911e
20 changed files with 82 additions and 82 deletions

View File

@ -1,7 +1,7 @@
[package]
name = "actix-app"
description = "An example for actix-web integration."
version = "0.8.0"
version = "0.8.1"
rust-version = "1.75"
edition = "2021"
publish = false
@ -19,7 +19,7 @@ features = ["derive"]
[dependencies.zino]
path = "../../zino"
version = "0.23.3"
version = "0.24.0"
features = [
"actix",
"i18n",
@ -30,7 +30,7 @@ features = [
[dependencies.zino-core]
path = "../../zino-core"
version = "0.24.3"
version = "0.25.0"
features = [
"cookie",
"env-filter",
@ -40,8 +40,8 @@ features = [
[dependencies.zino-derive]
path = "../../zino-derive"
version = "0.21.3"
version = "0.22.0"
[dependencies.zino-model]
path = "../../zino-model"
version = "0.21.3"
version = "0.22.0"

View File

@ -1,7 +1,7 @@
[package]
name = "axum-app"
description = "An example for axum integration."
version = "0.14.0"
version = "0.14.1"
rust-version = "1.75"
edition = "2021"
publish = false
@ -19,7 +19,7 @@ features = ["derive"]
[dependencies.zino]
path = "../../zino"
version = "0.23.3"
version = "0.24.0"
features = [
"axum",
"i18n",
@ -29,7 +29,7 @@ features = [
[dependencies.zino-core]
path = "../../zino-core"
version = "0.24.3"
version = "0.25.0"
features = [
"cookie",
"env-filter",
@ -40,8 +40,8 @@ features = [
[dependencies.zino-derive]
path = "../../zino-derive"
version = "0.21.3"
version = "0.22.0"
[dependencies.zino-model]
path = "../../zino-model"
version = "0.21.3"
version = "0.22.0"

View File

@ -1,14 +1,14 @@
[package]
name = "dioxus-desktop"
description = "An example for Dioxus desktop integration."
version = "0.5.2"
version = "0.5.3"
rust-version = "1.75"
edition = "2021"
publish = false
[dependencies]
dioxus = "0.5.1"
dioxus-router = "0.5.0"
dioxus = "0.5.6"
dioxus-router = "0.5.6"
tracing = "0.1.40"
[dependencies.dioxus-free-icons]
@ -22,14 +22,14 @@ features = [
[dependencies.zino]
path = "../../zino"
version = "0.23.3"
version = "0.24.0"
features = ["dioxus-desktop"]
[dependencies.zino-core]
path = "../../zino-core"
version = "0.24.3"
version = "0.25.0"
features = ["env-filter", "tls-native"]
[dependencies.zino-dioxus]
path = "../../zino-dioxus"
version = "0.6.6"
version = "0.7.0"

View File

@ -1,14 +1,14 @@
[package]
name = "dioxus-ssr"
description = "An example for Dioxus SSR integration."
version = "0.1.0"
version = "0.1.1"
rust-version = "1.75"
edition = "2021"
publish = false
[dependencies]
dioxus = "0.5.1"
dioxus-router = "0.5.0"
dioxus = "0.5.6"
dioxus-router = "0.5.6"
tracing = "0.1.40"
[dependencies.dioxus-free-icons]
@ -22,14 +22,14 @@ features = [
[dependencies.zino]
path = "../../zino"
version = "0.23.3"
version = "0.24.0"
features = ["dioxus-ssr"]
[dependencies.zino-core]
path = "../../zino-core"
version = "0.24.3"
version = "0.25.0"
features = ["env-filter", "tls-native"]
[dependencies.zino-dioxus]
path = "../../zino-dioxus"
version = "0.6.6"
version = "0.7.0"

View File

@ -10,9 +10,9 @@ pub enum Route {
#[layout(Wrapper)]
#[route("/")]
Overview {},
#[route("/#stargazers")]
#[route("/stargazers")]
StargazerList {},
#[route("/#dependencies")]
#[route("/dependencies")]
DependencyList {},
#[end_layout]
#[route("/:..segments")]

View File

@ -1,13 +1,13 @@
[package]
name = "minimal-app"
description = "A minimal example to run a server."
version = "0.3.0"
version = "0.3.1"
rust-version = "1.75"
edition = "2021"
publish = false
[dependencies.zino]
path = "../../zino"
version = "0.23.3"
version = "0.24.0"
features = ["axum"]

View File

@ -1,7 +1,7 @@
[package]
name = "ntex-app"
description = "An example for ntex integration."
version = "0.2.2"
version = "0.2.3"
rust-version = "1.76"
edition = "2021"
publish = false
@ -19,7 +19,7 @@ features = ["derive"]
[dependencies.zino]
path = "../../zino"
version = "0.23.3"
version = "0.24.0"
features = [
"i18n",
"jwt",
@ -29,7 +29,7 @@ features = [
[dependencies.zino-core]
path = "../../zino-core"
version = "0.24.3"
version = "0.25.0"
features = [
"cookie",
"env-filter",
@ -39,8 +39,8 @@ features = [
[dependencies.zino-derive]
path = "../../zino-derive"
version = "0.21.3"
version = "0.22.0"
[dependencies.zino-model]
path = "../../zino-model"
version = "0.21.3"
version = "0.22.0"

View File

@ -19,8 +19,8 @@ path = "src/main.rs"
[dependencies]
git2 = "0.19.0"
log = "0.4.22"
include_dir = "0.7.4"
log = "0.4.22"
walkdir = "2.5.0"
[dependencies.axum]
@ -31,11 +31,11 @@ default-features = false
version = "4.5.9"
features = ["color", "derive"]
[dependencies.zino-core]
path = "../zino-core"
version = "0.24.3"
[dependencies.zino]
path = "../zino"
version = "0.23.3"
version = "0.24.0"
features = ["axum"]
[dependencies.zino-core]
path = "../zino-core"
version = "0.25.0"

View File

@ -1,7 +1,7 @@
[package]
name = "zino-core"
description = "Core types and traits for zino."
version = "0.24.3"
version = "0.25.0"
rust-version = "1.75"
edition = "2021"
license = "MIT"
@ -288,7 +288,7 @@ default-features = false
features = ["http-listener"]
[dependencies.minijinja]
version = "2.0.3"
version = "2.1.0"
optional = true
features = ["debug", "loader"]
@ -373,7 +373,7 @@ version = "0.4.1"
optional = true
[dependencies.sqlx]
version = "0.7.4"
version = "0.8.0"
optional = true
default-features = false
features = [
@ -388,7 +388,7 @@ version = "1.20.0"
optional = true
[dependencies.toml]
version = "0.8.14"
version = "0.8.15"
default-features = false
features = ["parse"]

View File

@ -1,5 +1,5 @@
use serde::ser::{self, Serialize, SerializeMap, Serializer};
use sqlx::{database::HasValueRef, Column, ColumnIndex, Database, Decode, Row, TypeInfo, ValueRef};
use sqlx::{Column, ColumnIndex, Database, Decode, Row, TypeInfo, ValueRef};
use std::borrow::Cow;
/// A generic struct for the row.
@ -41,7 +41,7 @@ where
fn map_serialize<'r, M: SerializeMap, DB: Database, T: Decode<'r, DB> + Serialize>(
map: &mut M,
key: &str,
raw_value: <DB as HasValueRef<'r>>::ValueRef,
raw_value: <DB as Database>::ValueRef<'r>,
) -> Result<(), M::Error> {
let value = T::decode(raw_value).map_err(ser::Error::custom)?;
map.serialize_entry(key, &value)

View File

@ -1,7 +1,7 @@
use super::{DatabaseDriver, DatabaseRow};
use crate::{error::Error, BoxError, Decimal, Uuid};
use chrono::{DateTime, Local, NaiveDate, NaiveTime};
use sqlx::{database::HasValueRef, Database, Decode, Row, Type};
use sqlx::{Database, Decode, Row, Type};
impl<DB> Type<DB> for crate::datetime::Date
where
@ -42,7 +42,7 @@ where
NaiveDate: Decode<'r, DB>,
{
#[inline]
fn decode(value: <DB as HasValueRef<'r>>::ValueRef) -> Result<Self, BoxError> {
fn decode(value: <DB as Database>::ValueRef<'r>) -> Result<Self, BoxError> {
<NaiveDate as Decode<'r, DB>>::decode(value).map(|dt| dt.into())
}
}
@ -53,7 +53,7 @@ where
NaiveTime: Decode<'r, DB>,
{
#[inline]
fn decode(value: <DB as HasValueRef<'r>>::ValueRef) -> Result<Self, BoxError> {
fn decode(value: <DB as Database>::ValueRef<'r>) -> Result<Self, BoxError> {
<NaiveTime as Decode<'r, DB>>::decode(value).map(|dt| dt.into())
}
}
@ -64,7 +64,7 @@ where
DateTime<Local>: Decode<'r, DB>,
{
#[inline]
fn decode(value: <DB as HasValueRef<'r>>::ValueRef) -> Result<Self, BoxError> {
fn decode(value: <DB as Database>::ValueRef<'r>) -> Result<Self, BoxError> {
<DateTime<Local> as Decode<'r, DB>>::decode(value).map(|dt| dt.into())
}
}
@ -167,7 +167,7 @@ where
#[inline]
pub(super) fn decode_raw<'r, T>(
field: &str,
value: <DatabaseDriver as HasValueRef<'r>>::ValueRef,
value: <DatabaseDriver as Database>::ValueRef<'r>,
) -> Result<T, sqlx::Error>
where
T: Decode<'r, DatabaseDriver>,

View File

@ -1,7 +1,7 @@
[package]
name = "zino-derive"
description = "Derived traits for zino."
version = "0.21.3"
version = "0.22.0"
rust-version = "1.75"
edition = "2021"
license = "MIT"
@ -17,9 +17,9 @@ proc-macro = true
convert_case = "0.6.0"
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = "2.0.71"
syn = "2.0.72"
[dependencies.zino-core]
path = "../zino-core"
version = "0.24.3"
version = "0.25.0"
features = ["orm"]

View File

@ -1,5 +1,5 @@
use super::parser;
use convert_case::{Boundary::UpperLower, Case, Casing};
use convert_case::{Boundary::LowerUpper, Case, Casing};
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use syn::DeriveInput;
@ -209,7 +209,7 @@ pub(super) fn parse_token_stream(input: DeriveInput) -> TokenStream {
if enable_setter && !RESERVED_FIELDS.contains(&name.as_str()) {
let setter = if type_name == "String" {
if is_inherent {
let name_snake = name.with_boundaries(&[UpperLower]).to_case(Case::Snake);
let name_snake = name.with_boundaries(&[LowerUpper]).to_case(Case::Snake);
let parser_ident = format_ident!("parse_{}", name_snake);
quote! {
if let Some(value) = data.parse_string(#name) {
@ -265,7 +265,7 @@ pub(super) fn parse_token_stream(input: DeriveInput) -> TokenStream {
}
} else if let Some(type_generics) = parser::parse_option_type(&type_name) {
let type_generics_snake = type_generics
.with_boundaries(&[UpperLower])
.with_boundaries(&[LowerUpper])
.to_case(Case::Snake);
let parser_ident = format_ident!("parse_{}", type_generics_snake);
quote! {
@ -285,7 +285,7 @@ pub(super) fn parse_token_stream(input: DeriveInput) -> TokenStream {
}
} else {
let type_name_snake = type_name
.with_boundaries(&[UpperLower])
.with_boundaries(&[LowerUpper])
.to_case(Case::Snake);
let parser_ident = format_ident!("parse_{}", type_name_snake);
quote! {

View File

@ -1,7 +1,7 @@
[package]
name = "zino-dioxus"
description = "Dioxus components for zino."
version = "0.6.6"
version = "0.7.0"
rust-version = "1.75"
edition = "2021"
license = "MIT"
@ -13,10 +13,10 @@ documentation = "https://docs.rs/zino-dioxus"
readme = "README.md"
[dependencies]
dioxus = "0.5.1"
dioxus-core = "0.5.1"
dioxus-hooks = "0.5.1"
dioxus-router = "0.5.0"
dioxus = "0.5.6"
dioxus-core = "0.5.6"
dioxus-hooks = "0.5.6"
dioxus-router = "0.5.6"
markdown = "1.0.0-alpha.18"
rust_decimal = "1.35.0"
smallvec = "1.13.2"
@ -34,7 +34,7 @@ version = "0.5.0"
features = ["clipboard", "storage"]
[dependencies.tokio]
version = "1.38.0"
version = "1.38.1"
features = ["time"]
[dependencies.uuid]
@ -48,4 +48,4 @@ features = [
[dependencies.zino-core]
path = "../zino-core"
version = "0.24.3"
version = "0.25.0"

View File

@ -1,7 +1,7 @@
[package]
name = "zino-extra"
description = "Extra utilities for zino."
version = "0.4.1"
version = "0.4.2"
rust-version = "1.75"
edition = "2021"
license = "MIT"
@ -39,4 +39,4 @@ optional = true
[dependencies.zino-core]
path = "../zino-core"
version = "0.24.3"
version = "0.25.0"

View File

@ -1,7 +1,7 @@
[package]
name = "zino-model"
description = "Domain models for zino."
version = "0.21.3"
version = "0.22.0"
rust-version = "1.75"
edition = "2021"
license = "MIT"
@ -40,7 +40,7 @@ version = "1.0.204"
features = ["derive"]
[dependencies.sqlx]
version = "0.7.4"
version = "0.8.0"
default-features = false
[dependencies.strum]
@ -49,7 +49,7 @@ features = ["derive"]
[dependencies.zino-core]
path = "../zino-core"
version = "0.24.3"
version = "0.25.0"
features = [
"jwt",
"orm",
@ -58,4 +58,4 @@ features = [
[dependencies.zino-derive]
path = "../zino-derive"
version = "0.21.3"
version = "0.22.0"

View File

@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use sqlx::{database::HasValueRef, Database, Decode, Type};
use sqlx::{Database, Decode, Type};
use strum::{AsRefStr, Display, EnumString, IntoStaticStr};
use zino_core::{BoxError, JsonValue};
@ -59,7 +59,7 @@ where
&'r str: Decode<'r, DB>,
{
#[inline]
fn decode(value: <DB as HasValueRef<'r>>::ValueRef) -> Result<Self, BoxError> {
fn decode(value: <DB as Database>::ValueRef<'r>) -> Result<Self, BoxError> {
let value = <&'r str as Decode<'r, DB>>::decode(value)?;
Ok(value.parse()?)
}

View File

@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use sqlx::{database::HasValueRef, Database, Decode, Type};
use sqlx::{Database, Decode, Type};
use strum::{AsRefStr, Display, EnumString, IntoStaticStr};
use zino_core::{BoxError, JsonValue};
@ -57,7 +57,7 @@ where
&'r str: Decode<'r, DB>,
{
#[inline]
fn decode(value: <DB as HasValueRef<'r>>::ValueRef) -> Result<Self, BoxError> {
fn decode(value: <DB as Database>::ValueRef<'r>) -> Result<Self, BoxError> {
let value = <&'r str as Decode<'r, DB>>::decode(value)?;
Ok(value.parse()?)
}

View File

@ -1,7 +1,7 @@
[package]
name = "zino"
description = "Next-generation framework for composable applications in Rust."
version = "0.23.3"
version = "0.24.0"
rust-version = "1.75"
edition = "2021"
license = "MIT"
@ -114,19 +114,19 @@ features = [
]
[dependencies.dioxus]
version = "0.5.1"
version = "0.5.6"
optional = true
[dependencies.dioxus-desktop]
version = "0.5.1"
version = "0.5.6"
optional = true
[dependencies.dioxus-router]
version = "0.5.0"
version = "0.5.6"
optional = true
[dependencies.dioxus-ssr]
version = "0.5.1"
version = "0.5.6"
optional = true
features = ["incremental"]
@ -135,7 +135,7 @@ version = "0.3.30"
optional = true
[dependencies.image]
version = "0.25.1"
version = "0.25.2"
optional = true
[dependencies.ntex]
@ -149,7 +149,7 @@ version = "2.0.0"
optional = true
[dependencies.tokio]
version = "1.38.0"
version = "1.38.1"
optional = true
features = [
"macros",
@ -188,4 +188,4 @@ optional = true
[dependencies.zino-core]
path = "../zino-core"
version = "0.24.3"
version = "0.25.0"

View File

@ -4,7 +4,7 @@ use dioxus_desktop::{
Config, WindowBuilder,
};
use dioxus_router::{components::Router, routable::Routable};
use image::{error::ImageError, io::Reader};
use image::{error::ImageError, ImageReader};
use std::{fmt::Display, fs, marker::PhantomData, str::FromStr, time::Duration};
use tokio::runtime::Builder;
use zino_core::{
@ -135,7 +135,7 @@ where
custom_heads.push(r#"<meta charset="UTF-8">"#.to_owned());
if let Some(icon) = config.get_str("icon") {
let icon_file = project_dir.join(icon);
match Reader::open(&icon_file)
match ImageReader::open(&icon_file)
.map_err(ImageError::IoError)
.and_then(|reader| reader.decode())
{