Reuben Porter
10/22/2021, 11:10 AMHlm
10/22/2021, 11:23 AMjferrettiboke
10/22/2021, 12:20 PMLevente Orban
10/22/2021, 12:30 PMPatrick
10/22/2021, 5:13 PMHmm
10/22/2021, 10:15 PMcreatedAt
when you are working with seeded data that was all created at the exact same time?Hmm
10/22/2021, 10:18 PMcreatedAt DateTime @default(now())
Hmm
10/22/2021, 10:19 PM@default(now())
does not record a specific enough time in order for me to preserve order on seeded dataChip Clark
10/23/2021, 12:45 AMprisma:query SELECT 1
prisma:query SELECT [dbo].[Page].[ID], [dbo].[Page].[Title], [dbo].[Page].[Description], [dbo].[Page].[Icon], [dbo].[Page].[Sidebar],
[dbo].[Page].[IsActive], [dbo].[Page].[Sort] FROM [dbo].[Page] WHERE 1=1
prisma:query SELECT 1
prisma:query SELECT [dbo].[MainSidebar].[ID], [dbo].[MainSidebar].[Main_Sidebar] FROM [dbo].[MainSidebar] WHERE 1=1
{"Title":"New Item","Description":"","Icon":"pe-7s-refresh-2","Sidebar":"","IsActive":false,"Sort":"1"}
prisma:query SELECT 1
prisma:info Begin transaction
prisma:query BEGIN TRAN
prisma:query
INSERT INTO [dbo].[Page] (
[Title],
[Description],
[Icon],
[Sidebar],
[IsActive],
[Sort]
)
VALUES (
DEFAULT,
@P1,
@P2,
@P3,
@P4,
@P5,
@P6
);
prisma:info Rollback transaction
prisma:query ROLLBACK
[Nest] 146544 - 10/22/2021, 5:40:42 PM [ExceptionsHandler]
Invalid `prisma.executeRaw()` invocation:
Raw query failed. Code: `110`. Message: `There are fewer columns in the INSERT statement than values specified in the VALUES clause.
The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.` +234239ms
Error:
Invalid `prisma.executeRaw()` invocation:
Raw query failed. Code: `110`. Message: `There are fewer columns in the INSERT statement than values specified in the VALUES clause.
The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.`
at cb (C:\Sites\AM-API-LMS\node_modules\@prisma\client\runtime\index.js:38537:17)
at async Promise.all (index 0)
at async PageService.createPage (C:\Sites\AM-API-LMS\dist\Page\Page.service.js:73:30)
at async C:\Sites\AM-API-LMS\node_modules\@nestjs\core\router\router-execution-context.js:46:28
at async C:\Sites\AM-API-LMS\node_modules\@nestjs\core\router\router-proxy.js:9:17
schema:
model Page {
ID Int @id @default(autoincrement())
Title String? @db.NVarChar(255)
Description String? @db.NText
Icon String? @db.NVarChar(255)
Sidebar String? @db.NText
IsActive Boolean?
Sort Int?
// Assoc_Page_Tag Assoc_Page_Tag[]
}
page.service.ts
async createPage(data: Prisma.PageCreateInput) {
const payload = {
...data
};
console.log(JSON.stringify(data));
const insert = this.prisma.$executeRaw`
INSERT INTO [dbo].[Page] (
[Title],
[Description],
[Icon],
[Sidebar],
[IsActive],
[Sort]
)
VALUES (
DEFAULT,
${payload.Title},
${payload.Description},
${payload.Icon},
${payload.Sidebar},
${payload.IsActive},
${payload.Sort}
);`;
const lastId = this.prisma.$queryRaw`
SELECT @@IDENTITY as id;
`;
const [, response] = await this.prisma.$transaction([insert, lastId]);
return this.PagebyID({ id: response?.[0]?.id });
}
Julien Goux
10/23/2021, 5:16 AMuser
10/23/2021, 6:50 AMGiovanni Italiano
10/23/2021, 2:42 PMNathaniel Babalola
10/23/2021, 11:42 PMdeploy
or resolve
command . Please how can I resolve this, there's nothing in the docs on resolving thisIbrahim
10/24/2021, 7:50 AMstephan levi
10/24/2021, 11:37 AMYerzhan
10/24/2021, 4:47 PMmel
10/25/2021, 2:08 AMNoel Martin Llevares
10/25/2021, 6:43 AMDante
10/25/2021, 7:06 AMNoel Martin Llevares
10/25/2021, 7:16 AMprisma migrate dev --create-only
The above command is only meant to create migrations but not execute them. It should NOT need to connect,
For comparison, Django’s makemigrations
can create the migrations without connecting to the database.Reuben Porter
10/25/2021, 9:42 AM(node:79018) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 beforeExit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:79018) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:79018) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGUSR1 listeners added to [process]. Use emitter.setMaxListeners() to increase limit
Moud
10/25/2021, 10:38 AMSimskii
10/25/2021, 12:12 PM}
meta: { connection_limit: 9 }
clientVersion: '2.29.1',
code: 'P2024',
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
at runMicrotasks (<anonymous>)
at RequestHandler.request (/app/node_modules/@prisma/client/runtime/index.js:36744:15)
PrismaClientKnownRequestError3 [PrismaClientKnownRequestError]: Timed out fetching a new connection from the connection pool. (More info: <http://pris.ly/d/connection-pool>, Current connection limit: 9)
}
Nima
10/25/2021, 1:03 PMNathaniel Babalola
10/25/2021, 1:03 PMmigrate resolve
or migrate deploy
.
Can anyone please help with this, it has slowed down my work.
N.B: Postgres DB is hosted on HerokuSpiros - Product at Prisma
Bryan Migliorisi
10/25/2021, 2:18 PMgustav
10/25/2021, 3:25 PMfindFirst
? Would it be faster to use two findUnique
calls to prisma, utilizing the indexes? See example:Jaye
10/25/2021, 3:27 PMconnectOrCreate
from within an upsert
query? i'm getting an error that prisma doesn't understand my args at the momentgustav
10/25/2021, 3:28 PM