Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
photino committed Oct 14, 2023
1 parent 0c8c6e2 commit c27da31
Show file tree
Hide file tree
Showing 20 changed files with 124 additions and 38 deletions.
4 changes: 2 additions & 2 deletions examples/actix-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ publish = false
actix-web = "4.4.0"
fluent = "0.16.0"
serde_json = "1.0.107"
tracing = "0.1.37"
tracing = "0.1.39"

[dependencies.serde]
version = "1.0.188"
version = "1.0.189"
features = ["derive"]

[dependencies.zino]
Expand Down
4 changes: 2 additions & 2 deletions examples/axum-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ publish = false
axum = "0.6.20"
fluent = "0.16.0"
serde_json = "1.0.107"
tracing = "0.1.37"
tracing = "0.1.39"

[dependencies.serde]
version = "1.0.188"
version = "1.0.189"
features = ["derive"]

[dependencies.zino]
Expand Down
4 changes: 2 additions & 2 deletions examples/dioxus-desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ publish = false
[dependencies]
dioxus = "0.4.0"
dioxus-router = "0.4.1"
tracing = "0.1.37"
tracing = "0.1.39"

[dependencies.serde]
version = "1.0.188"
version = "1.0.189"
features = ["derive"]

[dependencies.zino]
Expand Down
7 changes: 0 additions & 7 deletions examples/dioxus-desktop/src/controller/home.rs

This file was deleted.

2 changes: 1 addition & 1 deletion examples/dioxus-desktop/src/controller/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub(crate) mod home;

1 change: 1 addition & 0 deletions examples/dioxus-desktop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod controller;
mod router;
mod schedule;
mod service;
mod view;

use zino::prelude::*;

Expand Down
35 changes: 31 additions & 4 deletions examples/dioxus-desktop/src/router/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
use crate::controller::home::Homepage;
use crate::view::{
dataset::{Dataset, DatasetList, DatasetView},
home::Home,
layout::Wrapper,
};
use dioxus::prelude::*;
use dioxus_router::prelude::*;
use zino::prelude::*;

#[derive(Clone, PartialEq, Eq, Routable)]
#[rustfmt::skip]
pub enum Route {
#[route("/")]
Homepage {},
#[layout(Wrapper)]
#[route("/")]
Home {},
#[nest("/dataset")]
#[layout(Dataset)]
#[route("/list")]
DatasetList {},
#[route("/:id/view")]
DatasetView { id: Uuid },
#[end_layout]
#[end_nest]
#[end_layout]
#[route("/:..segments")]
PageNotFound { segments: Vec<String> },
}

impl Default for Route {
fn default() -> Self {
Self::Homepage {}
Self::Home {}
}
}

#[inline_props]
fn PageNotFound(cx: Scope, segments: Vec<String>) -> Element {
let path = segments.join("/");
render! {
h1 { "Page not found" }
p { "The page `{path}` you requested doesn't exist." }
}
}
37 changes: 37 additions & 0 deletions examples/dioxus-desktop/src/view/dataset.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
use crate::router::Route;
use dioxus::prelude::*;
use dioxus_router::prelude::*;
use zino::prelude::*;

pub fn Dataset(cx: Scope) -> Element {
render! {
h1 { "Datasets" }
Outlet::<Route> {}
}
}

pub fn DatasetList(cx: Scope) -> Element {
render! {
ul {
li {
Link {
to: Route::DatasetView { id: Uuid::new_v4() },
"View the first dataset"
}
}
li {
Link {
to: Route::DatasetView { id: Uuid::new_v4() },
"View the second dataset"
}
}
}
}
}

#[inline_props]
pub fn DatasetView(cx: Scope, id: Uuid) -> Element {
render! {
h2 { "Dataset ID: {id}"}
}
}
7 changes: 7 additions & 0 deletions examples/dioxus-desktop/src/view/home.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use dioxus::prelude::*;

pub fn Home(cx: Scope) -> Element {
render! {
div {}
}
}
18 changes: 18 additions & 0 deletions examples/dioxus-desktop/src/view/layout.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use crate::router::Route;
use dioxus::prelude::*;
use dioxus_router::prelude::*;

pub fn Wrapper(cx: Scope) -> Element {
render! {
header {
nav {
ul {
li { Link { to: Route::Home {}, "Home" } }
li { Link { to: Route::DatasetList {}, "Datasets" } }
}
}
}
Outlet::<Route> {}
footer {}
}
}
3 changes: 3 additions & 0 deletions examples/dioxus-desktop/src/view/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub(crate) mod dataset;
pub(crate) mod home;
pub(crate) mod layout;
10 changes: 5 additions & 5 deletions zino-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ mime_guess = "2.0.4"
multer = "2.1.0"
parking_lot = "0.12.1"
rand = "0.8.5"
regex = "1.9.6"
regex = "1.10.1"
reqwest-middleware = "0.2.3"
reqwest-retry = "0.3.0"
reqwest-tracing = "0.4.6"
Expand All @@ -141,7 +141,7 @@ sha2 = "0.10.8"
sysinfo = "0.29.10"
task-local-extensions = "0.1.4"
toml = "0.8.2"
tracing = "0.1.37"
tracing = "0.1.39"
tracing-appender = "0.2.2"
url = "2.4.1"

Expand All @@ -162,7 +162,7 @@ version = "0.4.31"
features = ["serde"]

