prismafile
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

Prismafile

Parse and print .prisma files.

⚠️ This is not the official schema.prisma parser. There likely be drift between this parser and the Rust one. We'll try our best to keep this parser up-to-date, but there may be inconsistencies.

Install

npm install prismafile

Usage

import { parse, print } from 'prismafile'
const ast = parse(`
  datasource db {
    provider = "postgres"
    url = "postgres://localhost:5432/prisma"
  }

  model User {
    id String @id
    post Post
  }

  model Post {
    id Int @id @default(cuid())
    users User[]
  }
`)

console.log(print(ast))

Test

npm run build
npm run test

Todo

  • [ ] Fix up DateTimeValue

License

Apache 2

Readme

Keywords

none

Package Sidebar

Install

npm i prismafile

Weekly Downloads

30

Version

1.0.11

License

ISC

Unpacked Size

199 kB

Total Files

17

Last publish

Collaborators

  • mattmueller