@mrleebo/prisma-ast is a JavaScript and TypeScript library for parsing Prisma schema.prisma files into an abstract syntax tree, then converting that structure back into schema text. It’s useful if you need to programmatically modify schemas while preserving comments and model attributes, and supports builder-style updates via produceSchema, plus options like re-sorting the printed schema.
Project status
- Actively maintained, with recent
updateslanding at least in Feb 2026, Mar 2026, and May 2026 (and the last upstream push was 2026-05-08). - Apparent update cadence is moderately frequent, about 4 to 8 weeks between the last few versioned
updates(v0.14.0 to v0.15.0, then v0.15.0 to v0.16.0).
AI summary generated Today
Recent updates
v0.16.0
1 month agov0.16.0 drops Node 20 support and updates CI to run on Node 22 and 24. It also adds contributor documentation (CONTRIBUTING.md) and a Code of Conduct (CODE_OF_CONDUCT.md).
Breakingv0.15.0
2 months agov0.15.0 adds support for Prisma partial index where clauses, allowing the `where` argument of `@@index` and `@unique` to be expressed as structured objects and as raw `where: raw(...)` functions. The change is implemented across the schema builder, parser, schema AST types, and printer so these clauses can be parsed and re-printed.
Featuresv0.14.0
3 months agoRelease v0.14.0 updates the project to require a newer Node.js runtime and upgrades Chevrotain from v10 to v11. It also adds/adjusts Jest and Babel configuration to address test transformation issues, along with regenerating the Yarn lockfile.
Breakingv0.13.1
7 months agov0.13.1 contains a small TypeScript type fix related to function parameter typing. The only functional code change is in the exported `Func` interface within `src/getSchema.ts`, where the `params` field becomes optional.
v0.13.0
11 months agov0.13.0 updates PrismaSchemaBuilder so datasource provider values are generated as quoted string literals in the produced schema. The release notes describe this as a breaking change because callers previously had to manually include quotation marks for the schema to be valid.
Breakingv0.12.1
12/16/2024v0.12.1 is presented as a README-only patch release intended to propagate changes to npm. The actual diff shows mostly README badge markup updates, plus an additional package.json version bump.
v0.12.0
3/22/2024v0.12.0 extends enum handling so `@map()` (and other attributes) can be parsed and printed on enum enumerators, and also allows adding those attributes via `PrismaSchemaBuilder`. The change updates the parser grammar and the schema printer to include enumerator attributes in the enum output.
Featuresv0.11.0
3/9/2024v0.11.0 refactors the Prisma parser and visitor to distinguish field attributes vs block attributes, which helps when those are interleaved in a schema. It also updates schema printing to move block attributes to the bottom (with some spacing adjustments) when they appear among fields. Tests and snapshots were expanded to cover these scenarios (notably KeystoneJS fixtures).
Breakingv0.10.1
2/25/2024v0.10.1 adds support for using generator.assignments as a valid source for findBy lookups. It also fixes parsing for a kebab-case fixture by adjusting the lexer identifier tokenization so schema identifiers containing hyphens are handled correctly.
Featuresv0.10.0
2/10/2024v0.10.0 adds new finder/query capabilities to the PrismaSchemaBuilder. The release notes only mention adding finder methods, and the code confirms this by introducing a new finder module and two new builder methods: findByType and findAllByType.
Features