A JavaScript library for programmatically building and printing Prisma schema files using an abstract syntax tree.
Prisma Schema DSL is a JavaScript library that provides an interface for programmatically creating and printing Prisma schema files using an abstract syntax tree (AST). It allows developers to generate Prisma schema definitions through code, which is useful for automation, tooling, and dynamic schema generation. The library includes builder functions for models, enums, fields, and data sources, along with validation and formatted output.
Developers building code generation tools, CLI applications, or automation scripts that need to create or modify Prisma schemas dynamically. It's also suitable for projects requiring programmatic database schema management.
It offers a type-safe, programmatic way to generate Prisma schemas, reducing manual errors and enabling integration with automated workflows. Unlike manual schema writing, it provides validation and consistent formatting out of the box.
JavaScript interface for Prisma Schema DSL
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers dedicated functions like createScalarField and createObjectField with proper type definitions, ensuring compile-time safety and reducing runtime errors, as highlighted in the Key Features.
Includes validation for model and field names during creation (e.g., in createModel), ensuring compatibility with Prisma's requirements and minimizing manual checks.
Uses prisma-format to print schemas with consistent styling via the print function, providing reliable, formatted Prisma schema files out of the box.
Enables dynamic schema creation for automation workflows, such as code generators or CI/CD pipelines, as stated in the GitHub description and best for list.
The builders focus on basic fields and may not support all Prisma schema attributes like @map or @@index, which could restrict advanced use cases.
Relies on prisma-format for output formatting, which could introduce compatibility issues or break with updates to Prisma or the formatting tool.
The README only lists API functions without detailed examples or tutorials, making it harder for new users to implement complex scenarios.