Skip to content

Commit

Permalink
Release 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
photino committed Sep 14, 2023
1 parent 27262ab commit 1aa6283
Show file tree
Hide file tree
Showing 21 changed files with 111 additions and 44 deletions.
4 changes: 2 additions & 2 deletions examples/actix-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "actix-app"
description = "An example for actix-web integration."
version = "0.2.2"
version = "0.3.0"
rust-version = "1.72"
edition = "2021"
publish = false

[dependencies]
actix-web = "4.3.1"
fluent = "0.16.0"
serde_json = "1.0.105"
serde_json = "1.0.106"
tracing = "0.1.37"

[dependencies.serde]
Expand Down
6 changes: 3 additions & 3 deletions examples/actix-app/config/config.dev.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=dev

name = "data-cube"
version = "0.6.1"
version = "0.6.2"

[dirs]
uploads = "local/uploads"
Expand All @@ -27,14 +27,14 @@ host = "127.0.0.1"
port = 3306
database = "data_cube"
username = "root"
password = "ojOAhiNzR6evuSA7tEB0yQ+XZFAGsRZwxnRnaBWr+o0"
password = "Lv2OvgIj2FvuDPa9gTwBwUrVQhL/GG+mHC6SFqm8ZFo"

[[postgres]]
host = "127.0.0.1"
port = 5432
database = "data_cube"
username = "postgres"
password = "iPC3bcPjfD8t+4l4d5KVl9JL4TEte4WS4TQkvhZPmRE1IuRU"
password = "Wp6igv6c/+W0x7TCz2d7X3UPv0cYSCiXGM4fIxwbeNpNB8cA"

[[sqlite]]
database = "local/data/main.db"
Expand Down
6 changes: 3 additions & 3 deletions examples/actix-app/config/config.prod.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=prod

name = "data-cube"
version = "0.6.1"
version = "0.6.2"

[dirs]
uploads = "local/uploads"
Expand All @@ -27,14 +27,14 @@ host = "127.0.0.1"
port = 3306
database = "data_cube"
username = "root"
password = "7jHbEYq9pNcYWOkm/IciGEYADrQ/SVXbHidyml4nNWk"
password = "kXzpyb7fjw9Y5asQF2ZyAb3tly6tJwRX+u3YtL/R5Hg"

[[postgres]]
host = "127.0.0.1"
port = 5432
database = "data_cube"
username = "postgres"
password = "7ucIHbdEKszPaiijqP9n+RzWLK8vI9+4JkcA1WSrpb+eTe6Y"
password = "K+Teo8T42y6s1bM2WIlXEFj0GVFOgzW+LmO27HwQB+89Ala7"

[[sqlite]]
database = "local/data/main.db"
Expand Down
22 changes: 22 additions & 0 deletions examples/actix-app/config/openapi/file.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name = "Files"

[[endpoints]]
path = "/file/upload"
method = "POST"
summary = "Uploads the file"

[endpoints.body]
content_type = "multipart/form-data"
required = ["file"]
file = { type = "string", format = "binary", description = "File content" }

[[endpoints]]
path = "/file/decrypt"
method = "GET"
summary = "Decrypts the file"

[endpoints.query]
required = ["file_name", "access_key_id", "security_token"]
file_name = { type = "string", description = "File name" }
access_key_id = { type = "string", description = "Access key ID" }
security_token = { type = "string", description = "Security token" }
4 changes: 2 additions & 2 deletions examples/axum-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "axum-app"
description = "An example for axum integration."
version = "0.8.2"
version = "0.9.0"
rust-version = "1.72"
edition = "2021"
publish = false

[dependencies]
axum = "0.6.20"
fluent = "0.16.0"
serde_json = "1.0.105"
serde_json = "1.0.106"
tracing = "0.1.37"

[dependencies.serde]
Expand Down
6 changes: 3 additions & 3 deletions examples/axum-app/config/config.dev.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=dev

name = "data-cube"
version = "0.6.1"
version = "0.6.2"

[dirs]
uploads = "local/uploads"
Expand All @@ -27,14 +27,14 @@ host = "127.0.0.1"
port = 3306
database = "data_cube"
username = "root"
password = "0iLeU5EOoJK3ZAF/s25e6KJPikVmRL3DTaYvSvF10gw"
password = "R+55UX4yDf3AWgE3/LyotBxHwtcan+VehIXgdBFpFjg"

[[postgres]]
host = "127.0.0.1"
port = 5432
database = "data_cube"
username = "postgres"
password = "oAMk4OLvYhScFXT1R5NIIGZBJrjShQuedqavJW7fYfi+TQ/j"
password = "AR29LGfan4BCzYw8M/KthhljM3tf/3xTBG7QTRqgp5wT5VzQ"

[[sqlite]]
database = "local/data/main.db"
Expand Down
6 changes: 3 additions & 3 deletions examples/axum-app/config/config.prod.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=prod

name = "data-cube"
version = "0.6.1"
version = "0.6.2"

