Cornelius
07/14/2021, 1:57 PMCornelius
07/14/2021, 1:57 PMBenjamin Kroeger
07/16/2021, 11:19 AMexport type ModelWhereUniqueInput = {
id?: string
}
Ridhwaan Shakeel
07/17/2021, 10:21 PMJames
07/18/2021, 3:14 PMBen Ezard
07/19/2021, 12:37 PMJest has detected the following 1 open handle potentially keeping Jest from exiting:
● prisma-client-request
35564 | try {
35565 | let index = -1;
> 35566 | const resource = new import_async_hooks.AsyncResource("prisma-client-request");
| ^
35567 | const params = {
35568 | args: internalParams.args,
35569 | dataPath: internalParams.dataPath,
I'm calling prismaClient.$disconnect()
when tests are done; is there something else that I should be doing to avoid this?
I wasn't sure if this is a bug or not, but if it is then I'll raise an issue on GitHub about it 🙂hayes
07/20/2021, 7:09 PMhayes
07/20/2021, 7:32 PMBrian Woodward
07/22/2021, 8:21 PMprisma
and it's been great. At first, I didn't realized there's an additional executable that runs to make the client work. I replaced using pg
with @prisma/client
and noticed that my deployment to kubernetes kept crashing. This was due to having a low requested memory limit.
A couple of questions:
• Is there a minimum or recommended memory requirement to run the prisma
engine (postgres in this case)?
• What's the best way to monitor and possibly handle memory usage of the engine from within my Node.js process?sven
07/23/2021, 9:47 AMPhong Ho
07/29/2021, 9:14 AMDecimal.prototype.toJSON
Phong Ho
07/29/2021, 9:16 AMPhong Ho
07/29/2021, 9:17 AMresult[0].protection
’s type is decimal in prisma model.Niko Guerra
07/30/2021, 7:57 PMlog: ['info', 'error', 'warn', 'query']
turned on, but get nothing for one of my queries, and I've console logged my way to check that the function is properly async and is properly receiving data, it's just like the code skips over that block for some reason?Sting Alleman
07/31/2021, 10:12 PMasync getUser(
userId: string,
conf?: { include?: Prisma.UserInclude; select?: Prisma.UserSelect }
): Promise<User> {
return await this.prisma.user.findUnique({
where: { id: userId },
...conf
});
}
Now, If I do, for example, getUser("id", {include: { posts: true })
, the return type of getUser will be wrong, because it doesn't include the posts relation.
I can fix this using generics, but that would mean that I also always have to add the User
generic. Is there another, better way to fix these return types?Omkar Kulkarni
08/01/2021, 8:49 AMconst usersWithCount = await prisma.$transaction([
prisma.user.count({
where: { username: { startsWith: keyword.toLowerCase() } },
}),
prisma.user.findMany({
where: {
username: {
startsWith: keyword.toLowerCase(),
},
},
}),
])
return {
users: usersWithCount[1],
total: usersWithCount[0],
}
Jay Bell
08/02/2021, 5:32 PMprisma db push
I get
{
"timestamp": "2021-08-02T17:27:04.778303482+00:00",
"level": "ERROR",
"fields": {
"is_panic": false,
"error_code": "P1003",
"message": "Database `<db name>.public` does not exist on the database server at `localhost:5432`."
},
"target": "migration_engine::logger"
}
Shouldn't it create the db if it doesn't already exist? It does on another step in CI (and locally) which is weird... the step that does not work is using docker executor and the one that does work is using ubuntu machine executor (both on circleci)
Anyone have any ideas here? I am at a loss.koufatzis
08/03/2021, 11:28 AMkoufatzis
08/03/2021, 11:51 AMSlackbot
08/03/2021, 12:23 PMtimothé david
08/03/2021, 7:49 PMtimothé david
08/03/2021, 7:49 PMtimothé david
08/03/2021, 7:49 PMtimothé david
08/03/2021, 7:49 PMtimothé david
08/03/2021, 7:50 PM// This is your Prisma schema file,
// learn more about it in the docs: <https://pris.ly/d/prisma-schema>
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model user {
id Int @id @default(autoincrement())
access_token String @unique
refresh_token String @unique
expiry_date Int
email String @unique
}
timothé david
08/03/2021, 7:50 PMtimothé david
08/03/2021, 7:50 PMimport {
INestApplication,
Injectable,
OnModuleInit,
OnModuleDestroy,
} from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
async onModuleInit() {
await this.$connect();
}
async enableShutdownHooks(app: INestApplication) {
this.$on('beforeExit', async () => {
await app.close();
});
}
}
timothé david
08/03/2021, 7:50 PMtimothé david
08/03/2021, 7:51 PMtimothé david
08/03/2021, 7:52 PM