-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7be309b
commit 4a8c47f
Showing
16 changed files
with
516 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ minisql> | |
|
||
I plan to implement more features of traditional relational databases in the future as part of this project simply to learn and discovery how various features I have grown acustomed to over the years are implemented under the hood. However, currently only a very small number of features are implemented: | ||
|
||
- simple SQL parser (partial support for `CREATE TABLE`, `INSERT`, `SELECT` queries) | ||
- simple SQL parser (partial support for `CREATE TABLE`, `INSERT`, `SELECT`, `UPDATE` queries) | ||
- only tables supported, no indexes (this means all selects are scanning whole tables for now) | ||
- only `int4`, `int8` and `varchar` columns supported | ||
- no primary key support (tables internally use row ID as key in B tree data structure) | ||
|
@@ -30,13 +30,13 @@ I plan to implement more features of traditional relational databases in the fut | |
|
||
### Planned features: | ||
|
||
- support additional basic query types such as `UPDATE`, `DELETE`, `DROP TABLE` | ||
- support additional basic query types such as `DELETE`, `DROP TABLE` | ||
- support `NULL` values | ||
- B+ tree and support indexes (starting with unique and primary) | ||
- more column types starting with simpler ones such as `bool` and `timestamp` | ||
- support bigger column types such as `text` that can overflow to more pages via linked list data structure | ||
- joins such as `INNER`, `LEFT`, `RIGHT` | ||
- support `ORDER BY`, `GROUP BY` | ||
- support `ORDER BY`, `LIMIT`, `GROUP BY` | ||
- dedicate first 100B of root page for config similar to how sqlite does it | ||
- support altering tables | ||
- transactions | ||
|
@@ -85,7 +85,6 @@ Insert more than a single page worth of data: | |
```sh | ||
minisql> insert into foo(id, email, age) values(1, '[email protected]', 35), (2, '[email protected]', 32), (3, '[email protected]', 27), (4, '[email protected]', 32), (5, '[email protected]', 27), (6, '[email protected]', 32), (7, '[email protected]', 27), (8, '[email protected]', 32), (9, '[email protected]', 27), (10, '[email protected]', 32), (11, '[email protected]', 27), (12, '[email protected]', 32), (13, '[email protected]', 27), (14, '[email protected]', 27), (15, '[email protected]', 27) | ||
Rows affected: 15 | ||
|
||
minisql> | ||
``` | ||
|
||
|
@@ -101,3 +100,11 @@ minisql> select * from foo | |
minisql> | ||
``` | ||
Update rows: | ||
```sh | ||
minisql> update foo set id = 45 where id = 75 | ||
Rows affected: 0 | ||
minisql> | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.