1.0.11 • Published 4 years ago

prismafile v1.0.11

Weekly downloads
44
License
ISC
Repository
-
Last release
4 years ago

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

1.0.11

4 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago