@lssm-tech/tool.contractspec-drizzle-gentool.contractspec-drizzle-gen
Generator that compiles ContractSpec defineDatabaseTable specs into Drizzle pgTable definitions, relations, and an RLS adapter manifest.
@lssm-tech/tool.contractspec-drizzle-genSource, release and verification context
Source snapshot bcc79fcc · Declared package version 3.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.
See where this package fits.
Follow a declared connection, inspect an import, then open the source guide when you need the detail.
Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.
@lssm-tech/tool.contractspec-drizzle-gen
Deterministically compile ContractSpec physical-table declarations into typed Drizzle pgTable definitions and an optional tenant-RLS evidence manifest.
Usage
import {
defineDatabaseTable,
defineUnscopedDatabaseTable,
} from "@lssm-tech/lib.contracts-spec/database";
import { generateContractSpecDrizzle } from "@lssm-tech/tool.contractspec-drizzle-gen";
const claims = defineDatabaseTable({
name: "grace_claims",
columns: [
{ name: "id", type: "uuid", nullable: false },
{ name: "tenant_id", type: "uuid", nullable: false },
{
name: "status",
type: "text",
nullable: false,
enumValues: ["draft", "submitted"],
},
],
primaryKey: ["id"],
foreignKeys: [],
tenantColumn: "tenant_id",
});
const principals = defineUnscopedDatabaseTable({
name: "grace_business_principals",
columns: [
{ name: "id", type: "uuid", nullable: false },
{ name: "email", type: "text", nullable: false },
],
primaryKey: ["id"],
foreignKeys: [],
});
const artifacts = generateContractSpecDrizzle({}, [claims, principals]);schemaSource contains the generated Drizzle module. The RLS manifest contains only tables declared through defineDatabaseTable; unscoped tables never gain invented tenant authority. Commit generated schema source and compare a fresh in-memory generation byte-for-byte in CI.
This tool does not replace a migration authority. Consumers may retain dbmate, Drizzle Kit, or another reviewed migration workflow while using generated Drizzle models for typed queries.
Declared capabilities.
This manifest does not declare a capability catalogue. Use the guide, import map and source to assess the package.
Imports and export paths.
5 entriesThese are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.
5 imports
@lssm-tech/tool.contractspec-drizzle-gen/emitter@lssm-tech/tool.contractspec-drizzle-gen/manifest@lssm-tech/tool.contractspec-drizzle-gen/reader@lssm-tech/tool.contractspec-drizzle-gen/typesNo export paths match this search.
Dependencies and related packages.
Runtime dependencies 2
- @lssm-tech/lib.contracts-integrations
- workspace:^
- @lssm-tech/lib.contracts-spec-core
- workspace:^
Development dependencies 3
- @lssm-tech/tool.bun
- workspace:*
- @lssm-tech/tool.typescript
- workspace:*
- typescript
- catalog:
Package scripts.
Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.
contractspec-bun-build buildcontractspec-bun-build transpilecontractspec-bun-build typescontractspec-bun-build prebuildcontractspec-bun-build devrimraf dist .turbotsgo --noEmitbun testnode ../../../scripts/biome.cjs check .bun run lint:fixnode ../../../scripts/biome.cjs check --write .