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