1.0.11 • Published 3 years ago

prismafile v1.0.11

Weekly downloads
44
License
ISC
Repository
-
Last release
3 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

3 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago