Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

pub mod main_module;
use crate::main_module::data::DataObject::DataObject;
use crate::main_module::data::data_object::DataObject;

fn main() {
let new_obj = DataObject::new("name", "Oleg");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
* SOFTWARE.
*/

use crate::main_module::data::DataHandler::DataHandler;
use crate::main_module::data::data_handler::DataHandler;

pub struct CreateTableHandler {
dataHandler: DataHandler,
data_handler: DataHandler,
}

impl CreateTableHandler {
pub fn new() -> Self {
let dataHandler = DataHandler::new();
let data_handler = DataHandler::new();

CreateTableHandler {
dataHandler,
data_handler,
}
}
}
2 changes: 1 addition & 1 deletion src/main_module/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
* SOFTWARE.
*/

pub mod CreateTableHandler;
pub mod create_table_handler;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

use std::collections::HashMap;
use crate::main_module::data::Table::Table;
use crate::main_module::data::table::Table;

pub struct DataHandler {
tables: HashMap<String, Table>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
#[derive(Debug)]

pub struct DataObject {
fieldName: String,
field_name: String,
value: String,
}

impl DataObject{
pub fn new(field_name: &str, field_value: &str) -> Self {
DataObject {
fieldName: String::from(field_name),
field_name: String::from(field_name),
value: String::from(field_value),
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main_module/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
* SOFTWARE.
*/

pub mod DataHandler;
pub mod DataObject;
pub mod Table;
pub mod data_handler;
pub mod data_object;
pub mod table;
16 changes: 8 additions & 8 deletions src/main_module/data/Table.rs → src/main_module/data/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ use std::collections::{HashSet, HashMap};
use crate::DataObject;

pub struct Table {
errorId: String,
errorArg: String,
errorRws: String,
columnNames: HashSet<String>,
error_id: String,
error_arg: String,
error_rws: String,
column_names: HashSet<String>,
rows: HashMap<String, Vec<DataObject>>,
}

impl Table {
pub fn new() -> Self {
Table {
errorId: String::from("[ERROR] [Incorrect ID]"),
errorArg: String::from("[ERROR] [Incorrect rows in insert data package"),
errorRws: String::from("[ERROR] [Trying to reach an empty row]"),
columnNames: HashSet::new(),
error_id: String::from("[ERROR] [Incorrect ID]"),
error_arg: String::from("[ERROR] [Incorrect rows in insert data package"),
error_rws: String::from("[ERROR] [Trying to reach an empty row]"),
column_names: HashSet::new(),
rows: HashMap::new(),
}
}
Expand Down