MCPcopy Index your code
hub / github.com/blackboardsh/goldfishdb

github.com/blackboardsh/goldfishdb @v0.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.3 ↗ · + Follow
57 symbols 80 edges 14 files 0 documented · 0% updated 32d ago★ 51
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GoldfishDB

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

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

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 38
Interface 14
Class 3
Method 2

Languages

TypeScript100%

Modules by API surface

src/core/abstractClass.ts20 symbols
src/core/types.ts14 symbols
src/core/schemaUtils.ts14 symbols
src/node/index.ts4 symbols
src/core/utils.ts4 symbols
test/unit/abstractClass.test.ts1 symbols

For agents

$ claude mcp add goldfishdb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page