npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@medyll/idae-idbql

v0.185.4

Published

A powerful and flexible IndexedDB query library for TypeScript and JavaScript applications, offering a MongoDB-like query interface, strong TypeScript support, reactive state management, and easy integration with front-end frameworks like Svelte.

Readme


@medyll/idae-idbql

Flexible State Management meets powerful IndexedDB queries. A reactive, type-safe wrapper for IndexedDB, compatible with Svelte 5 Runes or idae-stator.

Features

  • Advanced Query Engine: Use powerful operators like $gt, $in, $or, and more via a clean query object syntax.
  • State Agnostic: Native support for Svelte 5 Runes or idae-stator.
  • Full CRUD + Logic: Complete API for complex data manipulation (updateWhere, deleteWhere, etc.).
  • Type-Safe: Deep type inference for your models and query results.

Quick Start

1. Define your model

const model = {
    users: { keyPath: '++id', ts: {} as User },
    tasks: { keyPath: '++id, priority', ts: {} as Task }
};

2. Choose your State Engine

Option A: Svelte 5 (Runes)

Ideal for Svelte components. Use $derived() to keep your UI in sync with the database state.

<script lang="ts">
import { createIdbqDb } from '@medyll/idae-idbql';

const { idbql } = createIdbqDb(model, 1).create('my_app_db');

// Use $derived to create reactive views of your data
let adults = $derived(idbql.users.where({ age: { $gte: 18 } }));
</script>

{#each adults.value as user}
    <p>{user.name}</p>
{/each}

Option B: idae-stator

Perfect for decoupled logic. Access state changes via the onchange callback.

import { createIdbqDb } from '@medyll/idae-idbql';

const { idbql } = createIdbqDb(model, 1, { engine: 'stator' }).create('my_app_db');

const query = idbql.users.where({ role: 'admin' });

query.onchange((oldValue, newValue) => {
    console.log('Data updated:', newValue);
});

API Reference

Reading Data

  • get(id) / getOne(query) / getAll()
  • getBy(key, value)
  • count(query)
  • where(query): Advanced filtering with operator support.

Writing Data

  • create(data) / put(data)
  • update(id, changes)
  • updateWhere(query, changes): Bulk updates based on criteria.

Deleting Data

  • delete(id)
  • deleteWhere(query): Bulk deletion based on criteria.

Query Example

// Complex filtering with object-style syntax
const results = await idbql.posts.where({
    status: 'published',
    tags: { $in: ['svelte', 'idb'] },
    views: { $gt: 100 },
    $or: [
        { author: 'Mydde' },
        { featured: true }
    ]
}).toArray();

Project Structure

graph TD
    A[IndexedDB] --> B[Core]
    B --> C[Collection]
    C --> D[Query Engine]
    C --> E[CRUD Operations]
    B --> F[State Layer]
    F --> G[Svelte 5 / idae-stator]
  • Core: Lifecycle, versioning, and connection handling.
  • Collection: CRUD abstraction and query engine.
  • State: Bridging layer for Svelte 5 and idae-stator.

Development

  • Test: npx vitest (using fake-indexeddb).
  • Check: npm run check.
  • Build: npm run build.

License

MIT © Medyll

Author: Lebrun Meddy (@medyll)