Hello contributors! I am the author of project Tosbit, which aims at providing very simple syntax grammar for database commands, following relational database theory & design. Also there are some key features that we are trying to implement in it to keep the mommentum going & contributing with new ideas. Started it as a hobby project with excuse of college's minor project, but would really love to see it evolving with improvements. I invite all interested developers to freely discuss & contribute to this open-source project.
- Relational design
- Simple syntax grammar
- Precise error messages
- Media file storage facility
- CSV-like data storage
- High performance
- Lightweight nature
- Unambiguous parsing
- Architecture (existing): x86, x86_64
- Architecture (coming soon...): RISC-V, ARM-Cortex (M/R/A)
- Platform: Any Linux distro
- RAM: A few megabytes
- Space: A few megabytes
assets/
- Contains media files & images for testing purpose.dist/
- Contains object (.o
) files as result of intermediate compilation.docs/
- Contains brief documentation files.exec/
- Contains makefiles, application directories & executables.include/
- Contains header (.h
) files for all the used source code files.lib/
- Contains all the statically linked libraries/APIs.scripts/
- Contains Bash scripts for automation.src/
- Contains all the source code (.c
) files.test/
- Contains source files which were used in unit testing of components.
NOTE: Most directories & nested directories contain their own README files for more information regarding their contained directories.
These installation steps are for those who are willing to download the release:
- Get the
.tar.gz
file from GitHub.
wget https://github.com/Gourav-334/Tosbit/releases/download/Tosbit-v0.1.1/Tosbit-v0.1.1-Linux.tar.gz
- Extract this
.tar.gz
file.
tar -xzvf Tosbit-v0.1.1-Linux.tar.gz
- Allow permission to it.
chmod +x Tosbit-v0.1.1-Linux/*
- Navigate inside the directory.
cd Tosbit-v0.1.1-Linux
- Try running engine or server.
./engine
./server 8080 # Create account in engine first before running server.
For installation by developers having cloned the repository, follow the given steps (assuming you to be in parent directory of repository):
- Install required tools for our database:
bash scripts/alpinelinux.sh # Only for Alpine Linux.
bash scripts/arch.sh # Only for Arch, Manjero & EndeavourOS.
bash scripts/fedora.sh # Only for Fedora, RHEL, Rocky & AlmaLinux.
bash scripts/opensuse.sh # Only for openSUSE.
bash scripts/ubuntu.sh # Only for Debian & Ubuntu.
bash scripts/voidlinux.sh # Only for Void Linux.
- Set up environment using CMake:
cd exec
mkdir build
bash remake.sh 1
cd build
cmake ..
make
cd ../..
- Alternatively (but discouraged), use Bash scripts for compilation & linking:
cd scripts
bash compileAll.sh
bash linkAll.sh
cd ..
- (Optional) Run the server component with an argument telling what port to run it on:
cd exec/build
./server 8080
cd ../..
- Try running Tosbit engine now:
cd exec/build
./engine
cd ../..
Follow the given steps for using in-code Tosbit in C:
- Navigate to
exec/build/
& create a C source (.c
) file:
cd exec/build
touch myfile.c
- Open this file with your favorite code editor, I would be using GNU Nano:
nano myfile.c
- Write the following code in it:
#include "../../include/driver_manager.h"
int main(void)
{
/* Enter 'Username', 'Password' & 'Hostname' as per your entered credentials. */
setConnection("Username", "Password", "Hostname", 8080, "Username", "Password", FALSE);
interpret("SHOW ALL DB");
interpret("MAKE DB mydb");
interpret("SHOW ALL DB");
endConnection();
return 0;
}
- Link against
tosbitAPI.a
static library:
gcc myfile.c \
-I/usr/include -I/usr/include/readline -I../../include \
-L/usr/lib/x86_64-linux-gnu -L../../lib \
-ltosbitAPI -lreadline -lhistory -lncurses \
-o myfile
- Run the server:
./server 8080
NOTE: If it doesn't work, try changing port number argument here & in code too.
- Run the created executable:
./myfile
- This was a very basic tutorial on very painlessly using in-code Tosbit using GCC.
- Also the linking stage we went through (step 4) was considering the user to be at
exec/build/
of repository. - One must know how to link libraries using GCC to link
libtosbitAPI.a
present atlib/
. - And there is no worry of space in embedded systems regarding it, because linking is just a one time process.
data/
db_name/
tbl_name/
details.tosbit
rows.tosbit
metadata.tosbit
tables.tosbit
metadata.tosbit
databases.tosbit
metadata.tosbit
logs/
users/
user.tosbit
NOTE: Dots (
.
) in code sections below are spaces, added for clarity.
name............................,string,unique.,5.\n
age.............................,int...,regular,4.
- Attribute name
- Data type
- Key type
- Length of largest value in an attribute.
10,10,6.
- Length of largest attribute name (larger than 10)
- Length of largest data type name (larger than 10)
- Length of largest key type (larger than 6)
table1..........................\n
table2..........................
- Table's name
6.
- Length of largest table.
db1.............................\n
db2.............................\n
mydb............................
- Name of database
- Name of its largest tables.
10
- Length of largest database name (larger than 10).
logs/
directory contains all the log history in JSON format.- These are easy to access in the local file system.
user/tosbit
contains all the user credential in encrypted form.
For anyone willing to connect with me, I am more than happy to connect back.