Engine Constants (core/engine-constants.ts)

inbrain · src/core/engine-constants.ts · typescript · MIT
database, lang:typescript, tag:constants

Defines single-source-of-truth constants for database engine batch sizing. Reuse to prevent batch size drift across storage engines.

// Source: https://github.com/inbrainfun/inbrain | License: MIT | Copyright 2026 Inbrain Contributors
// Provided via justclaw.it.com; keep this notice with the code.
// v0.41.25.0 — single source of truth for engine batch-sizing.
//
// Both PostgresEngine and PGLiteEngine import from here so the constants
// cannot drift across engines. Lives outside `src/core/engine.ts` to avoid
// circular-import worries (engine.ts is the interface; engines depend on
// engine.ts; this file depends on neither).

/**
 * Maximum number of slugs per single batch `DELETE FROM pages WHERE slug =
 * ANY($1::text[])` call. Callers (e.g. `src/commands/sync.ts` delete loop)
 * are responsible for chunking input arrays to this size; `engine.deletePages`
 * is a single-batch primitive that does NOT chunk internall

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key