Last active
August 13, 2020 22:47
-
-
Save nmchenry01/01176d838d46b008a05af97187d64edc to your computer and use it in GitHub Desktop.
Create customer example for "Prisma vs. TypeORM"
This file contains hidden or 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 createCustomer = async (prisma: PrismaClient) => { | |
| await prisma.customer.create({ | |
| data: { | |
| username: 'Customer1', | |
| email: 'Customer1@gmail.com', | |
| products: { | |
| connect: [ | |
| { | |
| name: 'Car', | |
| }, | |
| { | |
| name: 'Dynamite', | |
| }, | |
| ], | |
| }, | |
| }, | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment