Last active
August 13, 2020 22:48
-
-
Save nmchenry01/587ed010cc03e415161d42d70e2e3386 to your computer and use it in GitHub Desktop.
Create product example for "Prisma vs. TypeORM"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createProduct = async (prisma: PrismaClient) => { | |
await prisma.product.create({ | |
data: { | |
name: 'Dynamite', | |
description: 'It goes "boom"', | |
company: { | |
connect: { | |
name: 'Acme', | |
}, | |
}, | |
}, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment