Bernardo Santos
09/07/2022, 5:44 PMJoshua
09/07/2022, 7:29 PMopentelemetry-instrumentation-prisma-client
package and it seems like it's broken stuffJoshua
09/07/2022, 7:31 PM3.11.1
- granted it's not 4.X but it's above the specified 3.8 in the docsYunbo
09/07/2022, 7:34 PMprisma.user.findMany
is
CheckSelect<T, PrismaPromise<Array<User>>, PrismaPromise<Array<UserGetPayload<T>>>>
what could be the example object of this?
const mockUser = {
findMany = () => Promise.resolve([{id:1, name:"test user"}]);
}
this is saying return type is invalid.
I was looking at https://www.prisma.io/docs/guides/testing/unit-testing documentation.
but i'm using nestjs
and trying to use golevelup/nestjs-testing packageChip Clark
09/07/2022, 8:52 PMnpm i prisma@4 --save
This works fine with NodeJS v14.17 - Since system requirements say Node.js14.17.X / 16.X, this should work.
Here is the error log:
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm@8.15.0
2 info using node@v16.17.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 3ms
5 timing config:load:file:C:\Users\tech-cclark\AppData\Roaming\nvm\v16.17.0\node_modules\npm\npmrc Completed in 1ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 2ms
9 timing config:load:file:C:\Sites\AM-API-MDD\.npmrc Completed in 0ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:C:\Users\tech-cclark\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 2ms
17 timing config:load:setEnvs Completed in 2ms
18 timing config:load Completed in 18ms
19 timing npm:load:configload Completed in 19ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm i prisma@4
23 verbose argv "i" "prisma@4" "--save"
24 timing npm:load:setTitle Completed in 2ms
25 timing config:load:flatten Completed in 5ms
26 timing npm:load:display Completed in 9ms
27 verbose logfile logs-max:10 dir:C:\Users\tech-cclark\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\tech-cclark\AppData\Local\npm-cache\_logs\2022-09-07T20_47_04_581Z-debug-0.log
29 timing npm:load:logFile Completed in 12ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 45ms
33 verbose stack C:\Users\tech-cclark\AppData\Roaming\nvm\v16.17.0\node_modules\npm\node_modules\libnpmfund:1
33 verbose stack ../workspaces/libnpmfund
33 verbose stack ^
33 verbose stack
33 verbose stack SyntaxError: Unexpected token '.'
33 verbose stack at Object.compileFunction (node:vm:360:18)
33 verbose stack at wrapSafe (node:internal/modules/cjs/loader:1055:15)
33 verbose stack at Module._compile (node:internal/modules/cjs/loader:1090:27)
33 verbose stack at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
33 verbose stack at Module.load (node:internal/modules/cjs/loader:1004:32)
33 verbose stack at Function.Module._load (node:internal/modules/cjs/loader:839:12)
33 verbose stack at Module.require (node:internal/modules/cjs/loader:1028:19)
33 verbose stack at require (node:internal/modules/cjs/helpers:102:18)
33 verbose stack at Object.<anonymous> (C:\Users\tech-cclark\AppData\Roaming\nvm\v16.17.0\node_modules\npm\lib\utils\reify-output.js:16:38)
33 verbose stack at Module._compile (node:internal/modules/cjs/loader:1126:14)
34 verbose cwd C:\Sites\AM-API-MDD
35 verbose Windows_NT 10.0.17763
36 verbose node v16.17.0
37 verbose npm v8.15.0
38 error Unexpected token '.'
39 verbose exit 1
40 timing npm Completed in 87ms
41 verbose code 1
42 error A complete log of this run can be found in:
42 error C:\Users\tech-cclark\AppData\Local\npm-cache\_logs\2022-09-07T20_47_04_581Z-debug-0.log
William GM
09/07/2022, 11:12 PMDhwanik Panchal
09/08/2022, 5:25 AMconnection_limit
parameter, nor any other parameters. We accepted the default ones.
Our ECS instance has 0.5 cores available with one instance (in the development environment), hence, the connection limit would be 2 * 0.5 + 1 = 2
for our instance.
However, while monitoring RDS, we notice a warning in our database. Here's what the warning said:
[Warning] Aborted connection xxx to db: '<database name>' user: '<user name>' host: '<host IP>' (Got an error reading communication packets)
I hope the given information is sufficient to know about the problem we are facing. Otherwise, I am happy to share more details if required.
Thanks!Rune Jørgensen
09/08/2022, 6:59 AMVasily Zorin
09/08/2022, 8:41 AMRaphael Etim
09/08/2022, 11:55 AMMohammed Almajid
09/08/2022, 11:59 AMOffBy0x01
09/08/2022, 1:49 PMRobin Irmer
09/08/2022, 3:37 PMconst value = 'test';
const results = await prismaClient.$queryRaw`
SELECT * FROM "contact"
WHERE "textSearch" @@ to_tsquery('english', '${query}')
ORDER BY ts_rank("textSearch", to_tsquery('english', '${query}')) DESC
LIMIT 10;
;`;
PrismaClientKnownRequestError:
Invalid `prisma.queryRaw()` invocation:
Your raw query had an incorrect number of parameters. Expected: `0`, actual: `2`.
{
code: 'P1016',
clientVersion: '3.0.2',
meta: { expected: 0, actual: 2 }
}
Rob
09/08/2022, 4:07 PMBryan Z
09/08/2022, 6:16 PMconst { data, error, isLoading } = useQuery(['links'], resolvers.Query.links)
Where resolvers.Query.links
is links: async () => prisma.link.findMany()
I'm getting the error
Invalid environment variables:
DATABASE_URL: Required
NODE_ENV: Required
But DATABASE_URL is specified in the root .env file. Previously I was using Apollo Client and didn't encounter this issue.Jon Ramvi
09/08/2022, 7:28 PMJon Ramvi
09/08/2022, 7:33 PMDavid Wagner
09/08/2022, 10:33 PMClément Guibout
09/08/2022, 10:42 PMmodel Event {
evt_id String @id @default(uuid())
evt_title String @db.VarChar(100)
evt_content String @db.VarChar(1024) @default("Cet événement n'a pas encore de description.")
evt_picture String? @db.VarChar(1024) @default("/img/events/default.png") // Local path
evt_likeCount Int @default(0)
evt_beginDate DateTime
evt_endDate DateTime
evt_participants User[]
evt_created_at DateTime @db.Timestamp() @default(now())
evt_updated_at DateTime @updatedAt
evt_isVerified Boolean
}
model User {
usr_id String @id @default(cuid())
usr_token String @db.VarChar(1024) @unique
usr_name String? @db.VarChar(100)
usr_nickname String? @db.VarChar(32) @unique
usr_email String @db.VarChar(100) @unique
usr_profilePicture String? @db.VarChar(1024) @default("/img/users/default.png") // Local path
usr_events Event[]
usr_createdAt DateTime @db.Timestamp @default(now())
}
I created my database etc using npx prisma generate, and I have no migration in this project
But when accessing the studio, I get the error: ``The table public._EventToUser
does not exist in the current database.``
Oh boy I don't understand from where this could even come from...
Could someone indicate me the path? I feel like this is an internal thing for prisma, but cannot find anything......Omri Katz
09/08/2022, 11:07 PMOmri Katz
09/08/2022, 11:07 PMnguyễn thiện
09/09/2022, 3:25 AMFlorian
09/09/2022, 7:20 AMIlkka Huotari
09/09/2022, 9:25 AMTaylor Lindores-Reeves
09/09/2022, 9:52 AMTaylor Lindores-Reeves
09/09/2022, 9:52 AMTaylor Lindores-Reeves
09/09/2022, 9:57 AMTaylor Lindores-Reeves
09/09/2022, 10:05 AM24hoursAheadOfCreatedAt @default(dbgenerated("NOW() + interval '1 day'")))
Omri Katz
09/09/2022, 10:12 AMNicholas Ewing
09/09/2022, 12:51 PM