Skip to content

This is pretty bad and stupid way to make database

Notifications You must be signed in to change notification settings

Szymon423/SQLame

Repository files navigation

SQLame logo

SQLame

That's my attempt to create most Lame, and propably slowest database.

Idea

Main idea is to create database engine which allows to store data.

Important

But worse.

Connection mechanism

I want it to provide TCP connection, by this I mean HTTP/HTTPS, and rest API

Querries

As name of this project suggest I want it to be SQL'ish - but worse. It won't be pure SQL syntax, but SQL in JSON.

{
    "SELECT": {
        "COLUMNS": ["id", "value", "valid"],
        "FROM": "my_table",
        "WHERE": {
            "id": {
                "IN": [123, 456],
            }
        },
        "ORDER": {
            "BY": "id",
            "HOW": "ASC"
        }
    }
}

Management

I want this engine to be managable from website. And here as always Vue.js.

Data processing

I want data to be compressed, and encrypted.

  • Compression - Zstandard
  • Encryption - openssl/AES (Advanced Encryption Standard)

File system

data/ - the main directory containing all database data.
│
├── metadata/ - directory containing metadata files.
│   ├── tables/ - directory containing metadata about tables.
│   │ └── table_name.meta - metadata file for a specific table.
│   └── indexes/ - directory containing metadata about indexes.
│       └── index_name.meta - metadata file for a specific index.
│
├── tables/ - directory containing table data.
│   └── table_name/ - directory for a specific table.
│       ├── data.db - data file storing the actual table records.
│       └── index_name.idx - index file for a specific table.
│
└── logs/ - directory containing transaction log files.
    └── log_0001.log.

Dependencies

Install with vcpkg

vcpkg install nlohmann-json
vcpkg install spdlog
vcpkg install POCO
vcpkg install POCO[netssl]

Note

Project will compile without problems if vcpkg is inside of this same directory as SQLame

Projects\
├── SQLame\
├── vcpkg\

TODO

  • resolve CREATE TABLE querry
  • resolve DROP TABLE querry
    • delete also table data
  • resolve INSERT VALUES querry
    • check not null values
    • check unique values
    • use of autoincrement
  • resolve SELECT querry