[dirs]
uploads = "local/uploads"
Expand All @@ -27,14 +27,14 @@ host = "127.0.0.1"
port = 3306
database = "data_cube"
username = "root"
password = "yErfJ4wTEiIO3qy77QAzubyrVcKZB8bHTzUuI/hx78E"
password = "PnVP+Su/G1ODrxTj09znPE883kIQ9JJyoUUssba8QiQ"

[[postgres]]
host = "127.0.0.1"
port = 5432
database = "data_cube"
username = "postgres"
password = "BAydY/V1w/IESDcoUygvNBQj6l3euOl5QnvimHtTyAbA6NJV"
password = "1S3Ih/rFCg4Z5TVbKiSUG2tFW/WcWUTQilzUGEpwUn467hOU"

[[sqlite]]
database = "local/data/main.db"
Expand Down
22 changes: 22 additions & 0 deletions examples/axum-app/config/openapi/file.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name = "Files"

[[endpoints]]
path = "/file/upload"
method = "POST"
summary = "Uploads the file"

[endpoints.body]
content_type = "multipart/form-data"
required = ["file"]
file = { type = "string", format = "binary", description = "File content" }

[[endpoints]]
path = "/file/decrypt"
method = "GET"
summary = "Decrypts the file"

[endpoints.query]
required = ["file_name", "access_key_id", "security_token"]
file_name = { type = "string", description = "File name" }
access_key_id = { type = "string", description = "Access key ID" }
security_token = { type = "string", description = "Security token" }
2 changes: 1 addition & 1 deletion examples/dioxus-desktop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dioxus-desktop"
description = "An example for Dioxus desktop integration."
version = "0.0.1"
version = "0.0.2"
rust-version = "1.72"
edition = "2021"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion examples/dioxus-desktop/config/config.dev.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=dev

name = "data-cube"
version = "0.1.0"
version = "0.1.1"

[dirs]
uploads = "local/uploads"
Expand Down
2 changes: 1 addition & 1 deletion examples/dioxus-desktop/config/config.prod.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=prod

name = "data-cube"
version = "0.1.0"
version = "0.1.1"

[dirs]
uploads = "local/uploads"
Expand Down
16 changes: 8 additions & 8 deletions zino-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ view-minijinja = ["view", "dep:minijinja"]
aes-gcm-siv = "0.11.1"
apache-avro = "0.15.0"
async-trait = "0.1.73"
base64 = "0.21.2"
bytes = "1.4.0"
base64 = "0.21.4"
bytes = "1.5.0"
cfg-if = "1.0"
convert_case = "0.6.0"
cookie = "0.16.2"
Expand All @@ -124,14 +124,14 @@ parking_lot = "0.12.1"
rand = "0.8.5"
regex = "1.9.5"
reqwest-middleware = "0.2.3"
reqwest-retry = "0.2.3"
reqwest-retry = "0.3.0"
reqwest-tracing = "0.4.6"
rmp-serde = "1.1.2"
serde_qs = "0.12.0"
sha2 = "0.10.7"
sysinfo = "0.29.10"
task-local-extensions = "0.1.4"
toml = "0.7.6"
toml = "0.8.0"
tracing = "0.1.37"
tracing-appender = "0.2.2"
url = "2.4.1"
Expand All @@ -141,15 +141,15 @@ version = "0.5.2"
features = ["std"]

[dependencies.async-openai]
version = "0.14.0"
version = "0.14.1"
optional = true

[dependencies.chrono]
version = "0.4.30"
features = ["serde"]

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

[dependencies.lru]
Expand Down Expand Up @@ -182,11 +182,11 @@ features = [
]

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

[dependencies.serde_json]
version = "1.0.105"
version = "1.0.106"
features = ["raw_value"]

[dependencies.sqlx]
Expand Down
13 changes: 9 additions & 4 deletions zino-core/src/connector/connector_arrow/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
//! Utilities for DataFusion.

