{"id":13714789,"url":"https://github.com/amplication/prisma-schema-dsl","last_synced_at":"2025-08-07T07:09:01.724Z","repository":{"id":103295077,"uuid":"283756132","full_name":"amplication/prisma-schema-dsl","owner":"amplication","description":"JavaScript interface for Prisma Schema DSL","archived":false,"fork":false,"pushed_at":"2023-09-19T07:25:26.000Z","size":799,"stargazers_count":113,"open_issues_count":3,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-26T21:38:17.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amplication.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-30T11:36:28.000Z","updated_at":"2025-03-11T15:23:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"c4d232de-874e-44c1-8e79-be3e054a9d56","html_url":"https://github.com/amplication/prisma-schema-dsl","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplication%2Fprisma-schema-dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplication%2Fprisma-schema-dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplication%2Fprisma-schema-dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplication%2Fprisma-schema-dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amplication","download_url":"https://codeload.github.com/amplication/prisma-schema-dsl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665783,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T00:00:49.947Z","updated_at":"2025-04-13T04:42:20.177Z","avatar_url":"https://github.com/amplication.png","language":"TypeScript","funding_links":[],"categories":["TypeScript",":safety_vest: Community Prisma Tools"],"sub_categories":[],"readme":"![Node.js CI](https://github.com/amplication/prisma-schema-dsl/workflows/Node.js%20CI/badge.svg)\n\n\u003cp align=\"center\"\u003e\n    \u003cimg height=\"120\" src=\"./assets/hero.png\" alt=\"Prisma Schema DSL\" /\u003e\n\u003c/p\u003e\n\nJavaScript interface for [Prisma Schema DSL](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema)\n\n## Installation\n\n```\nnpm install prisma-schema-dsl\n```\n\n## API\n\n### Print\n\n#### `print(schema: Schema): Promise\u003cstring\u003e`\n\nPrints Prisma schema file from AST.\nThe schema is formatted using prisma-format.\n\n### Builders\n\n#### `createSchema(models: Model[], dataSource?: DataSource): Schema`\n\nCreates a schema AST object\n\n#### `createEnum(name: string, values: string[], documentation?: string): Enum`\n\n- Creates an enum AST object\n- Validates given name argument\n\n#### `createModel(name: string, fields: Array\u003cScalarField | ObjectField\u003e): Model`\n\n- Creates a model AST object\n- Validates given name argument\n\n#### `createScalarField(name: string, type: ScalarType, isList: boolean = false, isRequired: boolean = false, isUnique: boolean = false, isId: boolean = false, isUpdatedAt: boolean = false, default: | null | boolean | CallExpression | number | string = null): ScalarField`\n\n- Creates a scalar field AST object\n- Validates given name argument\n\n#### `createObjectField(name: string, type: string, isList: boolean = false, isRequired: boolean = false, relationName: string | null = null, relationToFields: string[] = [], relationToReferences: string[] = [], relationOnDelete: \"NONE\" = \"NONE\"): ObjectField`\n\n- Creates an object field AST object\n- Validates given name argument\n\n#### `createDataSource(name: string, provider: DataSourceProvider, url: string | DataSourceURLEnv): DataSource`\n\nCreates a data source AST object\n\n## Development\n\n- Clone the repository `git clone git@github.com:amplication/prisma-schema-dsl.git`\n- Make sure to use npm@7 `npm i -g npm@7`\n- Install the dependencies `npm install`\n- Run tests `npm test`\n\n---\n\nCreated with \u003c3 by amplication\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplication%2Fprisma-schema-dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famplication%2Fprisma-schema-dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplication%2Fprisma-schema-dsl/lists"}