bitabase - Server

This is a very early attempt at the bitabase rest server.
Getting Started
From the CLI
Running the following:
npm install --global bitabase-server
bitabase-server --help
Will output the below:
📦 Bitabase-Server - v1.15.1
The scalable, sharded database engine.
https://docs.bitabase.com
The following commands and arguments are available when starting Bitabase
Commands:
start Start the bitabase server stack
--bind-host Hostname to bind server to (default: 0.0.0.0)
--bind-port Port to bind server to (default: 8000)
--rqlite-addr Path to contact rqlite
--database-path Where to store rqlite transaction log (default: /tmp/sqlite-bitabase)
--database-keep-alive How long to keep sqlite database connections alive
No command specified
You can start a bitabase server by running:
bitabase-server start
From NodeJS
const bitabaseServer = require('bitabase-server/server');
const server = bitabaseServer({
bindHost: '0.0.0.0'
});
server.start();
Endpoints
| Method | Path | Description |
---|
Collections
Collections are groups of records that belong to a database
|
1.1 | POST | /v1/databases/:databaseName/collections | Create a new collection |
1.2 | GET | /v1/databases/:databaseName/collections | List all collections |
1.3 | GET | /v1/databases/:databaseName/collections/:collectionName | Read a specific collections |
1.4 | PUT | /v1/databases/:databaseName/collections/:collectionName | Update a collection schema |
Records
Records are stored in a collection and must adhere to the schema
|
2.1 | POST | /v1/databases/:databaseName/records/:collectionName | Create a new record |
2.2 | GET | /v1/databases/:databaseName/records/:collectionName?query={} | Search through records |
2.3 | DELETE | /v1/databases/:databaseName/records/:collectionName?query={} | Delete queried records |
2.4 | GET | /v1/databases/:databaseName/records/:collectionName/:recordId | Get a specific record |
2.5 | PUT | /v1/databases/:databaseName/records/:collectionName/:recordId | Update a specific record |
2.6 | PATCH | /v1/databases/:databaseName/records/:collectionName/:recordId | Partially update a specific record |
2.7 | DELETE | /v1/databases/:databaseName/records/:collectionName/:recordId | Delete a specific record |
Logs
When a record method fails a log will be stored containing information on the failure
|
3.1 | GET | /v1/databases/:databaseName/logs/:collectionName | Search through logs |
License
This project is licensed under the terms of the AGPL-3.0 license.