Xen.db Is An Open-Sourced Database Package Designed To Be Easy-To-Use & Friendly For Beginners. This Package Meant To Provide Easy Way For Users To Access & Store Various Data Persistently In A Database Via BetterSQLite3.
- Powerful - Supports Non-Xen.db API.
- Customizable - More Utility Method.
- Family-Friendly - Simple & Easy-To-Use For Beginners.
- 100% Based - Key Value Based.
- Persistent Database - Value Will Not Lost When On Retstarting Session.
- Free-To-Use - Not Needed To Set Up A SQL Database Server! All Data Is Stored Locally In The Same Project.
- Best Friends - Supports Your Existing Quick.db
json.sqlite
Database. - Free Vehicles - Easily Switch/Migrate Library Between Xen.db & Quick.db Library If You're Using
json.sqlite
File As Database. - Work Together - Support Various Of Supported Library Such As Above.
- Added New Method -
(method) Database.fetchOne()
Alias:(method) Database.getOne()
(method) Database.fetchOne()
- Fetch A Specific Value(s) From The Database Key.- Repaired - Fixed Minor Bugs
Coding A Sandbox (Demo)
const { Database } = require("xen.db")
const db = new Database()
// Setting an object in the database:
db.set('userInfo', { difficulty: 'Easy' })
// -> { difficulty: 'Easy' }
// Pushing an element to an array (that doesn't exist yet) in an object:
db.push('userInfo.items', 'Sword')
// -> { difficulty: 'Easy', items: ['Sword'] }
// Adding to a number (that doesn't exist yet) in an object:
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }
// Repeating previous examples:
db.push('userInfo.items', 'Watch')
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }
// Fetching individual properties
db.get('userInfo.balance') // -> 1000
db.get('userInfo.items') // ['Sword', 'Watch']
const table = db.createTable("MyTable")
db.set("Inv", "Sword")
table.set("Inv", 123)
db.get("Inv") // Returns "Sword"
table.get("Inv") // Returns "123"
const tables = db.tables()
console.log(tables)
If you're having some troubles installing this, please follow this Troubleshooting Guide.
npm i xen.db
Note: Windows platform users might need to do additional steps Here.
- Install: XCode
- Run:
npm i -g node-gyp
in your console/terminal - Run:
node-gyp --python /path/to/python2.7
(Skip this step if you didn't install Python 3.x) - Finally, Run:
npm i xen.db
- Soon!
- If You Need Help, Please Join Our Support Server