[dependencies.datafusion]
version = "31.0.0"
version = "32.0.0"
optional = true

[dependencies.lru]
Expand All @@ -184,7 +184,7 @@ optional = true
features = ["layers-all"]

[dependencies.openidconnect]
version = "3.3.1"
version = "3.4.0"
optional = true

[dependencies.printpdf]
Expand All @@ -203,7 +203,7 @@ features = [
]

[dependencies.serde]
version = "1.0.188"
version = "1.0.189"
features = ["derive"]

[dependencies.serde_json]
Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/application/secret_key.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::Application;
use crate::{crypto, extension::TomlTableExt};
use std::{sync::OnceLock};
use std::sync::OnceLock;

/// Initializes the secret key.
pub(super) fn init<APP: Application + ?Sized>() {
Expand Down
6 changes: 3 additions & 3 deletions zino-core/src/connector/connector_arrow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::{
};
use datafusion::{
arrow::{datatypes::Schema, record_batch::RecordBatch},
common::FileCompressionType,
dataframe::DataFrame,
datasource::file_format::file_compression_type::FileCompressionType,
execution::{
context::{SessionConfig, SessionContext, SessionState},
options::{AvroReadOptions, CsvReadOptions, NdJsonReadOptions, ParquetReadOptions},
Expand Down Expand Up @@ -110,7 +110,7 @@ impl ArrowConnector {
return Ok(ctx);
};

let ctx = SessionContext::with_state(SHARED_SESSION_STATE.clone());
let ctx = SessionContext::new_with_state(SHARED_SESSION_STATE.clone());
if let Some(tables) = self.tables.as_deref() {
let root = &self.root;
for table in tables.iter().filter_map(|v| v.as_table()) {
Expand Down Expand Up @@ -297,5 +297,5 @@ impl Connector for ArrowConnector {
static SHARED_SESSION_STATE: LazyLock<SessionState> = LazyLock::new(|| {
let config = SessionConfig::new();
let runtime = Arc::new(RuntimeEnv::default());
SessionState::with_config_rt(config, runtime)
SessionState::new_with_config_rt(config, runtime)
});
2 changes: 1 addition & 1 deletion zino-core/src/connector/connector_arrow/scalar_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl VarProvider for ScalarValueProvider {
fn get_type(&self, var_names: &[String]) -> Option<DataType> {
var_names.iter().find_map(|name| {
self.get(name.trim_start_matches('@'))
.map(|value| value.get_datatype())
.map(|value| value.data_type())
})
}
}
8 changes: 4 additions & 4 deletions zino-core/src/connector/connector_arrow/scalar_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl ScalarValueExt for ScalarValue {
.map(|value| {
let scalar = Self::from_toml_value(value);
if data_type == DataType::Null {
data_type = scalar.get_datatype();
data_type = scalar.data_type();
}
scalar
})
Expand All @@ -41,7 +41,7 @@ impl ScalarValueExt for ScalarValue {
.into_iter()
.map(|(key, value)| {
let scalar = Self::from_toml_value(value);
let field = Field::new(key, scalar.get_datatype(), true);
let field = Field::new(key, scalar.data_type(), true);
fields.push(field);
scalar
})
Expand Down Expand Up @@ -75,7 +75,7 @@ impl ScalarValueExt for ScalarValue {
.map(|value| {
let scalar = Self::from_json_value(value);
if data_type == DataType::Null {
data_type = scalar.get_datatype();
data_type = scalar.data_type();
}
scalar
})
Expand All @@ -88,7 +88,7 @@ impl ScalarValueExt for ScalarValue {
.into_iter()
.map(|(key, value)| {
let scalar = Self::from_json_value(value);
let field = Field::new(key, scalar.get_datatype(), true);
let field = Field::new(key, scalar.data_type(), true);
fields.push(field);
scalar
})
Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl ConnectionPool {

// Pool options.
let max_connections = config.get_u32("max-connections").unwrap_or(16);
let min_connections = config.get_u32("min-connections").unwrap_or(2);
let min_connections = config.get_u32("min-connections").unwrap_or(1);
let max_lifetime = config
.get_duration("max-lifetime")
.unwrap_or_else(|| Duration::from_secs(60 * 60));
Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/database/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pub trait Schema: 'static + Send + Sync + ModelHooks {
} else {
d.get_str("is_not_null") == Some("1")
};
if col.is_not_null() != is_not_null {
if col.is_not_null() != is_not_null && column_name != primary_key_name {
tracing::warn!(
model_name = Self::model_name(),
table_name,
Expand Down
4 changes: 2 additions & 2 deletions zino-model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ maintainer-id = []
edition = []

[dependencies]
regex = "1.9.6"
regex = "1.10.1"
strum_macros = "0.25.2"

[dependencies.serde]
version = "1.0.188"
version = "1.0.189"
features = ["derive"]

[dependencies.zino-core]
Expand Down
4 changes: 2 additions & 2 deletions zino/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ cfg-if = "1.0"
futures = "0.3.28"
hyper = "0.14.27"
parking_lot = "0.12.1"
serde = "1.0.188"
serde = "1.0.189"
serde_json = "1.0.107"
toml = "0.8.2"
tracing = "0.1.37"
tracing = "0.1.39"

[dependencies.actix-cors]
version = "0.6.4"
Expand Down

0 comments on commit c27da31

Please sign in to comment.