| 44 | constructor(private readonly prisma: PrismaClient, readonly provider: SqlDriverAdapterFactory['provider']) {} |
| 45 | |
| 46 | async testJSON() { |
| 47 | const json = JSON.stringify({ |
| 48 | foo: 'bar', |
| 49 | baz: 1, |
| 50 | }) |
| 51 | |
| 52 | const created = await this.prisma.product.create({ |
| 53 | data: { |
| 54 | properties: json, |
| 55 | }, |
| 56 | select: { |
| 57 | properties: true, |
| 58 | }, |
| 59 | }) |
| 60 | |
| 61 | console.log('[nodejs] created', superjson.serialize(created).json) |
| 62 | |
| 63 | const resultSet = await this.prisma.product.findMany({}) |
| 64 | console.log('[nodejs] resultSet', superjson.serialize(resultSet).json) |
| 65 | |
| 66 | await this.prisma.product.deleteMany({}) |
| 67 | } |
| 68 | |
| 69 | async transactionsWithConflits() { |
| 70 | await this.prisma.leak_test.deleteMany() |