Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lobomfz/prismark

Repository files navigation

Prisma to Arktype generator

Usage

generator prismark {
  provider    = "npx prismark"

  output      = "./generated"
  fileName    = "schema.ts"
  
  enumSuffix  = "_literal"
  plainSuffix = "_plain"
  
  // if the field should be optional
  nullish     = true
}


// Example schema
enum role {
  admin
  moderator
}

model users {
  id String @id @default(uuid())

  type role

  // VarChar max length is respected
  name String @db.VarChar(50)

  created_at DateTime @default(now())
}

Generate

Run the Prisma generator after configuring your schema.prisma:

bun prisma generate

Example output

import { type } from "arktype";

export const role_literal = type.enumerated("admin", "moderator");

export const users_plain = type({
	id: "string",
	type: role_literal,
	name: "string < 50",
	created_at: "Date",
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published