hart
12/18/2021, 2:15 AMprisma db pull
which updated the schema a bit and added a name:
property to my unique:
attributes. For example (from git diff):
- @@unique([credentialSetLabel, orderId])
+ @@unique([credentialSetLabel, orderId], name: "Sweep.credentialSetLabel_orderId_unique")
This causes an issue with the vs code extension which now says
Error validating model "SweepMarket": The `name` property within the `@@unique` attribute only allows for the following characters: `_a-zA-Z0-9`.
but prisma validate
says the schema file is valid.
I'm using sqlite for the db.. anyone have an idea how I can make things work enough to be able to make/apply migrations? Also, I'm thinking this is a bug in the VS code extension but couldn't find anything in their githubhart
12/18/2021, 2:16 AMTimo
12/18/2021, 8:05 AMrandom
12/18/2021, 8:35 AMtake: 1
still get all rows related to that relationship.
export const users = () => {
return db.user.findMany({
select: {
id: true,
name: true,
userActivity: {
take: 1,
select: {
type: true,
createdAt: true,
},
},
},
})
}
random
12/18/2021, 8:37 AMNeo Lambada
12/18/2021, 10:24 AMhinogi
12/18/2021, 10:25 AMhinogi
12/18/2021, 10:27 AMOkan Yıldırım
12/18/2021, 10:29 AMOkan Yıldırım
12/18/2021, 10:30 AMwhere: { textEn: { not: null } },
Vilke
12/18/2021, 4:36 PMJin
12/19/2021, 2:40 PMJin
12/19/2021, 3:41 PMFirat Özcan
12/19/2021, 4:09 PMFirat Özcan
12/19/2021, 4:10 PMUserMeta
table and I cannot use @relation because Prisma then tells me, that the relation already exists and I only have to provide it in one of the tablesFirat Özcan
12/19/2021, 4:11 PMUserMeta
table so I can configure onDelete
on itFirat Özcan
12/19/2021, 4:11 PMuser
field is not optional and will always be thereJin
12/19/2021, 6:00 PMBenjamin LONGEARET
12/19/2021, 8:11 PMJames Mintram
12/19/2021, 9:29 PMinit
option, but the command errors as prisma has already been initialised for this project.Ryan Donohue
12/19/2021, 9:38 PMMichael Plaxico
12/19/2021, 9:56 PMPrismaClient
in a new Nest.js application. All of my secrets are managed in AWS Secrets Manager, because I’d like to avoid having any sort of secret/.env files in my source code. I am able to instantiate an instance of PrismaClient
programmatically, but the resulting client instance cannot be bound to my Prisma service in Nest.js. I’d like to bind that client to this.client
in my PrismaService
constructor, but, as you well know, constructors are synchronous and their declaration cannot be prefaced with async
to make them asynchronous either. My thinking is that, if I instantiate a single instance of PrismaClient
within my PrismaService
, I should then be able to import PrismaService
into my domain-specific service modules (e.g., cars.service.ts
, bicycles.service.ts
, etc.) then reference those services with my resolvers (e.g., cars.resolvers.ts
). What I don’t want to do--though what would probably work--is instantiate an instance of PrismaClient
when- and wherever I need to interact with a datasource. I’m aware that there are a few prescribed patterns for connecting to Prisma, but they all seem to involve environment variables or config files, whereas I’d like my own implementation to involve only the secrets I keep within AWS Secrets Manager and an instance of PrismaClient
that I instantiate within a PrismaService
.
Hopefully all of that makes sense. -_-;
Edit: I guess another thought that comes to mind is somehow accessing the environment variables stored within AWS Secrets Manager and . . . I don’t know . . . writing prescribing them to a container or something of the like whenever it is instantiated, though this sort of thing is admittedly beyond my depth and presumes that I am utilizing something like Docker.Jared Fraser
12/20/2021, 5:02 AMuser
12/20/2021, 8:46 AMuser
12/20/2021, 8:46 AMBarry
12/20/2021, 9:17 AMed
12/20/2021, 7:00 PMAlex Vilchis
12/20/2021, 7:15 PM