Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiaagarwal committed Jun 18, 2024
1 parent 6938055 commit 3613486
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 16 deletions.
2 changes: 1 addition & 1 deletion models/src/models/catalog_info.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::models;
use chrono::{serde::ts_milliseconds, DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use std::collections::HashMap;
use uuid::Uuid;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CatalogInfo {
Expand Down
15 changes: 14 additions & 1 deletion models/src/models/column_type_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ use strum::{Display, IntoStaticStr};

/// ColumnTypeName : Name of type (INT, STRUCT, MAP, etc.).
/// Name of type (INT, STRUCT, MAP, etc.).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Display, IntoStaticStr)]
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize,
Display,
IntoStaticStr,
)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
pub enum ColumnTypeName {
Expand Down
2 changes: 1 addition & 1 deletion models/src/models/create_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ impl From<models::CreateCatalog> for models::CatalogInfo {
fn from(catalog: models::CreateCatalog) -> Self {
catalog.build()
}
}
}
64 changes: 57 additions & 7 deletions models/src/models/create_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ pub struct CreateFunction {
pub routine_body: RoutineBody,
/// Function body.
pub routine_definition: String,
#[serde(
skip_serializing_if = "Option::is_none"
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub routine_dependencies: Option<models::DependencyList>,
/// Function parameter style. **S** is the value for SQL.
pub parameter_style: ParameterStyle,
Expand All @@ -48,7 +46,20 @@ pub struct CreateFunction {
}

/// Function language. When **EXTERNAL** is used, the language of the routine function should be specified in the __external_language__ field, and the __return_params__ of the function cannot be used (as **TABLE** return type is not supported), and the __sql_data_access__ field must be **NO_SQL**.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Display, IntoStaticStr)]
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize,
Display,
IntoStaticStr,
)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
pub enum RoutineBody {
Expand All @@ -57,7 +68,20 @@ pub enum RoutineBody {
}

/// Function parameter style. **S** is the value for SQL.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Display, IntoStaticStr)]
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize,
Display,
IntoStaticStr,
)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
pub enum ParameterStyle {
Expand All @@ -70,7 +94,20 @@ impl Default for ParameterStyle {
}
}
/// Function SQL data access.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Display, IntoStaticStr)]
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize,
Display,
IntoStaticStr,
)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum SqlDataAccess {
ContainsSql,
Expand All @@ -79,7 +116,20 @@ pub enum SqlDataAccess {
}

/// Function security type.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Display, IntoStaticStr)]
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize,
Display,
IntoStaticStr,
)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum SecurityType {
Definer,
Expand Down
2 changes: 1 addition & 1 deletion models/src/models/create_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ pub struct CreateSchema {
/// A map of key-value properties attached to the securable.
#[serde(skip_serializing_if = "HashMap::is_empty")]
pub properties: HashMap<String, String>,
}
}
15 changes: 14 additions & 1 deletion models/src/models/data_source_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ use strum::{Display, IntoStaticStr};

/// DataSourceFormat : Data source format
/// Data source format
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Display, IntoStaticStr)]
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
Serialize,
Deserialize,
Display,
IntoStaticStr,
)]
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum DataSourceFormat {
Expand Down
2 changes: 1 addition & 1 deletion models/src/models/function_dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ use serde::{Deserialize, Serialize};
pub struct FunctionDependency {
/// Full name of the dependent function, in the form of __catalog_name__.__schema_name__.__function_name__.
pub function_full_name: String,
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::models;
use chrono::{serde::ts_milliseconds, DateTime, Utc};
use serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc, serde::ts_milliseconds};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GenerateTemporaryTableCredentialResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::models;
use chrono::{DateTime, Utc, serde::ts_milliseconds};
use chrono::{serde::ts_milliseconds, DateTime, Utc};
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion models/src/models/schema_info.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::models;
use chrono::{serde::ts_milliseconds, DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use std::collections::HashMap;
use uuid::Uuid;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SchemaInfo {
Expand Down

0 comments on commit 3613486

Please sign in to comment.