Docs
/

@leumas/middleware

Adapter/connector engine — the BaseAdapter contract + loader + a libSQL adapter for schema-less dynamic collections (universal CRUD over the shared leumas.db).

@leumas/middleware

The adapter/connector engine (P1 slice). Provides the schema-less dynamic CRUD path that complements the typed core in @leumas/db — both over the same leumas.db.

  • BaseAdapter — the one storage-adapter contract (harvested from legacy leumas-middleware).
  • LibsqlAdapter — stores each app-defined collection as dyn_<name> (id, data JSON, owner, public, timestamps), created on first write.
  • createConnector(config) — the loader (defaults to a single libSQL adapter).
  • createDynamicCrudRouter({ adapter, requireAuth }) — Express CRUD at /db/:collection, ownership-gated. requireAuth is injected so this engine stays decoupled from @leumas/auth.
import { createConnector, createDynamicCrudRouter } from '@leumas/middleware';
import { requireAuth } from '@leumas/auth';
const connector = createConnector();
app.use('/db', createDynamicCrudRouter({ adapter: connector.get(), requireAuth }));

The full adapter loader/introspection engine + the a./b. adapter packs land in P3; P1 ships only the DB-connector slice needed for dynamic app data.

Source shared/engines/middleware/README.md (no-git)markdownjson
Generated from the Leumas repository. Every page cites the file it came from.leumas.techllms.txt