Skip to content

Need ability to skip columns #72

@TravFitz

Description

@TravFitz

We need a way to be able to skip over creating class outputs for columns that don't need variable definitions as they are auto-populated (for example, createdAt, updatedAt or ID), which may not be relevant to creating or updating of an entry in Prisma. For example:

model SettingsCatalog {
  // @skip
  id                   Int      @id @default(autoincrement())
  domain               String   @unique
  automaticProductSync Boolean @default(true)
  // @skip
  createdAt            DateTime @default(now())
  // @skip
  updatedAt            DateTime @updatedAt
}

Would output:

import { ApiProperty } from '@nestjs/swagger';

export class SettingsCatalog {
  @ApiProperty({ type: String })
  domain: string;

  @ApiProperty({ type: Boolean })
  automaticProductSync: boolean = true;
}

Because id, createdAt, and updatedAt are informational and not required for the outputted class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions