Lixbase @2.0.0 []
A manual sharded and managed NoSQL object-focused database made for the cool kids.
Built with 💛 by Nitlix
- Nitlix - The creator of this project
Installation
Using NPM:
$ npm i lixbase --save
or
$ npm install lixbase --save
Features
More added soon.
Quickstart showcase
🥳 showcase.js
Here is our initial starting file, where we use Lixbase to manage our database files.
import Lixbase from "./src/index.js"
async function main() {
let client = new Lixbase.Client
client.objects.account = {
id: null,
type: null,
data: null,
created: null
}
client.objects.session = {
id: null,
type: null,
data: null
}
client.dir = 'custom_dir_name'
client.format.id = '[SHARD]-[TIME]-[RANDOM]'
client.autosave = -1
client.autosave = 10
await client.init("shard_name")
client.addObject('account', {data: 'test', created: Date.now()})
client.addObject('session', {data: 'test2'}, 5)
client.addObject('session', {data: 'test3'}, 5)
console.log(
client.query(['*'], (data)=>{
if (data.data == 'test') {
return true
}
return false
}, ['data', 'created'])
)
client.save()
}
main()
✅ The output JSON
The file used to store and manage our database's object located at (custom_dir_name/shard_name.json).
😎 Documentation
Lixbase is assumed to be imported as "Lixbase" using
import Lixbase from "lixbase"
Client
Initialise using:
let client = new Lixbase.Client
Client Properties
Data
client.data
client.data.id['hello'] = 'world'
Shard
client.shard
client.init("Shard goes here")
Autosave
client.autosave
Object types
client.objects
client.objects.account = {
id: null,
type: null,
name: null,
data: null
}
Directory
client.dir
Database Orientation
client.databaseOrientation
client.databaseOrientation = {
'id': {},
'batch': {},
'pets': {
'cats': [],
'dogs': []
}
}
Formats
client.format.id
client.format.id = '[SHARD]-[TIME]-[RANDOM]'
client.shard = 'N1'
client.format.id = '[SHARD]-[NEXT]'
'N1-0'
'N1-1'
Backups
client.backups.enabled
client.backups.interval
client.backups.dir
client.backups.format
client.backups.format = '[SHARD]-[TIME]'
⚒️ Functions
.init()
await client.init(shard)
This library is still being developed. It may have some bugs!
More docs coming later!