# PrismaParser

**Kind:** Class

**Source:** [`atloria-monorepo/apps/database-parser/src/parsers/prisma.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/database-parser/src/parsers/prisma.parser.ts#L67)

**Implements:** `IParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `initialize` | `initialize(config: ParserConfig)` | `Promise<void>` |
| `canParse` | `canParse(filePath: string)` | `boolean` |
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |
| `parseFiles` | `parseFiles(files: ParseFileInput[])` | `Promise<ParseResult[]>` |
| `destroy` | `destroy()` | `Promise<void>` |

## Properties

| Property | Type |
|---|---|
| `name` | `any` |
| `version` | `any` |
| `supportedPatterns` | `any` |

## Where it refuses work

- `PrismaParser` stops the work with an early return when `field.isList`, in 2 places.
- `PrismaParser` stops the work with an early return when `!this.canParse(filePath)`.
- `PrismaParser` stops the work with an early return when `!field.relationName`.
- `PrismaParser` stops the work with an early return when `field.relationFromFields && field.relationFromFields.length > 0`.
- `PrismaParser` stops the work with an early return when `!field.default`.
- `PrismaParser` stops the work with an early return when `typeof field.default === 'object' && field.default !== null`.

## When something fails

- `PrismaParser` handles failure in 1 place: it turns it into a return value in all 1.
