Simple database engine and binary format. Yet another university sucksignment. /drop
MIT License
Simple database engine and binary format. Yet another university sucksignment.
Article on habr.com describing dropSQL internal architecture and design: https://habrahabr.ru/post/347274/
dropSQL is a query language, similar to SQL found in modern DBMS implementations. While keywords and identifiers are case-insensitive, most noticeable distinctions are that
/
),/drop
' keyword,parser/tokens/keywords.py
file.Just as SQLite3 does, dropSQL has a master pseudo-table called '/autism'. 'Pseudo' means that it is not regular table, in terms of storage. But it conforms to standard query API, so can be queried as usual. Note that master table can not be modified directly.
dropSQL supports basic CRUD operations:
/where
clause filter. Implemented joins are:
,
)a /join b /on condition
syntaxCLI comes with neat multi-line REPL. Start typing a statement like /create table fruits(
, hit enter, and dropSQL will kindly ask you to proceed with different prompt style (...
instead of /
). It will keep reading input until whole statement is typed in. Only then the execution begins, and results are printed back to user.
Storage consists of 12KB blocks. First block contains database name and number of allocated blocks. Next 16 blocks contain table descriptors. Table descriptor contains:
Data blocks contain continuous sequence of table records. Each record starts with 'alive'/'removed' mark.
Storage driver allows inserting, deleting, updating and selecting records by internal ID, as well as creating and dropping tables.
Things we dream of, but have not implemented yet include:
... /where name = (/select ... from ...) /drop
.0-N
.$ python3 setup.py test
$ python3 setup.py sdist
$ python3 setup.py install
Executable script should be installed by setup.py install
:
$ dropSQL [path/to/database/file]
Alternatively:
$ cd path/to/dropSQL/src && python -m dropSQL [path/to/database/file]
If you don't specify a path to database, by default non-persistent in-memory storage will be used.
Actually, 'drop' is a process of getting the axe by a student, which is usually expressed as a '/drop' slashtag in Telegram group chats.
'/autism' is an another popular phenomena and frequently used slashtag in Innopolis.