PrismaClientKnownRequestError:
Invalid `prisma.genTableColumn.create()` invocation in
D:\repos\carole-admin\server\src\common\service\gen\gen.service.ts:193:39
190 for (const column of tableColumn) {
191 this.initTableColumn(column, tableInfo);
192 column.sort = Number(column.sort);
→ 193 await prisma.genTableColumn.create(
Transaction API error: Transaction already closed: Could not perform operation.
at In.handleRequestError (D:\repos\carole-admin\server\dist\common\prisma-client\runtime\library.js:122:6877)
at In.handleAndLogRequestError (D:\repos\carole-admin\server\dist\common\prisma-client\runtime\library.js:122:6211)
at In.request (D:\repos\carole-admin\server\dist\common\prisma-client\runtime\library.js:122:5919)
at l (D:\repos\carole-admin\server\dist\common\prisma-client\runtime\library.js:127:11167)
at D:\repos\carole-admin\server\src\common\service\gen\gen.service.ts:193:11
at Proxy._transactionWithCallback (D:\repos\carole-admin\server\dist\common\prisma-client\runtime\library.js:127:9534)
at GenController.importTable (D:\repos\carole-admin\server\src\admin\gen\gen.controller.ts:67:5) {
code: 'P2028',
clientVersion: '5.15.0',
meta: {
modelName: 'GenTableColumn',
error: 'Transaction already closed: Could not perform operation.'
}
}
参考教程 https://juejin.cn/post/7385743189636808719#heading-2
用sql创建了一个表![ac0b53b0f76c269e2d586be445dee1f9](https://github.com/user-attachments/assets/5ddb5965-5545-46a9-8dd9-58dd620248a9)
base_user
:点击确认,接口返回:
server控制台报错信息: