A parser for Prisma schema file (schema.prisma)
Install purescript-prisma by including it into package.dhall. The easiest path would be including clone this repo and set it as addition in the package.dhall.
git clone https://github.com/hasanalrasyid/purescript-prisma
cd working-projectThen put this clone in package.dhall inside working-project. For example:
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.15.10-20230926/package
s.dhall
sha256:684d460e9ca2089c89535e9a4ec56b83fb8b927ddd87afa6fa764ffb60bf1488
let additions =
{ prisma = ../purescript-prisma/spago.dhall as Location
}
in (upstream // additions)
in working-project, you can use it as a library.
spago install prismaInstall purescript-prisma with Spago:
$ spago install prismaJust use the parser as shown in the example inside app.
module Main where
import Prisma.Parser as Parser
import Node.Encoding
import Effect (Effect)
import Effect.Console (logShow)
import Node.FS.Sync (readTextFile)
import Prelude (Unit, bind, discard)
main :: Effect Unit
main = do
target1 <- readTextFile UTF8 "./prisma/schema.prisma"
logShow target1
let res = Parser.runParser target1
logShow resIf you get stuck, there are several ways to get help:
- Open an issue if you have encountered a bug or problem.
You can contribute to purescript-prisma in several ways:
-
If you encounter a problem or have a question, please open an issue. We'll do our best to work with you to resolve or answer it.
-
If you would like to contribute code, tests, or documentation, please read the contributor guide. It's a short, helpful introduction to contributing to this library, including development instructions.
-
If you have written a library, tutorial, guide, or other resource based on this package, please share it on the PureScript Discourse! Writing libraries and learning resources are a great way to help this library succeed.