@dbsp/types
v1.0.1
Published
Shared type definitions for the db-semantic-planner ecosystem
Maintainers
Readme
@dbsp/types
Shared TypeScript contract types for the @dbsp ecosystem — ModelIR, IntentAST, PlanReport, and the Adapter interface.
Installation
pnpm add @dbsp/typesUsage
// doctest: skip — illustrative data/type literal fragment (TypeScript type annotations and { ... } placeholder not executable code)
import type { ModelIR, IntentAST, PlanReport, Adapter } from '@dbsp/types';
// Type-check your adapter implementation
const myAdapter: Adapter = { ... };
// Annotate plan report handlers
function inspect(report: PlanReport): void {
for (const decision of report.decisions) {
console.log(decision.kind, decision.reason);
}
}Key types
ModelIR— Schema representation: tables, columns, relations, constraints, RLS policiesIntentAST— Declarative query intent: selections, filters, includes, orderingPlanReport— Planner output: decisions, warnings, simplified plan used by adaptersAdapter— Port interface every adapter must implement (compile,execute,withSchema)DialectCapabilities— Feature flags negotiated between core and an adapter
Notes
@dbsp/types is a zero-dependency package with no runtime code — it is types-only. All @dbsp/* packages share this contract, which breaks the circular dependency between core and adapter-pgsql.
Documentation
See the architecture overview and guides for details.
License
MIT
