Skip to content

Commit

Permalink
my-json 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amigin committed Jul 31, 2023
1 parent d31bca9 commit 2b23add
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
flurl = { tag = "0.2.3", git = "https://github.com/MyJetTools/fl-url" }
flurl = { tag = "0.4.0", git = "https://github.com/MyJetTools/fl-url" }


rust-extensions = { tag = "0.1.3", git = "https://github.com/MyJetTools/rust-extensions.git" }
Expand All @@ -17,8 +17,8 @@ my-http-server = { tag = "0.5.0", git = "https://github.com/MyJetTools/my-http-s
] }
my-http-server-controllers = { tag = "0.5.0", git = "https://github.com/MyJetTools/my-http-server-controllers.git" }
my-http-server-swagger = { tag = "0.5.0", git = "https://github.com/MyJetTools/my-http-server-swagger.git" }
my-logger = { tag = "0.2.0", git = "https://github.com/MyJetTools/my-logger.git" }
my-json = { tag = "0.1.2", git = "https://github.com/MyJetTools/my-json.git" }
my-logger = { tag = "0.2.1", git = "https://github.com/MyJetTools/my-logger.git" }
my-json = { tag = "0.2.0", git = "https://github.com/MyJetTools/my-json.git" }

my-no-sql-core = { tag = "0.2.0", git = "https://github.com/MyJetTools/my-no-sql-core.git" }
my-no-sql-server-core = { tag = "0.2.0", git = "https://github.com/MyJetTools/my-no-sql-server-core.git" }
Expand Down
6 changes: 3 additions & 3 deletions src/app/app_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
};

use my_no_sql_server_core::{logs::*, DbInstance};
use my_no_sql_tcp_shared::sync_to_main::SyncToMainNodelHandler;
use my_no_sql_tcp_shared::sync_to_main::SyncToMainNodeHandler;
use my_tcp_sockets::TcpClient;
use rust_extensions::{
date_time::DateTimeAsMicroseconds, events_loop::EventsLoop, AppStates, Logger,
Expand Down Expand Up @@ -40,7 +40,7 @@ pub struct AppContext {
pub master_node_ping_interval: AtomicI64,
pub connected_to_main_node: ConnectionToMainNode,

pub sync_to_main_node: SyncToMainNodelHandler,
pub sync_to_main_node: SyncToMainNodeHandler,
}

impl AppContext {
Expand All @@ -63,7 +63,7 @@ impl AppContext {
node_connection_tcp_client,
master_node_ping_interval: AtomicI64::new(0),
connected_to_main_node: ConnectionToMainNode::new(),
sync_to_main_node: SyncToMainNodelHandler::new(),
sync_to_main_node: SyncToMainNodeHandler::new(),
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/data_readers/http_connection/into_http_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn write_init_table_result(table_name: &str, content: JsonArrayWriter) -> Vec<u8
let mut result = Vec::new();

let mut header_json = JsonObjectWriter::new();
header_json.write_string_value("tableName", table_name);
header_json.write_value("tableName", table_name);

let header = format!(
"initTable:{}",
Expand All @@ -43,7 +43,7 @@ fn write_init_partitions_result(sync_data: &InitPartitionsSyncData) -> Vec<u8> {
let mut result = Vec::new();

let mut header_json = JsonObjectWriter::new();
header_json.write_string_value("tableName", sync_data.table_name.as_str());
header_json.write_value("tableName", sync_data.table_name.as_str());

let header = format!(
"initPartitions:{}",
Expand All @@ -60,7 +60,7 @@ fn write_init_partitions_result(sync_data: &InitPartitionsSyncData) -> Vec<u8> {
pub fn compile_update_rows_result(sync_data: &UpdateRowsSyncData) -> Vec<u8> {
let mut result = Vec::new();
let mut header_json = JsonObjectWriter::new();
header_json.write_string_value("tableName", sync_data.table_name.as_str());
header_json.write_value("tableName", sync_data.table_name.as_str());

let header = format!(
"updateRows:{}",
Expand All @@ -78,7 +78,7 @@ pub fn compile_delete_rows_result(sync_data: &DeleteRowsEventSyncData) -> Vec<u8
let mut result = Vec::new();
let mut header_json = JsonObjectWriter::new();

header_json.write_string_value("tableName", sync_data.table_name.as_str());
header_json.write_value("tableName", sync_data.table_name.as_str());

let header = format!(
"deleteRows:{}",
Expand Down
4 changes: 2 additions & 2 deletions src/db_sync/states/delete_rows_event_sync_data.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::BTreeMap, sync::Arc};

use my_json::json_writer::{JsonArrayWriter, JsonObjectWriter};
use my_json::json_writer::{JsonArrayWriter, JsonNullValue, JsonObjectWriter};
use my_no_sql_core::db::{DbRow, DbTable};

use crate::db_sync::EventSource;
Expand Down Expand Up @@ -58,7 +58,7 @@ impl DeleteRowsEventSyncData {
{
if let Some(deleted_partitions) = &self.deleted_partitions {
for partition_key in deleted_partitions.keys() {
json_object_writer.write_null_value(partition_key);
json_object_writer.write_value(partition_key, JsonNullValue);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/db_sync/states/init_partitions_sync_data.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;

use my_json::json_writer::JsonObjectWriter;
use my_json::json_writer::{JsonNullValue, JsonObjectWriter};
use my_no_sql_core::db::DbTable;
use my_no_sql_server_core::db_snapshots::DbPartitionSnapshot;

Expand Down Expand Up @@ -44,7 +44,7 @@ impl InitPartitionsSyncData {
db_partition_snapshot.db_rows_snapshot.as_json_array(),
);
} else {
json_object_writer.write_empty_array(partition_key)
json_object_writer.write_value(partition_key, JsonNullValue);
}
}

Expand Down

0 comments on commit 2b23add

Please sign in to comment.