SkillAgentSearch skills...

Goldfishdb

A lightweight in-memory document database with TypeScript-first design and atomic writes.

Install / Use

/learn @blackboardsh/Goldfishdb
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

GoldfishDB

A lightweight in-memory document database with TypeScript-first design and atomic writes.

Powers Co(lab). Perfect as a local data store for your Electrobun apps.

Features

  • TypeScript-first: Full type safety with zero configuration
  • In-memory: Loads entire database into memory for fast access
  • Encrypted by default: AES-256-GCM encryption with optional custom passphrase
  • Atomic writes: Protection against data corruption during interruptions
  • Schema migrations: Built-in versioning and migration system
  • Zero build step: Works directly with TypeScript
  • Collections: Document-based storage with automatic ID generation

Installation

npm install goldfishdb

Quick Start

import DB from 'goldfishdb';

// Define your schema
const schema = {
  v: 1,
  stores: {
    users: {
      type: "collection",
      schema: {
        name: { type: "string", required: true },
        email: { type: "string", required: true },
        age: { type: "number", required: false }
      }
    }
  }
};

// Initialize database with default encryption
const db = new DB<typeof schema>().init({
  schemaHistory: [{ v: 1, schema, migrationSteps: false }],
  db_folder: './data'
});

// Or with custom passphrase for production
const prodDb = new DB<typeof schema>().init({
  schemaHistory: [{ v: 1, schema, migrationSteps: false }],
  db_folder: './data',
  passphrase: 'your-production-secret'
});

// Use the database
const user = db.collection('users').insert({
  name: "John Doe",
  email: "john@example.com",
  age: 30
});

const allUsers = db.collection('users').query();
const userById = db.collection('users').queryById(user.id);

Key Benefits

  • Underserved niche: Perfect for applications that need a simple, typed database without the complexity of full database systems
  • Fully typed: Get complete IntelliSense and type checking on your data
  • Best practices: Built-in patterns for schema evolution and data safety
  • No build step required: Works directly in your TypeScript workflow

Use Cases

  • Development and prototyping
  • Small to medium applications
  • Applications requiring full type safety
  • Local-first applications
  • Configuration and settings storage

License

MIT

Related Skills

View on GitHub
GitHub Stars39
CategoryData
Updated9d ago
Forks4

Languages

TypeScript

Security Score

90/100

Audited on Mar 18, 2026

No findings