Skip to content

Commit 3853471

Browse files
committed
update
1 parent cfe9cf1 commit 3853471

File tree

12 files changed

+145
-145
lines changed

12 files changed

+145
-145
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ use crate::main_module::model::data::data_object::DataObject;
2727
pub mod main_module;
2828

2929
fn main() {
30-
let new_obj = DataObject::new("name", "Oleg");
31-
println!("{:?}", new_obj);
30+
let new_obj = DataObject::new("name", "Oleg");
31+
println!("{:?}", new_obj);
3232
}

src/main_module/controller/create_table_handler.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
use crate::main_module::model::data::data_handler::DataHandler;
2626

2727
pub struct CreateTableHandler {
28-
data_handler: DataHandler,
28+
data_handler: DataHandler,
2929
}
3030

3131
impl CreateTableHandler {
32-
pub fn new() -> Self {
33-
let data_handler = DataHandler::new();
32+
pub fn new() -> Self {
33+
let data_handler = DataHandler::new();
3434

35-
CreateTableHandler { data_handler }
36-
}
35+
CreateTableHandler { data_handler }
36+
}
3737
}

src/main_module/model/data/data_handler.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ use std::collections::{HashMap, HashSet};
2727
use crate::main_module::model::data::table::Table;
2828

2929
pub struct DataHandler {
30-
tables: HashMap<String, Table>,
30+
tables: HashMap<String, Table>,
3131
}
3232

3333
impl DataHandler {
34-
pub fn new() -> Self {
35-
DataHandler {
36-
tables: HashMap::new(),
37-
}
38-
}
34+
pub fn new() -> Self {
35+
DataHandler {
36+
tables: HashMap::new(),
37+
}
38+
}
3939

40-
pub fn create_new_table(str: &str, set: HashSet<String>) {
41-
todo!()
42-
}
40+
pub fn create_new_table(str: &str, set: HashSet<String>) {
41+
todo!()
42+
}
4343

44-
pub fn insert_into_table() {
45-
todo!()
46-
}
44+
pub fn insert_into_table() {
45+
todo!()
46+
}
4747
}

src/main_module/model/data/data_object.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
#[derive(Debug)]
2626
pub struct DataObject {
27-
field_name: String,
28-
value: String,
27+
field_name: String,
28+
value: String,
2929
}
3030

3131
impl DataObject {
32-
pub fn new(field_name: &str, field_value: &str) -> Self {
33-
DataObject {
34-
field_name: String::from(field_name),
35-
value: String::from(field_value),
36-
}
37-
}
32+
pub fn new(field_name: &str, field_value: &str) -> Self {
33+
DataObject {
34+
field_name: String::from(field_name),
35+
value: String::from(field_value),
36+
}
37+
}
3838
}

src/main_module/model/data/table.rs

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -27,73 +27,73 @@ use std::collections::{HashMap, HashSet};
2727
use crate::main_module::model::data::data_object::DataObject;
2828

2929
pub struct Table {
30-
error_id: String,
31-
error_arg: String,
32-
error_rws: String,
33-
column_names: HashSet<String>,
34-
rows: HashMap<String, Vec<DataObject>>,
30+
error_id: String,
31+
error_arg: String,
32+
error_rws: String,
33+
column_names: HashSet<String>,
34+
rows: HashMap<String, Vec<DataObject>>,
3535
}
3636

3737
impl Table {
38-
pub fn new() -> Self {
39-
Table {
40-
error_id: String::from("[ERROR] [Incorrect ID]"),
41-
error_arg: String::from("[ERROR] [Incorrect rows in insert data package"),
42-
error_rws: String::from("[ERROR] [Trying to reach an empty row]"),
43-
column_names: HashSet::new(),
44-
rows: HashMap::new(),
45-
}
46-
}
47-
48-
fn generate_unique_id() {
49-
todo!()
50-
}
51-
52-
fn verify_id() {
53-
todo!()
54-
}
55-
56-
fn verify_field() {
57-
todo!()
58-
}
59-
60-
fn verify_rows() {
61-
todo!()
62-
}
63-
64-
fn verify_column_names_correct() {
65-
todo!()
66-
}
67-
68-
fn verify_id_and_field() {
69-
todo!()
70-
}
71-
72-
fn verify_id_and_columns() {
73-
todo!()
74-
}
75-
76-
pub fn row_is_empty() {
77-
todo!()
78-
}
79-
80-
pub fn get_field_value() {
81-
todo!()
82-
}
83-
84-
pub fn add_row() {
85-
todo!()
86-
}
87-
88-
pub fn return_row() {
89-
todo!()
90-
}
91-
92-
pub fn remove_row() {
93-
todo!()
94-
}
95-
96-
pub fn update_row_field_values() {
97-
todo!()
98-
}
38+
pub fn new() -> Self {
39+
Table {
40+
error_id: String::from("[ERROR] [Incorrect ID]"),
41+
error_arg: String::from("[ERROR] [Incorrect rows in insert data package"),
42+
error_rws: String::from("[ERROR] [Trying to reach an empty row]"),
43+
column_names: HashSet::new(),
44+
rows: HashMap::new(),
45+
}
46+
}
47+
48+
fn generate_unique_id() {
49+
todo!()
50+
}
51+
52+
fn verify_id() {
53+
todo!()
54+
}
55+
56+
fn verify_field() {
57+
todo!()
58+
}
59+
60+
fn verify_rows() {
61+
todo!()
62+
}
63+
64+
fn verify_column_names_correct() {
65+
todo!()
66+
}
67+
68+
fn verify_id_and_field() {
69+
todo!()
70+
}
71+
72+
fn verify_id_and_columns() {
73+
todo!()
74+
}
75+
76+
pub fn row_is_empty() {
77+
todo!()
78+
}
79+
80+
pub fn get_field_value() {
81+
todo!()
82+
}
83+
84+
pub fn add_row() {
85+
todo!()
86+
}
87+
88+
pub fn return_row() {
89+
todo!()
90+
}
91+
92+
pub fn remove_row() {
93+
todo!()
94+
}
95+
96+
pub fn update_row_field_values() {
97+
todo!()
98+
}
9999
}

