מתן נחמני
08/18/2022, 8:21 AM.orderBy('user.state = "pending" ', 'DESC')
First show users with state pending then the restMeetSnowmaker
08/18/2022, 11:37 AMRunning generate... (Use --skip-generate to skip the generators)
Error: Get DMMF: Schema parsing - Error while interacting with query-engine-node-api library
Error code: P1012
error: The preview feature "orderByNulls" is not known. Expected one of: filterJson, referentialIntegrity, mongoDb, interactiveTransactions, fullTextSearch, fullTextIndex,
My other prject uses 4.1.0 at the moment and it works as intended.
I did not find (or didnt look deep enough) any info on github or the release note about the feature being GA so i was wondering if It might be unintended.Matheus Assis
08/18/2022, 12:52 PMPedro Roque
08/18/2022, 2:49 PMAdrien Wald
08/18/2022, 2:54 PMAdrien Wald
08/18/2022, 2:54 PMAdrien Wald
08/18/2022, 2:55 PMfindUnique
Adrien Wald
08/18/2022, 2:56 PMfindMany({ where: { id: { in: ['id1', 'id2'] } } })
to do the "batch get"Adrien Wald
08/18/2022, 2:57 PMAdrien Wald
08/18/2022, 2:57 PMawait prisma.section.findMany({
where: {
OR: identifiers.map(({ resourceId, index }) => ({
resourceId,
index
}))
}
})
Derrick Antaya
08/18/2022, 3:02 PM10:39:53 api-service | SyntaxError: Unexpected end of JSON input
10:39:53 api-service | at JSON.parse (<anonymous>)
10:39:53 api-service | at /Users/XXX/WorkSpace/XXX/node_modules/@prisma/client/runtime/index.js:27224:31
10:39:53 api-service | at processTicksAndRejections (node:internal/process/task_queues:96:5)
I have turned on the debug mode and the queries it seems to be generating look fine to me. Filling in the $1.. with the actual data and running the query directly on the DB returns expected results.
Is there any thing else I can do to try and figure out what is causing this error?Eduardo Maíllo Conesa
08/18/2022, 3:54 PMasync byConditionAndType(
accountId: string,
input: PatientDataLogGetInput,
take?: number,
cursor?: Prisma.DataLogWhereUniqueInput,
): Promise<DataLog[]> {
return await this.prisma.dataLog.findMany({
take,
skip: 1,
cursor,
where: {
accountId: accountId,
condition: input.condition,
logType: input.logType,
},
orderBy: {
createdAt: 'desc',
},
});
}
The resolver:
@Query(() => [OutputType])
async getDataLogsByConditionAndType(
@Args('input') input: DataLogGetInput,
@Args('take') take?: number,
@Args('cursor') cursor?: Prisma.PatientDataLogWhereUniqueInput,
): Promise<DataLog[]> {
const accountId = context.req.user?.accountId;
try {
return await this.dataLogService.byConditionAndType(accountId, input, take, cursor);
} catch (e) {
throw new ApolloError(e.message);
}
}
The Error:
Undefined type error. Make sure you are providing an explicit type for the "getDataLogsByConditionAndType" (parameter at index [3]) of the "DataLogResolver" class.
What type should cursor
be in the resolver endpoint to align with the method making the prisma query?
The cursor is the id column if the table (uuidv4)
bty, I am following this article (cursor pagination section)
Thanks !!!guilherme
08/18/2022, 4:09 PMreturn await this.alertRepository.update({
where: {
id,
},
data: {
...alertData,
AlertAction: {
updateMany: {
data: AlertAction,
where: {},
},
},
},
});
guilherme
08/18/2022, 4:09 PMTypeError: value.map is not a function
at tryInferArgs
guilherme
08/18/2022, 4:10 PMJustin F
08/18/2022, 5:27 PMJustin F
08/18/2022, 5:27 PMserver {
listen 80; # you can use 443 and letsencrypt to get SSL for free
server_name 143.198.151.73; # domain name
#access_log /var/log/somestuff/access.log; # mkdir dir first
#error_log /var/log/somestuff/error.log error;
# for public asset into _next directory
location _next/ {
alias /var/www/html/nextjs/.next/;
expires 30d;
access_log on;
location / {
# reverse proxy for next server
proxy_pass <http://localhost:8000>; # your nextJs service and port
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# we need to remove this 404 handling
# because next's _next folder and own handling
# try_files $uri $uri/ =404;
}
}
}
Kerem Kazan
08/18/2022, 6:07 PMAdamRajch
08/18/2022, 7:31 PMWilliam GM
08/19/2022, 2:15 AMprimary key
create table shipment_entry_detail (
shipment_entry_id uuid
shipment_entry_detail_id int
notes text
);
I also have a trigger that populates the shipment_entry_detail_id
which is a sequence based on the rows of shipment_entry_id
.
It works perfectly but the prisma client expects the shipment_entry_detail_id
to be populated by me, is there a way to tell prisma that I GOT IT? (😅)Samrith Shankar
08/19/2022, 9:55 AM/opt/prisma-binary
I have set the above value as PRISMA_QUERY_ENGINE_BINARY
. When I try to run a create
request, I get the following error:
Invalid `this.prisma.user.create()` invocation in
/var/task/src/lambda.js:482655:43
482652 throw new Error("Not found. Proceeding to create!");
482653 }
482654 } catch (_a4) {
→ 482655 user = await this.prisma.user.create(
spawn /opt/prisma-binary EACCES
at RequestHandler.request (/var/task/src/lambda.js:123709:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async PrismaService._request (/var/task/src/lambda.js:124590:22)
at async AuthService.verifyOTP (/var/task/src/lambda.js:482655:20) {
code: 'EACCES',
clientVersion: '3.15.2',
meta: undefined
}
This works locally, but gives the above error on lambda. Any idea why?Lars Ivar Igesund
08/19/2022, 10:59 AMLars Ivar Igesund
08/19/2022, 10:59 AMBastien Etienne
08/19/2022, 12:06 PMroshan karki
08/19/2022, 2:23 PMWill Binette
08/19/2022, 2:45 PMMarley
08/19/2022, 2:53 PMSlackbot
08/19/2022, 3:03 PMAmol Patel
08/19/2022, 4:06 PMBrayden Abick
08/19/2022, 7:42 PMmodel PairReading {
pair String @db.VarChar
time DateTime @db.Timestamptz(6)
reading0 Decimal @db.Decimal
reading1 Decimal @db.Decimal
}
However, when I try to insert something like:
{
pair: '1542-AC',
time: 2022-07-20T00:00:00.000Z,
reading0: 999999961227775700000,
reading1: 0.000007021900962402
}
I get the following error:
code: 'P2033',
clientVersion: '4.1.0',
meta: {
details: "Query parsing failure: A number used in the query does not fit into a 64 bit signed integer. Consider using `BigInt` as field type if you're trying to store large integers."
}
I am using Postgres, in my DB the reading0 and reading1 are numeric types and if I manually create a record with those values in that object above it inserts into the DB without any issues so the issue is coming from Prisma side. If I use other values with smaller numbers for readings, prisma doesnt throw anything and it inserts fine but for larger amounts like above it fails