Zorix DBSimple & Fast IndexedDB Library
Super fast, lightweight, and type-safe database for your web apps. Working with IndexedDB has never been this easy.
Super fast, lightweight, and type-safe database for your web apps. Working with IndexedDB has never been this easy.

import { DB, schema, string, number } from '@zorix/zorixdb';
// 1. Connect to database
const db = new DB('my-app', { version: 1 });
// 2. Listen for database changes easily
db.on('change', (event) => console.log('Data changed:', event));
// 3. Define schema with type safety
const Users = await db.model(
'users',
schema({
id: number().primary(),
name: string().index(),
age: number(),
})
);
// 4. Fast bulk insert in one single transaction
await Users.insertMany([
{ id: 1, name: 'Alice', age: 25 },
{ id: 2, name: 'Bob', age: 30 },
]);
// 5. Query data using simple, clean syntax
const adults = await Users.find({ where: { age: { gte: 18 } } });
console.log(adults);