idb
Comprehensive IndexedDB wrapper providing a simple Promise-based API for client-side database operations with schema parsing, queries, and transactions.
Functions
open
Open or create an IndexedDB database
dphelper.idb.open('mydb', 1, { users: 'id++,name,email' })
put
Insert or update a record
dphelper.idb.put('mydb', 'users', { name: 'John' })
get
Get a record by key
dphelper.idb.get('mydb', 'users', 1)
getAll
Get all records from a store
dphelper.idb.getAll('mydb', 'users')
delete
Delete a record by key
dphelper.idb.delete('mydb', 'users', 1)
clear
Clear all records from a store
dphelper.idb.clear('mydb', 'users')
count
Count records in a store
dphelper.idb.count('mydb', 'users')
query
Query records by index
dphelper.idb.query('mydb', 'users', 'name', 'John')
bulkPut
Insert or update multiple records
dphelper.idb.bulkPut('mydb', 'users', [{name: 'A'}, {name: 'B'}])
close
Close a database connection
dphelper.idb.close('mydb')
Description
A powerful IndexedDB wrapper that simplifies browser storage with:
Promise-based API - All operations return Promises for easy async/await
Schema Parsing - Simple string-based schema definition (e.g.,
'users: id++,name,email')Auto-increment Support - Built-in support for auto-incrementing keys
Index Support - Create and query by indexed fields
Transaction Management - Automatic transaction handling
Database Caching - Connection pooling for better performance
Usage Examples
Opening a Database
Schema format: storeName: keyPath*indexes where:
++= auto-incrementing key*= string key!after field = unique index
CRUD Operations
Bulk Operations
Queries
Counting and Clearing
Advanced Usage
Complete CRUD Application
Offline-First Data Sync
Details
Author: Dario Passariello
Version: 0.0.1
Creation Date: 20260313
Last Modified: 20260313
Environment: Client-side only (browser)
Automatically generated document
Last updated