Releases: MrLeebo/prisma-ast
v0.12.0
prisma-ast will now parse attributes on enums
enum Role {
USER @map("usr")
ADMIN @map("adm")
ORGANIZATION @map("org") // deprecated
@@map("roles")
}
and you can add attributes using PrismaSchemaBuilder
builder.enum("Role").enumerator("GUEST").attribute("map", ['"gst"'])
which produces the following output
enum Role {
USER @map("usr")
ADMIN @map("adm")
ORGANIZATION @map("org") // deprecated
GUEST @map("gst")
@@map("roles")
}
v0.11.0
BREAKING CHANGE
In the internal parser, { type: "fieldAttribute" }
and { type: "blockAttribute" }
have been made into separate nodes. Previously, the same node { type: "attribute" }
was reused for both. This makes it easier for the parser to distinguish which kind of node it's getting because schemas can have block attributes intermixed with their field attributes.
This is only a breaking change if you're accessing the internal AST to access attributes. Higher level abstractions, such as produceSchema / PrismaSchemaBuilder are not impacted by this.
- Fix printing when block attributes are mixed in with fields 2e30232
v0.10.1
v0.10.0
v0.9.1
v0.9.0 - Added support for composite types
Adds composite types to the parser, printer, and Schema Builder
model Gallery {
photos Photo[]
}
type Photo {
width Int
height Int
url String
}
The schema node is { type: "type" }
and the builder method is builder.type("Photo")
v0.8.1
v0.8.0
v0.7.0
This release adds optional location tracking stats, making it possible to use prisma-ast for linters, github workflows, IDE plugins, and the like.