use super::{Connector, DataSource, DataSourceConnector::Arrow};
use crate::{application::http_client, error::Error, extension::TomlTableExt, helper, Map, Record};
use crate::{
application::{http_client, PROJECT_DIR},
error::Error,
extension::TomlTableExt,
helper, Map, Record,
};
use datafusion::{
arrow::{datatypes::Schema, record_batch::RecordBatch},
common::FileCompressionType,
Expand Down Expand Up @@ -57,7 +62,7 @@ impl ArrowConnector {
pub fn new() -> Self {
Self {
context: OnceLock::new(),
root: PathBuf::from("./data/"),
root: PROJECT_DIR.join("local/data/"),
tables: None,
system_variables: ScalarValueProvider::default(),
user_defined_variables: ScalarValueProvider::default(),
Expand All @@ -66,14 +71,14 @@ impl ArrowConnector {

/// Creates a new instance with the configuration.
pub fn with_config(config: &Table) -> Self {
let root = config.get_str("root").unwrap_or("./data/");
let root = config.get_str("root").unwrap_or("local/data/");
let mut system_variables = ScalarValueProvider::default();
if let Some(variables) = config.get_table("variables") {
system_variables.read_toml_table(variables);
}
Self {
context: OnceLock::new(),
root: PathBuf::from(root),
root: PROJECT_DIR.join(root),
tables: config.get_array("tables").cloned(),
system_variables,
user_defined_variables: ScalarValueProvider::default(),
Expand Down
8 changes: 6 additions & 2 deletions zino-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
//!
//! [`zino`]: https://github.com/photino/zino

#![doc(html_favicon_url = "https://user-images.githubusercontent.com/3446306/267664890-e85a1cf8-5260-4bac-b395-2341e3129e40.png")]
#![doc(html_logo_url = "https://user-images.githubusercontent.com/3446306/267670333-ac29d670-4c81-47ca-bc8c-94ec11aa28f6.svg")]
#![doc(
html_favicon_url = "https://user-images.githubusercontent.com/3446306/267664890-e85a1cf8-5260-4bac-b395-2341e3129e40.png"
)]
#![doc(
html_logo_url = "https://user-images.githubusercontent.com/3446306/267670333-ac29d670-4c81-47ca-bc8c-94ec11aa28f6.svg"
)]
#![feature(associated_type_defaults)]
#![feature(async_fn_in_trait)]
#![feature(decl_macro)]
Expand Down
4 changes: 3 additions & 1 deletion zino-core/src/openapi/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ pub(super) fn parse_operation(name: &str, path: &str, config: &Table) -> Operati

/// Parses the schema.
pub(super) fn parse_schema(config: &Table) -> Schema {
const SPECIAL_KEYS: [&'static str; 3] = ["type", "items", "content_type"];

let schema_type_name = config.get_str("type").unwrap_or("object");
let mut is_array_object = false;
if schema_type_name == "array" {
Expand Down Expand Up @@ -154,7 +156,7 @@ pub(super) fn parse_schema(config: &Table) -> Schema {
object_builder = object_builder.pattern(Some(value));
}
_ => {
if !(key == "type" || key == "items") {
if !SPECIAL_KEYS.contains(&key.as_str()) {
let object = Object::with_type(parse_schema_type(value));
object_builder = object_builder.property(key, object);
}
Expand Down
2 changes: 1 addition & 1 deletion zino-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ proc-macro = true
convert_case = "0.6.0"
proc-macro2 = "1.0.66"
quote = "1.0.33"
syn = "2.0.31"
syn = "2.0.32"

[dependencies.zino-core]
path = "../zino-core"
Expand Down
8 changes: 6 additions & 2 deletions zino-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
//!
//! [`zino`]: https://github.com/photino/zino

#![doc(html_favicon_url = "https://user-images.githubusercontent.com/3446306/267664890-e85a1cf8-5260-4bac-b395-2341e3129e40.png")]
#![doc(html_logo_url = "https://user-images.githubusercontent.com/3446306/267670333-ac29d670-4c81-47ca-bc8c-94ec11aa28f6.svg")]
#![doc(
html_favicon_url = "https://user-images.githubusercontent.com/3446306/267664890-e85a1cf8-5260-4bac-b395-2341e3129e40.png"
)]
#![doc(
html_logo_url = "https://user-images.githubusercontent.com/3446306/267670333-ac29d670-4c81-47ca-bc8c-94ec11aa28f6.svg"
)]
#![feature(let_chains)]
#![forbid(unsafe_code)]

Expand Down
8 changes: 6 additions & 2 deletions zino-model/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
//!
//! [`zino`]: https://github.com/photino/zino

#![doc(html_favicon_url = "https://user-images.githubusercontent.com/3446306/267664890-e85a1cf8-5260-4bac-b395-2341e3129e40.png")]
#![doc(html_logo_url = "https://user-images.githubusercontent.com/3446306/267670333-ac29d670-4c81-47ca-bc8c-94ec11aa28f6.svg")]
#![doc(
html_favicon_url = "https://user-images.githubusercontent.com/3446306/267664890-e85a1cf8-5260-4bac-b395-2341e3129e40.png"
)]
#![doc(
html_logo_url = "https://user-images.githubusercontent.com/3446306/267670333-ac29d670-4c81-47ca-bc8c-94ec11aa28f6.svg"
)]
#![feature(async_fn_in_trait)]
#![feature(doc_auto_cfg)]
#![feature(lazy_cell)]
Expand Down
4 changes: 2 additions & 2 deletions zino/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ futures = "0.3.28"
hyper = "0.14.27"
parking_lot = "0.12.1"
serde = "1.0.188"
serde_json = "1.0.105"
toml = "0.7.6"
serde_json = "1.0.106"
toml = "0.8.0"
tracing = "0.1.37"

[dependencies.actix-cors]
Expand Down
Loading

0 comments on commit 1aa6283

Please sign in to comment.