Ramesh
06/27/2021, 9:10 AMAntoin Campbell
06/27/2021, 4:23 PMprisma migrate deploy
during the build step and im getting this error:
[builder 7/9] RUN npx prisma migrate deploy:
#11 1.611 Prisma schema loaded from prisma/schema.prisma
#11 1.644 Error: Get config: Schema Parsing P1012
#11 1.644
#11 1.644 error: Environment variable not found: DATABASE_URL.
#11 1.644 --> schema.prisma:6
#11 1.644 |
#11 1.644 5 | provider = "postgresql"
#11 1.644 6 | url = env("DATABASE_URL")
#11 1.644 |
#11 1.644
#11 1.644 Validation Error Count: 1
#11 1.644
I have the DATABASE_URL
environment variable set inside of the cloud run service environment but I have a feeling this is probably not helpful during the build step as I believe that is a runtime concern.
anyone have any thoughts or suggestions on this flow/problem?Sasi
06/27/2021, 5:06 PMRunning generate... (Use --skip-generate to skip the generators)
Error: Schema parsing
error: Found argument '--enable-experimental' which wasn't expected, or isn't valid in this context
Did you mean --enable-playground?
USAGE:
query-engine-debian-openssl-1.1.x --enable-playground
Sasi
06/27/2021, 5:06 PMprisma migrate dev
Sasi
06/27/2021, 5:08 PMTemm
06/27/2021, 9:06 PMTemm
06/28/2021, 6:47 AMMartí Crespí
06/28/2021, 6:50 AMprisma introspect
works as expected, generating my models and all its relations. Then, I run prisma generate
and works well too. But when I try to debug my app it throws an exception telling me that my database is not running..
Can't reach database server at `localhost`:`5432`
Please make sure your database server is running at `localhost`:`5432`.
at LineStream.<anonymous> (d:\Prisma2-test\node_modules\@prisma\client\runtime\index.js:27666:31)
at LineStream.emit (events.js:200:13)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at LineStream.Readable.push (_stream_readable.js:210:10)
at LineStream.Transform.push (_stream_transform.js:150:32)
at LineStream._pushBuffer (d:\Prisma2-test\node_modules\@prisma\client\runtime\index.js:3829:19)
at LineStream._transform (d:\Prisma2-test\node_modules\@prisma\client\runtime\index.js:3823:10)
at LineStream.Transform._read (_stream_transform.js:189:10)
at LineStream.Transform._write (_stream_transform.js:177:12) {clientVersion: '2.25.0', errorCode: undefined, stack: 'Error: Can't reach database server at `localh…ransform._write (_stream_transform.js:177:12)', message: 'Can't reach database server at `localhost`:`…ase server is running at `localhost`:`5432`.'
Someone knows what could be happening?Eslam Genedy
06/28/2021, 8:42 AMjasci
06/28/2021, 9:35 AMsomeModelName2
?
prisma.someModelName0.findUnique(...).someModelName1().someModelName2({
include: {
someModelName3: {
select: {
someFieldName: true
}
}
}
})
I didn’t found any info about this in the Fluent Api docs. I mean the usage of select
and include
here.
It seems that it’s working, but wanted to ask anyway.
Thank you.jasci
06/28/2021, 10:06 AMUser
model with a relation field posts
When I annotate some variable as User type it doesn’t expect to include posts, cause it’s a relation. How can I specify that it’s a User type that includes posts. Or maybe I can annotate even more like it’s a User type with only name and posts (as if I used include posts and select name)
I see that when I use select
or include
it properly resolves types. How can I manually do it ?Ighor Martins
06/28/2021, 10:21 AMuser
06/28/2021, 10:25 AMBa Thien Tran
06/28/2021, 10:31 AMAdam
06/28/2021, 11:59 AMaqib
06/28/2021, 1:11 PMprsima version 1
and implementing the subscription, when running the subscription in playground and executing a mutation in another tab in the playground I see that the subscription is not responding to the changes in the db it is just spinning. Do I need to use pubSub in the mutation resolvers.Julien Goux
06/28/2021, 3:10 PMTim Mensch
06/28/2021, 4:20 PMawait prisma.myTable.deleteMany();
...and I'm getting an error from Prisma. When I replace it with
await prisma.$executeRaw(`DELETE FROM "myTable";`);
It works fine. I'm using PostgreSQL. I really want to rely on Postgres to enforce any constraints, if only because, well, Postgres is going to do the foreign key constraint check anyway, and therefore whatever query Prisma is performing to verify the constraint is 100% wasted time.
This particular situation is easily worked around (and it's mostly irrelevant anyway, since it's part of the debug DB seed code); what worries me is any more "trying to be smart" queries Prisma might be doing every time any change is made to the data that mean we get 2-3x as many DB calls as actually required for an operation.
(As to why I was getting a bogus error: I'm using the "hacked" @view
approach to expose a MATERIALIZED VIEW
to Prisma. I don't actually care that the mapping isn't perfect, so it's not really relevant, unless somehow the @view
approach is causing the extra query above.)Peter Kellner
06/28/2021, 4:21 PM"Cannot read property 'profile' of undefined",
I notice that the profile adding instructions are the same for all the other examples (or at least for the Profile add). My question is: "Does anyone of completed code that works for adding a Profile, and specifically the first mutation in the example?
After debugging some, the code in the mutation that seems to be problematic is here in the line context.prisma.profile.create
t.field("addProfileForUser", {
type: "Profile",
args: {
email: stringArg(),
bio: stringArg(),
},
resolve: async (_, args, context) => {
return context.prisma.profile.create({
data: {
bio: args.bio,
user: {
connect: {
email: args.email || undefined,
},
},
},
});
},
mutation {
addProfileForUser(
userUniqueInput: {
email: "<mailto:mahmoud@prisma.io|mahmoud@prisma.io>"
}
bio: "I like turtles"
) {
id
bio
user {
id
name
}
}
}
prisma chobo
06/28/2021, 4:27 PMuser = await prisma.user.create({
data: {
email,
password: hashedPassword,
phoneNumber,
accounts: {
create: [
{
type,
profile: {
create: [
{
email,
firstName,
lastName,
phoneNumber,
}
]
}
},
],
},
},
});
Pierre Ortega
06/28/2021, 4:28 PMprisma chobo
06/28/2021, 4:28 PMprisma chobo
06/28/2021, 4:28 PMSpencer Curry
06/28/2021, 6:32 PMPeter Kellner
06/28/2021, 6:44 PMMichael Grigoryan
06/28/2021, 7:05 PMschema.prisma
that I want to achieve
const uuid = require("uuid");
model User {
id Int @default(autoincrement()) @id
email String @unique
name String?
posts Post[]
profile Profile?
}
Michael Grigoryan
06/28/2021, 7:05 PMuser
06/29/2021, 7:08 AMJemin Kothari
06/29/2021, 7:56 AMEdmir Suljic
06/29/2021, 9:45 AM