đ NANODbFetch driver
NANODbFetch is a database class built on top of NANODatabase, using IndexedDB for local caching of fetched data. It supports efficient data fetching, filtering, and storage using IndexedDB, allowing seamless offline access and synchronization with remote servers.
đ Features
- IndexedDB-based caching
- Fetch data from a remote source or cache
- Filter-based data retrieval
- Manifest-based data storage and retrieval
- Change tracking and merging
- Storage usage calculation
đ Usage
import { NANODbFetch } from 'nano-db-fetch'
const fetchDb = new NANODbFetch('/', {
inherit: true,
extend: true,
globals: true,
refs: true,
root: 'http://localhost'
})
await fetchDb.load()
const index = await fetchDb.get('/index')
const nodes = await fetchDb.findAllNodes()
const newData = { content: ['Empty content'] }
await fetchDb.set('/index', newData)
const usage = await fetchDb.getUsage()