SQLite-CPP
所属分类:数据库系统
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2023-08-05 22:29:50
上 传 者:
sh-1993
说明: 简单SQL数据库的C++实现,使用现代编程实践创建
(A C++ implementation of a simple SQL database, created with usage of modern programming practices)
文件列表:
CMakeLists.txt (1004, 2023-10-14)
includes/ (0, 2023-10-14)
includes/buffer.h (446, 2023-10-14)
includes/constants.h (3306, 2023-10-14)
includes/data.h (2531, 2023-10-14)
includes/database.h (777, 2023-10-14)
includes/node.h (1104, 2023-10-14)
includes/pager.h (895, 2023-10-14)
includes/statement.h (2192, 2023-10-14)
src/ (0, 2023-10-14)
src/buffer.cpp (612, 2023-10-14)
src/data.cpp (18877, 2023-10-14)
src/database.cpp (3782, 2023-10-14)
src/main.cpp (607, 2023-10-14)
src/node.cpp (4388, 2023-10-14)
src/pager.cpp (4412, 2023-10-14)
src/statement.cpp (12313, 2023-10-14)
test/ (0, 2023-10-14)
test/tests.cpp (13139, 2023-10-14)
# SQLite-CPP
### A C++ implementation of a simple database, created attempting to imitate the internal design of SQLite. Made with help of [this guide](https://github.com/cstack/db_tutorial) and [this book](https://books.google.com/books?id=OEJ1CQAAQBAJ).
### Requiremets
Made for Windows. You also need to have **CMake** installed in order to build the project.
### Installation
1. Clone the repository:
```
git clone https://github.com/lizardwizardd/SQLite-CPP
```
2. Set up the project using CMake:
```
cd SQLite-CPP
cmake -S . -B ./build
```
3. Compile the project:
```
cmake --build ./build
```
4. After compiling you can run database using *db.exe*, or execute tests using *tests.exe*.
### Supported commands
- ```create table [table-name]``` - create a new *[table-name].db* file and open it.
- ```open table [table-name]``` - open an existing *[table-name].db* file.
- ```drop table [table-name]``` - delete an existing *[table-name].db* file.
- ```insert [id] [string1] [string2]``` - insert a new row into an opened database. Length of [string1] <= 32, [string2] <= 255.
- ```update [id] [string1] [string2]``` - update an existing row with new [string1] and [string2] values.
- ```select``` - print all rows from the opened database, sorted by primary key in ascending order.
- ```.save``` - save database.
- ```.exit``` - save database and exit the program.
- ```.btree``` - debug command. Prints all inserted row keys in a B-Tree structure.
- ```.constants``` - debug command. Print sizes of constants.
近期下载者:
相关文件:
收藏者: