Jonathan Stevens
10/16/2021, 9:23 PMRichard Prins
10/16/2021, 10:06 PMNathaniel Babalola
10/16/2021, 10:39 PMWilliam Stanley
10/17/2021, 3:23 AMUser -in-> Organization -has_many-> Skus
At the moment I am doing:
let inventory = await prisma.user
.findUnique({ where: { id } })
.organization()
.skus({
where: {
product: {
...(name && { name: { contains: name, mode: "insensitive" } }),
},
},
select: {
id: true,
organization: true,
condition: true,
language: true,
binLocation: true,
inventoryEntries: true,
product: {
select: { uuid: true, identifiers: true, name: true },
},
},
});
is there a way to do it from: prisma.sku.findMany()
or am I needlessly worried?Tom
10/17/2021, 7:28 AMUnable to init PersistenceStore undefined
in prisma studio: It could be because of the firefox setting Firefox will never remember history
user
10/17/2021, 9:17 AMCraig Bennett
10/18/2021, 2:37 AMz
10/18/2021, 6:08 AMMagne Skutle
10/18/2021, 7:40 AMSunao Suzuki
10/18/2021, 8:46 AMMartí Crespí
10/18/2021, 10:16 AMDATABASE_URL
located in schema.prisma file from prisma 2.30.0 to 3.2.1? I'm using NestJS with prisma and now when I try to start the app is throwing an error, and before to upgrade it didn't happen.. My app when starts get the variable from consul but it seems that prisma requires before to load the app..Martí Crespí
10/18/2021, 10:16 AM[Nest] 8 - 10/18/2021, 10:08:42 AM LOG [InstanceLoader] InternalModule dependencies initialized +1ms
[Nest] 8 - 10/18/2021, 10:08:42 AM LOG [InstanceLoader] ScheduleModule dependencies initialized +4ms
[Nest] 8 - 10/18/2021, 10:08:42 AM LOG [InstanceLoader] CronModule dependencies initialized +1ms
[Nest] 8 - 10/18/2021, 10:08:42 AM LOG [InstanceLoader] GraphqlModule dependencies initialized +0ms
[Nest] 8 - 10/18/2021, 10:08:42 AM LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +2ms
[Nest] 8 - 10/18/2021, 10:08:42 AM LOG [InstanceLoader] GraphQLModule dependencies initialized +1ms
(node:8) UnhandledPromiseRejectionWarning: Error: error: Environment variable not found: DATABASE_URL.
--> schema.prisma:12
|
11 | provider = "postgresql"
12 | url = env("DATABASE_URL")
|
Validation Error Count: 1
at LibraryEngine.loadEngine (/node_modules/@prisma/client/runtime/index.js:26778:21)
at async LibraryEngine.instantiateLibrary (/node_modules/@prisma/client/runtime/index.js:26708:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see <https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode>). (rejection id: 1)
(node:8) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8) UnhandledPromiseRejectionWarning: Error: error: Environment variable not found: DATABASE_URL.
--> schema.prisma:12
|
11 | provider = "postgresql"
12 | url = env("DATABASE_URL")
Martí Crespí
10/18/2021, 10:20 AMNeil Oliver
10/18/2021, 10:55 AMPaulo Spiguel
10/18/2021, 12:26 PMnode:29) UnhandledPromiseRejectionWarning: Error: Query engine library for current platform "linux-musl" could not be found.
app-api | You incorrectly pinned it to linux-musl
app-api |
app-api | This probably happens, because you built Prisma Client on a different platform.
app-api | (Prisma Client looked in "/usr/app/node_modules/@prisma/client/runtime/libquery_engine-linux-musl.so.node")
app-api |
app-api | Searched Locations:
app-api |
app-api | /usr/app/node_modules/.prisma/client
app-api | /home/paulospiguel/www/dkpa/doggie/api/node_modules/@prisma/client
app-api | /usr/app/node_modules/@prisma/client
app-api | /usr/app/node_modules/.prisma/client
app-api | /usr/app/prisma
app-api | /tmp/prisma-engines
app-api | /usr/app/node_modules/.prisma/client
app-api |
app-api |
app-api | To solve this problem, add the platform "linux-musl" to the "binaryTargets" attribute in the "generator" block in the "schema.prisma" file:
app-api | generator client {
app-api | provider = "prisma-client-js"
app-api | binaryTargets = ["native"]
app-api | }
app-api |
app-api | Then run "prisma generate" for your changes to take effect
Oliver St.
10/18/2021, 12:37 PMgenerator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl"]
}
Paulo Spiguel
10/18/2021, 12:57 PMMykyta Machekhin
10/18/2021, 1:29 PMIbad Shaikh
10/18/2021, 1:43 PMYassine
10/18/2021, 1:45 PMEdward Baer
10/18/2021, 2:05 PMIbad Shaikh
10/18/2021, 3:07 PMprisma.offer.findFirst()
invocation:\n\n\n Failed to validate the query: Field does not exist on enclosing type.
at `Query.findFirstoffer.offer.price`",
My query to fetch offer:
const offer = await prisma.offer.findFirst({
where: {
id: Number(req.params.id),
is_active: true,
}
})
Unable to figure out why it is not considering price as a field in the offer table and throwing Field does not exist on enclosing type.
(Struggling with this for the last two days and still didn't found a solution out there)
@Ryan Please guide me.
Thanking you in advance :)Bruno Marques
10/18/2021, 5:23 PMJason Abbott
10/18/2021, 6:47 PM@db.VarChar(25)
, for example, to emit code to warn/trim/whatever on more than 25 characters but none of the @db.
annotations are present in the DMMF. I can only see the field is a String
.
Is there another way to get this information?Sam
10/18/2021, 7:26 PMSELECT *
FROM guildStats
WHERE (guildId, TIMESTAMP) IN (SELECT guildId, MAX(TIMESTAMP)
FROM guildStats
GROUP BY guildId)
Simon Betton
10/18/2021, 8:34 PMcreatedAt DateTime? @default(now())
Generated TypeScript: createdAt: Date | null
Is this expected? Is this configurable to change? Otherwise I have to pass a value for these optional fields..Josh
10/19/2021, 1:47 AMhenry
10/19/2021, 7:10 AMDev__
10/19/2021, 7:43 AMDecimal
in prisma is higher than 0. if I use >
operators TS says it cannot be applied to types 'Decimal'
Oliver St.
10/19/2021, 9:04 AM