src/main_module/model/data/table_row.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,43 @@
2525
use crate::main_module::model::data::data_object::DataObject;
2626

2727
pub struct TableRow {
28-
incorrect_field_name: String,
29-
fields: Vec<DataObject>,
28+
incorrect_field_name: String,
29+
fields: Vec<DataObject>,
3030
}
3131

3232
impl TableRow {
33-
pub fn new(fields: Vec<DataObject>) -> Self {
34-
TableRow {
35-
incorrect_field_name: String::from("[ERROR] [Incorrect field name]"),
36-
fields,
37-
}
38-
}
33+
pub fn new(fields: Vec<DataObject>) -> Self {
34+
TableRow {
35+
incorrect_field_name: String::from("[ERROR] [Incorrect field name]"),
36+
fields,
37+
}
38+
}
3939

40-
pub fn add_field(data_object: DataObject) {
41-
todo!()
42-
}
40+
pub fn add_field(data_object: DataObject) {
41+
todo!()
42+
}
4343

44-
pub fn insert_field(data_object: DataObject) {
45-
todo!()
46-
}
44+
pub fn insert_field(data_object: DataObject) {
45+
todo!()
46+
}
4747

48-
pub fn remove_field(field: String) {
49-
todo!()
50-
}
48+
pub fn remove_field(field: String) {
49+
todo!()
50+
}
5151

52-
pub fn remove_field_value(field: String) {
53-
todo!()
54-
}
52+
pub fn remove_field_value(field: String) {
53+
todo!()
54+
}
5555

56-
pub fn get_field_data_obj(field: String) {
57-
todo!()
58-
}
56+
pub fn get_field_data_obj(field: String) {
57+
todo!()
58+
}
5959

60-
pub fn replace_existing_obj_value(current: DataObject, new: DataObject) {
61-
todo!()
62-
}
60+
pub fn replace_existing_obj_value(current: DataObject, new: DataObject) {
61+
todo!()
62+
}
6363

64-
fn find_data_obj(field: String) {
65-
todo!()
66-
}
67-
}
64+
fn find_data_obj(field: String) {
65+
todo!()
66+
}
67+
}

src/main_module/model/queries/commands/create_table_command.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ use crate::main_module::model::queries::commands::querry_command::QueryCommand;
3030
pub struct CreateTableCommand {}
3131

3232
impl QueryCommand for CreateTableCommand {
33-
fn execute_command(command_line: String) {
34-
let binding = command_line.replace("\\);", "");
35-
let binding = binding.split(" \\(");
36-
let mut command_addr = binding;
33+
fn execute_command(command_line: String) {
34+
let binding = command_line.replace("\\);", "");
35+
let binding = binding.split(" \\(");
36+
let mut command_addr = binding;
3737

38-
let table_name = command_addr.next().unwrap();
39-
let column_name = command_addr.next().unwrap();
40-
let mut column_names: HashSet<String> = HashSet::new();
41-
column_names.insert(column_name.to_string());
42-
let temp: HashSet<String> = HashSet::new();
38+
let table_name = command_addr.next().unwrap();
39+
let column_name = command_addr.next().unwrap();
40+
let mut column_names: HashSet<String> = HashSet::new();
41+
column_names.insert(column_name.to_string());
42+
let temp: HashSet<String> = HashSet::new();
4343

44-
DataHandler::create_new_table(table_name, temp);
45-
}
44+
DataHandler::create_new_table(table_name, temp);
45+
}
4646
}

src/main_module/model/queries/commands/insert_into_command.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::main_module::model::queries::commands::querry_command::QueryCommand;
2727
pub struct InsertIntoCommand {}
2828

2929
impl QueryCommand for InsertIntoCommand {
30-
fn execute_command(command_line: String) {
31-
todo!()
32-
}
30+
fn execute_command(command_line: String) {
31+
todo!()
32+
}
3333
}

src/main_module/model/queries/commands/querry_command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
*/
2424

2525
pub trait QueryCommand {
26-
fn execute_command(command_line: String);
26+
fn execute_command(command_line: String);
2727
}

src/main_module/model/queries/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
use crate::main_module::model::queries::query_element::QueryElement;
2626

2727
pub struct Query {
28-
query_elements: Vec<QueryElement>,
28+
query_elements: Vec<QueryElement>,
2929
}

src/main_module/model/queries/query_element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
*/
2424

2525
pub struct QueryElement {
26-
query_composition: Vec<QueryElement>,
26+
query_composition: Vec<QueryElement>,
2727
}

src/main_module/model/queries/query_keyword.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
*/
2424

2525
pub enum QueryKeyword {
26-
CREATE_TABLE,
27-
SELECT,
28-
UPDATE,
29-
DELETE,
30-
INSERT_INTO,
26+
CREATE_TABLE,
27+
SELECT,
28+
UPDATE,
29+
DELETE,
30+
INSERT_INTO,
3131
}

0 commit comments

Comments
 (0)