Code-generated schemas are ready to be shipped wit...
# madewithprisma
d
Code-generated schemas are ready to be shipped with the new release of Prisma Util, which also comes with support for
pg_trgm
queries using a middleware and an easier way of using the configuration file! The update is scheduled later this month, after the
pg_trgm
implementation is completed. Here's a sneak peek for the code-generated schemas:
Copy code
SchemaCreator
    .model("User")
        .column("id", "Int", Constraints.Column.ID(), Constraints.Column.DEFAULT(Functions.AUTOINCREMENT()))
        .column("name", "String")
        .column("posts", "Post[]")
    .model("Post")
        .column("id", "Int", Constraints.Column.ID(), Constraints.Column.DEFAULT(Functions.AUTOINCREMENT()))
        .column("title", "String", Constraints.Column.UNIQUE())
        .column("userId", "Int")
        .column("user", "User", Constraints.Column.RELATION({fields: ["userId"], references: ["id"]}))
        .column("updatedAt", "DateTime", Constraints.Column.UPDATEDAT())
        .column("createdAt", "DateTime", Constraints.Column.DEFAULT(Functions.NOW()))
    .build();
😮 1
🙌 1
👀 1