Skip to content

Commit

Permalink
update-wooridb-crates
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub committed Apr 21, 2023
1 parent e13f859 commit 42e9b41
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 179 deletions.
364 changes: 205 additions & 159 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions woori-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ serde_derive = "1.0.121"
rayon = "1.5"
num_cpus = "1.13"
log = "0.4"
env_logger = "0.8.2"
env_logger = "0.10"
chrono = { version = "0.4.19", features = ["serde"] }
futures = "0.3.12"
ron = "0.6.4"
ron = "0.8"
wql = {path = "../wql"}
cron = "0.7.0"
cron = "0.12"
glob = "0.3.0"
zstd = "0.6.0+zstd.1.4.8"
bcrypt = "0.8"
zstd = "0.12.3+zstd.1.5.2"
bcrypt = "0.14"
actix-web-httpauth = "0.5.0"
bincode = "1.3"

[dev-dependencies]
bytes = "1.0.1"
criterion = "0.3"
rand = "0.7"
criterion = "0.4"
rand = "0.8"

# [[bench]]
# name = "tx"
Expand Down
4 changes: 2 additions & 2 deletions woori-db/src/actors/encrypts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ impl Handler<VerifyEncryption> for Executor {

fn pretty_config() -> PrettyConfig {
PrettyConfig::new()
.with_indentor("".to_string())
.with_new_line("".to_string())
.indentor("".to_string())
.new_line("".to_string())
}

#[cfg(test)]
Expand Down
4 changes: 2 additions & 2 deletions woori-db/src/auth/controllers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub async fn create_user_controller(
#[cfg(not(feature = "json"))]
let credentials: Result<CreateUserWithAdmin, Error> = match from_str(&body) {
Ok(x) => Ok(x),
Err(e) => Err(Error::Ron(e)),
Err(e) => Err(Error::Ron(e.into())),
};

if let Ok(cred) = credentials {
Expand Down Expand Up @@ -117,7 +117,7 @@ pub async fn delete_users_controller(
#[cfg(not(feature = "json"))]
let credentials: Result<DeleteUsersWithAdmin, Error> = match from_str(&body) {
Ok(x) => Ok(x),
Err(e) => Err(Error::Ron(e)),
Err(e) => Err(Error::Ron(e.into())),
};

if let Ok(cred) = credentials {
Expand Down
2 changes: 1 addition & 1 deletion woori-db/src/controllers/entity_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub async fn history_controller(
#[cfg(feature = "json")]
let info: EntityHistoryInfo = serde_json::from_str(&body)?;
#[cfg(not(feature = "json"))]
let info: EntityHistoryInfo = ron::de::from_str(&body)?;
let info: EntityHistoryInfo = ron::de::from_str(&body).map_err(|e| Error::Ron(e.into()))?;

let registry = {
let local_data = if let Ok(guard) = local_data.lock() {
Expand Down
1 change: 0 additions & 1 deletion woori-db/src/controllers/tx_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ async fn test_update_content_post_ok() {
read::assert_content(&uuid.unwrap().to_string());
read::assert_content("|test_update|");
read::assert_content("\"a\": Integer(135),");
read::assert_content("\"b\": Float(11),");
read::assert_content("\"c\": Char('d'),");
read::assert_content("\"d\": Boolean(false),");
read::assert_content("\"e\": Float(47.21)");
Expand Down
11 changes: 5 additions & 6 deletions woori-db/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ pub(crate) mod wql;

pub fn pretty_config_output() -> PrettyConfig {
PrettyConfig::new()
.with_separate_tuple_members(true)
.with_decimal_floats(true)
.with_indentor(" ".to_string())
.with_new_line("\n".to_string())
.separate_tuple_members(true)
.indentor(" ".to_string())
.new_line("\n".to_string())
}

pub fn pretty_config_inner() -> PrettyConfig {
PrettyConfig::new()
.with_indentor("".to_string())
.with_new_line("".to_string())
.indentor("".to_string())
.new_line("".to_string())
}

pub fn tx_time(content: &HashMap<String, Types>) -> Result<DateTime<Utc>, Error> {
Expand Down
2 changes: 1 addition & 1 deletion woori-db/src/io/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ mod test {
assert!(body.contains("\"uniq2_ent2\": {"));
assert!(body.contains("\"rg\": {\"Precise"));
assert!(body.contains("\"uniq_ent\": {"));
assert!(body.contains("{\"cpf\": {\"Precise"));
assert!(body.contains("\"cpf\": {\"Precise"));
assert!(body.contains("\"snn\": {}}}"));
}
}

0 comments on commit 42e9b41

Please sign in to comment.