@prisma/client#ENTITY TypeScript Examples

The following examples show how to use @prisma/client#ENTITY. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: service.base.template.ts    From amplication with Apache License 2.0 5 votes vote down vote up
async findMany<T extends Prisma.FIND_MANY_ARGS>(
    args: Prisma.SelectSubset<T, Prisma.FIND_MANY_ARGS>
  ): Promise<ENTITY[]> {
    return this.prisma.DELEGATE.findMany(args);
  }
Example #2
Source File: service.base.template.ts    From amplication with Apache License 2.0 5 votes vote down vote up
async findOne<T extends Prisma.FIND_ONE_ARGS>(
    args: Prisma.SelectSubset<T, Prisma.FIND_ONE_ARGS>
  ): Promise<ENTITY | null> {
    return this.prisma.DELEGATE.findUnique(args);
  }
Example #3
Source File: service.base.template.ts    From amplication with Apache License 2.0 5 votes vote down vote up
async create<T extends Prisma.CREATE_ARGS>(
    args: Prisma.SelectSubset<T, Prisma.CREATE_ARGS>
  ): Promise<ENTITY> {
    // @ts-ignore
    return this.prisma.DELEGATE.create<T>(CREATE_ARGS_MAPPING);
  }
Example #4
Source File: service.base.template.ts    From amplication with Apache License 2.0 5 votes vote down vote up
async update<T extends Prisma.UPDATE_ARGS>(
    args: Prisma.SelectSubset<T, Prisma.UPDATE_ARGS>
  ): Promise<ENTITY> {
    // @ts-ignore
    return this.prisma.DELEGATE.update<T>(UPDATE_ARGS_MAPPING);
  }
Example #5
Source File: service.base.template.ts    From amplication with Apache License 2.0 5 votes vote down vote up
async delete<T extends Prisma.DELETE_ARGS>(
    args: Prisma.SelectSubset<T, Prisma.DELETE_ARGS>
  ): Promise<ENTITY> {
    return this.prisma.DELEGATE.delete(args);
  }