Greasy Fork镜像 is available in English.

iDB Helper

Helpful features to make Indexed DB easier to use

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyforks.org/scripts/541499/1618285/iDB%20Helper.js

作者
they hoppingonme
版本
1.01
创建于
2025-07-03
更新于
2025-07-03
大小
13.4 KB
许可证
暂无

**Enhanced IndexedDB Helper - Comprehensive Client-Side Database Utility**

This JavaScript library is a powerful wrapper around the browser's IndexedDB API that transforms complex database operations into simple, intuitive method calls. It's designed to make client-side data storage as easy as using localStorage while providing enterprise-grade database features.

**What it does:**
The script provides a complete solution for storing, retrieving, and managing data in the browser's built-in database. Instead of dealing with IndexedDB's verbose callback-based API, developers can use simple async/await syntax for all database operations. It handles database setup, transactions, error management, and provides advanced querying capabilities.

**Key capabilities:**
- Basic CRUD operations (Create, Read, Update, Delete) with simple method names
- Bulk operations for handling multiple records efficiently
- Advanced filtering and searching through stored data
- Index-based queries for fast data retrieval
- Database backup and restore functionality
- Automatic error handling and event management
- Support for structured data with auto-incrementing keys

**Perfect for:**
- Web applications that need offline functionality
- Progressive Web Apps (PWAs) requiring local data storage
- Apps that cache API responses to improve performance
- Form applications that auto-save user input
- Any web app needing to store user preferences or settings
- Applications handling large datasets that need efficient querying

**Technical benefits:**
- Promise-based API that works seamlessly with modern async/await syntax
- Handles complex IndexedDB transactions automatically
- Provides database indexing for fast searches
- Memory-efficient cursor-based operations for large datasets
- Cross-browser compatible with all modern browsers
- Production-ready with comprehensive error handling

**Use cases:**
The script is ideal for developers building modern web applications that need reliable client-side data storage. Whether you're creating a note-taking app, an e-commerce site that caches product data, a productivity tool that works offline, or any application requiring fast, structured data storage in the browser, this helper simplifies the entire process from a complex 50+ line IndexedDB setup down to just a few simple method calls.

长期地址
遇到问题?请前往 GitHub 提 Issues。