An open API service indexing awesome lists of open source software.

https://github.com/kharastudio/xyharadb

XyharaDB adalah library database lokal berbasis file (.xydb) yang dibuat dengan JavaScript (Node.js), menggunakan bahasa query buatan sendiri bernama XQL. Mendukung mode library dan console interaktif, sederhana, cepat, dan mudah dipahami.
https://github.com/kharastudio/xyharadb

database db-engine db-management hara khara xql xyhara xyharadb xyra

Last synced: 4 months ago
JSON representation

XyharaDB adalah library database lokal berbasis file (.xydb) yang dibuat dengan JavaScript (Node.js), menggunakan bahasa query buatan sendiri bernama XQL. Mendukung mode library dan console interaktif, sederhana, cepat, dan mudah dipahami.

Awesome Lists containing this project

README

          


XyharaDB Documentation

XyharaDB Banner

XyharaDB


XyharaDB is a lightweight file-based database framework built with Node.js.
It uses a single .xydb file to store data and does not require
any external database server or API.


This project is designed for CLI tools, small to medium projects,
offline systems, experiments, and learning how database engines work internally.


Main Characteristics



  • File-based database (.xydb)

  • No server required

  • No external API dependency

  • Simple query language

  • Console (interactive CLI) mode

  • Auto-clean expired data

  • Audit log system

  • Backup and restore support

  • Error system similar to real databases


What Is New



  • Audit logging to XyharaDB.log

  • Custom database error system

  • Backup command

  • Restore command

  • Improved console exit handling

  • More consistent error messages


Project Structure


XyharaDB/
├── README.md
├── console.js
├── XyharaDB.xydb
├── XyharaDB.log
├── home/
│ └── XyharaDB.js
├── utils/
│ ├── dbError.js
│ └── auditLogger.js
├── tests/
│ ├── testInsert.js
│ ├── testUpdate.js
│ └── testDelete.js
├── package.json
└── package-lock.json


Installation


git clone https://github.com/KHaraStudio/XyharaDB.git
cd XyharaDB
npm install


Basic Usage

Import



import XyharaDB from "./home/XyharaDB.js";

Initialize Database



const db = new XyharaDB({
open_console: true
});


If the file XyharaDB.xydb does not exist, it will be created automatically.
Existing data will never be deleted unless explicitly removed.


Console Mode


When open_console is enabled, an interactive console will start.


XyharaDB>


To exit the console:


keluar


Query Commands

Create / Insert Data



TAMBAH KE users (id, name, age) NILAI (1, 'KHara', 17)

Select Data



LIHAT SEMUA DARI users

Update Data



UBAH users SET age=18 DIMANA id=1

Delete Data



HAPUS DARI users DIMANA id=1

List Tables



LIHAT TABEL


Cache With Expire


TAMBAH KE cache (id, value) NILAI (1, 'hello') EXPIRE 5


Data will be automatically removed after the expiration time.


Backup and Restore

Backup Database



BACKUP KE backup.xydb

Restore Database



RESTORE DARI backup.xydb


Audit Log System


All important operations are logged automatically to:


XyharaDB.log


Example log entry:


{
"time": "2026-01-19T08:59:22.995Z",
"action": "INSERT",
"table": "users",
"id": "1",
"data": { "name": "KHara", "age": 17 }
}


Error System


XyharaDB uses a structured error system similar to real databases.

Example:


[XY1001] Kesalahan sintaks di dekat 'UBAH users SET age=18 DIMANA id=1'


Errors are descriptive and do not crash the database.


Data Safety


  • Database file is never deleted automatically

  • Data persists between program runs

  • Backup is manual and explicit


Use Cases


  • CLI tools

  • Offline applications

  • Small web backends

  • Game save systems

  • Learning database internals


License


Open-source project by KHaraStudio.
Free to use, modify, and distribute.



XyharaDB — Developed by KHaraStudio