Kind: Class
Source: atloria-monorepo/apps/database-parser/src/parsers/migration.parser.ts
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
MigrationParserstops the work with an early return when!onActions, in 2 places.MigrationParserstops the work with an early return when!action, in 2 places.MigrationParserstops the work with an early return whenvalue === 'CASCADE' || value === 'SET_NULL' || value === 'RESTRICT' || value === 'NO_ACTI…, in 2 places.MigrationParserstops the work with an early return when!this.canParse(filePath).MigrationParserstops the work with an early return whenfilePath.includes('/prisma/migrations/').MigrationParserstops the work with an early return whenfilePath.includes('/typeorm/migrations/') || filePath.match(/\d{13}-\w+\.ts$/).
When something fails
MigrationParserhandles failure in 3 places: it logs it and continues in 2, and turns it into a return value in 1.
Was this page helpful?