File tree Expand file tree Collapse file tree 7 files changed +172
-0
lines changed Expand file tree Collapse file tree 7 files changed +172
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * NaiveSQL implemented in Rust.
3+ * Copyright (C) 2024 Andrew Kushyk
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ */
18+
19+ use super :: tables:: table:: Table ;
20+
21+ struct Database {
22+ tables : Vec < Table > ,
23+ }
24+
25+ impl Database {
26+ pub fn new ( tables : Vec < Table > ) -> Self {
27+ Self {
28+ tables
29+ }
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * NaiveSQL implemented in Rust.
3+ * Copyright (C) 2024 Andrew Kushyk
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ */
18+
19+ pub ( crate ) mod database;
20+ pub ( crate ) mod tables;
Original file line number Diff line number Diff line change 1+ /*
2+ * NaiveSQL implemented in Rust.
3+ * Copyright (C) 2024 Andrew Kushyk
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ */
18+
19+ pub ( crate ) mod table;
20+ pub ( crate ) mod rows;
Original file line number Diff line number Diff line change 1+ /*
2+ * NaiveSQL implemented in Rust.
3+ * Copyright (C) 2024 Andrew Kushyk
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ */
18+
19+ pub ( crate ) mod row;
Original file line number Diff line number Diff line change 1+ /*
2+ * NaiveSQL implemented in Rust.
3+ * Copyright (C) 2024 Andrew Kushyk
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ */
18+
19+ pub struct Row {
20+ columns : Vec < String > ,
21+ }
22+
23+ impl Row {
24+ pub fn new ( id : u32 , columns : Vec < String > ) -> Self {
25+ Self {
26+ columns,
27+ }
28+ }
29+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * NaiveSQL implemented in Rust.
3+ * Copyright (C) 2024 Andrew Kushyk
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ */
18+
19+ use std:: collections:: HashMap ;
20+ use crate :: databases:: tables:: rows:: row:: Row ;
21+
22+ pub struct Table {
23+ name : String ,
24+ rows : HashMap < u32 , Row > ,
25+ }
26+
27+ impl Table {
28+ pub fn new ( name : String , rows : HashMap < u32 , Row > ) -> Self {
29+ Self {
30+ name,
31+ rows,
32+ }
33+ }
34+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * NaiveSQL implemented in Rust.
3+ * Copyright (C) 2024 Andrew Kushyk
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, either version 3 of the License, or
8+ * (at your option) any later version.
9+ *
10+ * This program is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ * GNU General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU General Public License
16+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ */
18+
19+ pub ( crate ) mod databases;
You can’t perform that action at this time.
0 commit comments