Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prisma-schema-dsl

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-schema-dsl

JavaScript interface for Prisma Schema DSL

  • 1.1.0
  • npm
  • Socket score

Version published
Weekly downloads
169
decreased by-22.48%
Maintainers
1
Weekly downloads
 
Created
Source

Node.js CI

Prisma Schema DSL

JavaScript interface for Prisma Schema DSL

Installation

npm install prisma-schema-dsl

API

Print

print(schema: Schema): Promise<string>

Prints Prisma schema file from AST. The schema is formatted using prisma-format.

Builders

createSchema(models: Model[], dataSource?: DataSource): Schema

Creates a schema AST object

createModel(name: string, fields: Array<ScalarField | ObjectField>): Model
  • Creates a model AST object
  • Validates given name argument
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
  • Creates a scalar field AST object
  • Validates given name argument
createObjectField(name: string, type: string, isList: boolean = false, isRequired: boolean = false, relationName: string | null = null, relationToFields: string[] = [], relationToReferences: string[] = [], relationOnDelete: "NONE" = "NONE"): ObjectField
  • Creates an object field AST object
  • Validates given name argument
createDataSource(name: string, provider: DataSourceProvider, url: string | DataSourceURLEnv): DataSource

Creates a data source AST object

Development

  • Clone the repository git clone git@github.com:amplication/prisma-schema-dsl.git
  • Install the dependencies npm install
  • Run tests npm test

Created with <3 by amplication

Keywords

FAQs

Package last updated on 21 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc