JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q92439F
  • License MIT

sow core engine — analyze, sample, sanitize, and branch Postgres databases for safe coding-agent sandboxes

Package Exports

  • @sowdb/core

Readme

@sowdb/core

Core engine for sow -- analyze, sample, sanitize, and branch Postgres databases.

Install

npm install @sowdb/core

Usage

import {
  PostgresAdapter,
  analyze,
  createSampler,
  createSanitizer,
  createExporter,
  createBranch,
  detectConnection,
} from "@sowdb/core";

// Analyze a database
const adapter = new PostgresAdapter();
await adapter.connect("postgresql://user:pass@host:5432/mydb");
const analysis = await analyze(adapter);

// Detect connections in a project
const detection = detectConnection("/path/to/project");
console.log(detection.connections);

// Create a branch
const branch = await createBranch("my-feature", "connector-name");
console.log(branch.connectionString);

Provider System

sow uses a provider plugin system for branch management:

import type { BranchProvider } from "@sowdb/core";

class MyProvider implements BranchProvider {
  readonly name = "my-provider";
  async detect() { /* ... */ }
  async createBranch(opts) { /* ... */ }
  // ...
}

See CONTRIBUTING.md for how to add a new provider.

License

MIT