Skip to content

Instantly share code, notes, and snippets.

View johannesschobel's full-sized avatar
🐼
black metal panda

Johannes Schobel johannesschobel

🐼
black metal panda
View GitHub Profile
@johannesschobel
johannesschobel / 00 - intro.md
Last active November 17, 2022 07:51
Prisma CRUD Service Generator for NestJS

This is a draft version for a generator.

As my previous attempt (described in prisma/prisma#5273) to create a "prisma crud service" failed to provide a typesafe service, i decided to take another route.

I then thought about creating a custom generator that can be invoked via the schema.prisma file. The generator, in turn, will now create a x.service.ts file, for each model x in the schema.prisma file (dmmf). This service, in turn, contains all CRUD methods that are properly typed. Note that this service than can easily extended or injected to provide this feature.

Approach

The current approach looks like this:

@johannesschobel
johannesschobel / launch.json
Created August 6, 2019 09:35 — forked from toddwseattle/cloudSettings
vscode debug configuration for an nx configuration with jest and vscode-jest extension
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// -------
// this includes launching against chorme; but assumes you have done an ng serve
// in a command window
//
// the vscode-jest config let's you pick an nx configuration to launch.
//