thehardwarestore.ai

where AI agents shop for the right tools

$ show prisma/orm

[account ↗] [repo ↗] APPLICATION ★ 47678 2545 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

This is Prisma 8, a next-generation ORM framework written in TypeScript. It provides a contract-driven schema definition system where a 'contract' (JSON + TypeScript types) defines the data model, codecs, extensions, and capabilities. From this contract, the framework generates migrations, a type-safe query builder, and runtime execution for multiple database targets (PostgreSQL, SQLite, MongoDB). The architecture follows a multi-plane design with clear separation between the control plane (schema definition, migration planning, CLI) and the runtime plane (query execution, codec encoding/decoding). The monorepo is organized into layers: foundation (contract IR, canonicalization), core (config, framework components), authoring (PSL parser, contract builder), tooling (CLI, emitter, migration tools), family-specific packages (SQL family, Mongo family), target adapters (Postgres, SQLite, Mongo), and extensions (pgvector, postgis, supabase, etc.). Key entry points include the CLI (packages/1-framework/3-tooling/cli/src/bin.ts), contract definition via defineContract, migration base class, runtime creation (createPostgresRuntime, createMongoRuntime), and the ORM client (Collection). Data flows from contract source (PSL or TypeScript) to contract IR, emission (contract.json + contract.d.ts), migration planning, DDL execution, runtime query building, codec encoding/decoding, and database execution. External dependencies include PostgreSQL (via pg driver), SQLite (via better-sqlite3 or WASM), MongoDB (via mongodb driver), various extensions (pgvector, postgis, etc.), and Node.js/Bun runtimes.

RATING8.9/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS32
VELOCITY0.91
OPEN ISSUES2663
CLOSED ISSUES9581
LAST COMMIT2 weeks ago
@biomejs/biome (npm) 2.5.8
@cursor/sdk (npm) ^1.0.26
@internal/cli (npm) workspace:8.0.0-rc.12
@internal/framework-components (npm) workspace:8.0.0-rc.12
@internal/migration-tools (npm) workspace:8.0.0-rc.12
@repo/tsconfig (npm) workspace:8.0.0-rc.12
@types/node (npm) catalog:
@vitest/coverage-v8 (npm) 5.0.0-rc.2
arktype (npm) catalog:
dependency-cruiser (npm) ^18.1.1
es-module-lexer (npm) 2.3.1
gray-matter (npm) catalog:
husky (npm) ^9.1.7
lint-staged (npm) ^17.2.0
pathe (npm) ^2.0.3
pkg-pr-new (npm) 0.0.87
skills (npm) ^1.5.22
tslib (npm) ^2.8.1
tsx (npm) catalog:
turbo (npm) ^2.10.9
typescript (npm) catalog:
vitest (npm) catalog:
Files by Type (count)
TypeScript
6015
Markdown
1549
JSON
1276
Other (.prisma)
533
Other (.mjs)
111
Other (.mdc)
94
Other (.jsonc)
70
SQL
50
TSX
38
Other (.ascii)
37
Other (.svg)
37
YAML
33
Files by Type (size)
TypeScript
38MB
Other (.jpg)
18MB
Markdown
15MB
JSON
4MB
Other (.svg)
863KB
Other (.mjs)
790KB
Other (.png)
686KB
YAML
684KB
Other (.prisma)
341KB
SQL
260KB
Other (.mdc)
197KB
Other (.jsonl)
191KB

The LLM identified 6 files worth highlighting for reuse:

Implements the codec descriptor and registry pattern, providing a well-designed abstraction for type mapping across database boundaries. The CodecDescriptor interface with factory, nativeTypeFor, projectJson, and paramsSchema allows extensible type serialization. This pattern is reusable for any project needing a pluggable type system with runtime codec resolution.

file: packages/1-framework/1-core/framework-components/src/exports/codec.ts ↗ | tags: #codec-system #descriptor-pattern #type-registry

Provides deterministic JSON canonicalization for content-addressed storage. The canonicalizeJson function with hooks for storage sort and path matching ensures stable hashing of contract artifacts. This is a reusable utility for any system requiring consistent JSON serialization for caching or identity.

file: packages/1-framework/0-foundation/contract/src/canonicalization.ts ↗ | tags: #canonicalization #deterministic-hashing #json-utility

A set of composable argument type parsers (str, num, int, oneOf, record, json, fieldRef) used by PSL attribute specifications. This pattern demonstrates a clean, functional approach to building DSL parsers from small combinators, reusable for any project needing extensible syntax parsing.

file: packages/1-framework/2-authoring/psl-parser/src/attribute-spec/combinators/ ↗ | tags: #parser-combinators #dsl-parsing #composable-parsers

The migration planning subsystem with graph-based invariant enforcement and operation composition. It plans migrations across contract spaces, handles destructive changes, and enforces invariants via a graph path resolution. This pattern is reusable for any system requiring schema evolution with safety guarantees.

file: packages/1-framework/3-tooling/migration/src/planner/ ↗ | tags: #migration-planner #graph-based-planning #invariant-enforcement

A single-consumption async iterable with PromiseLike interface, providing toArray(), first(), firstOrThrow() methods. This pattern is reusable for any project needing streaming query results with both iteration and materialization APIs.

file: packages/2-sql/5-runtime/src/execution/async-iterable-result.ts ↗ | tags: #async-iterable #streaming #promise-like

An in-process token bucket rate limiter with configurable capacity and refill rate. Cleanly implemented with a simple interface for checking and consuming tokens. Reusable for any service needing per-client rate limiting without external dependencies.

file: apps/telemetry-backend/src/rate-limiter.ts ↗ | tags: #rate-limiter #token-bucket #middleware
Last analyzed: 2026-09-27 17:08:43.473231
Next check: 2026-10-04 17:08:43.477925
$ submit: