Package-level declarations

Types

Link copied to clipboard
object NiwenPrism

An internal, extremely hacky parser for Prisma schema file. The main objective is to retrieve @db.xyz attributes.

Link copied to clipboard

A class that exposes NiwenPrism's capabilities as a higher-level class

Link copied to clipboard
data class PArgBare(val expr: PExpression) : PArgument

A simple argument that only contains an expression

Link copied to clipboard
data class PArgNamed(val name: String, val expr: PExpression) : PArgument

A named argument, that is, an argument that has a name and an associated expression, e.g. @something(foo = "bar").

Link copied to clipboard
data class PArgsList(val args: List<PArgument>)

A list of arguments

Link copied to clipboard
sealed class PArgument

An argument.

Link copied to clipboard
data class PAttribute(val name: String, val params: List<PArgument> = listOf(), val isBlockAttribute: Boolean)

An attribute on a field, e.g. @db.TinyBlob.

Link copied to clipboard
data class PDatasource(val name: String, val properties: PPropertySet) : PRootElement

A datasource ... { } element.

Link copied to clipboard
data class PEnum(val enumName: String, val enumTypes: List<String>) : PRootElement

An enumeration (enum ... { }) in a Prisma schema.

Link copied to clipboard
data class PEnv(val env: PString) : PValueOrEnv

An environment variable reference. Not substituted immediately.

Link copied to clipboard
data class PExpArray(val values: List<PExpression>) : PExpression

An expression that is an array of other expressions.

Link copied to clipboard
data class PExpFunCall(val functionName: String, val argsList: List<PArgument>) : PExpression

An expression that is a call to a function named functionName, called with the provided argsList.

Link copied to clipboard
data class PExpReference(val ref: String) : PExpression

An expression that is a reference to something.

Link copied to clipboard
sealed class PExpression

An expression.

Link copied to clipboard
sealed class PExpValue : PExpression

An expression that is a simple value.

Link copied to clipboard
data class PExpValueInt(val value: Int) : PExpValue

An expression value that is an integer value

Link copied to clipboard
data class PExpValueString(val value: PString) : PExpValue

An expression value that is a simple string.

Link copied to clipboard
data class PField(val name: String, val type: String, val isOptional: Boolean, val isArray: Boolean, val attributes: List<PAttribute>)

A field within a PModel

Link copied to clipboard
data class PGenerator(val name: String, val properties: PPropertySet) : PRootElement

A generator ... { } in a Prisma schema

Link copied to clipboard
data class PModel(val name: String, val fields: List<PField>) : PRootElement

A model ... { } in a Prisma schema

Link copied to clipboard
data class PProperty(val name: String, val value: PValueOrEnv)

A simple name to value-or-env binding.

Link copied to clipboard
data class PPropertySet(val properties: List<PProperty>)

A set of properties

Link copied to clipboard
data class PRoot(val elements: List<PRootElement>)

Root parsing result of NiwenPrism

Link copied to clipboard
sealed class PRootElement

An element of the root of a Prisma schema document

Link copied to clipboard
data class PString(val string: String)

A regular ol' string.

Link copied to clipboard
data class PValue(val value: PString) : PValueOrEnv

A regular PString value as part of a PValueOrEnv

Link copied to clipboard
sealed class PValueOrEnv

Either a regular PValue string, or an environment variable reference (PEnv).