{"id":48967,"library":"prisma-schema-dsl-types","title":"Prisma Schema DSL Types","description":"Provides TypeScript type definitions for prisma-schema-dsl, enabling typed AST manipulation of Prisma schema files. Current version 1.1.2, release schedule follows prisma-schema-dsl. Differentiator: tightly coupled to the prisma-schema-dsl library for building and transforming Prisma schema ASTs with full type safety.","status":"active","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/amplication/prisma-schema-dsl-types","tags":["javascript","prisma","schema","dsl","ast","generator","typescript"],"install":[{"cmd":"npm install prisma-schema-dsl-types","lang":"bash","label":"npm"},{"cmd":"yarn add prisma-schema-dsl-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add prisma-schema-dsl-types","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Types are exported from this separate package, not from prisma-schema-dsl itself.","wrong":"import { PrismaSchema } from 'prisma-schema-dsl'","symbol":"PrismaSchema","correct":"import { PrismaSchema } from 'prisma-schema-dsl-types'"},{"note":"ESM-only package; use import statements. CommonJS require is unsupported.","wrong":"const { Model } = require('prisma-schema-dsl-types')","symbol":"Model","correct":"import { Model } from 'prisma-schema-dsl-types'"},{"note":"Field is a type and can be imported with 'import type' for compile-time only usage.","wrong":"import { Field } from 'prisma-schema-dsl-types'","symbol":"Field","correct":"import type { Field } from 'prisma-schema-dsl-types'"}],"quickstart":{"code":"import { PrismaSchema, Model, Field, FieldType, Attribute } from 'prisma-schema-dsl-types';\n\nconst schema: PrismaSchema = {\n  models: [],\n  enums: [],\n};\n\nconst model: Model = {\n  name: 'User',\n  fields: [\n    {\n      name: 'id',\n      type: FieldType.String,\n      isRequired: true,\n      isId: true,\n      attributes: [\n        { name: 'default', args: [{ type: 'string', value: 'autoincrement()' }] },\n      ],\n    },\n    {\n      name: 'email',\n      type: FieldType.String,\n      isRequired: true,\n      isUnique: true,\n    },\n  ],\n  attributes: [\n    { name: 'map', args: [{ type: 'string', value: 'users' }] },\n  ],\n};\n\nschema.models.push(model);\nconsole.log(JSON.stringify(schema, null, 2));","lang":"typescript","description":"Creates a typed Prisma schema AST for a User model with id and email fields, then logs the JSON representation."},"warnings":[{"fix":"Use string type names directly, e.g., 'String' instead of FieldType.String.","message":"FieldType is deprecated in favor of using string literals for field types.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use ES module import syntax. If using Node.js, ensure package.json has \"type\": \"module\" or use .mjs extension.","message":"ESM-only package; CommonJS require will not work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Attribute with name 'unique' instead of isUnique field property.","message":"The Field interface properties have changed: 'isUnique' is now optional and moved to attributes with @unique.","severity":"breaking","affected_versions":">=1.1.0"}],"env_vars":null,"search_vec":"'1.1.2':24 'ast':16,48,57 'build':43 'coupl':34 'current':22 'definit':8 'differenti':32 'dsl':3,13,31,40,56 'enabl':14 'file':21 'follow':27 'full':50 'generat':58 'javascript':53 'librari':41 'manipul':17 'prisma':1,11,19,29,38,46,54 'prisma-schema-dsl':10,28,37 'provid':5 'releas':25 'safeti':52 'schedul':26 'schema':2,12,20,30,39,47,55 'tight':33 'transform':45 'type':4,7,15,51 'typescript':6,59 'version':23","created_at":"2026-06-07T16:59:22.919208+00:00","updated_at":"2026-06-07T16:59:22.919208+00:00","problems":[{"fix":"npm install prisma-schema-dsl-types@1.1.2","cause":"Package not installed or version mismatch with prisma-schema-dsl.","error":"Cannot find module 'prisma-schema-dsl-types' or its corresponding type declarations."},{"fix":"Check Field type definition: ensure all required fields (name, type, isRequired) are present and correct.","cause":"Missing required properties or incorrect property types.","error":"TS2322: Type '{ name: string; type: string; ... }' is not assignable to type 'Field'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/amplication/prisma-schema-dsl-types#readme","github":"https://github.com/amplication/prisma-schema-dsl-types","docs":null,"changelog":null,"pypi":null,"npm":"prisma-schema-dsl-types","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}