Kasir Barati
04/21/2022, 11:18 AMusername
field unique
, and id
is serial
. OK. Now when I insert { username: 'Ali' }
, It will be inserted and in the response I get {id: 1, username: 'Ali'}
and I try to insert it again, database will yells and says that username is duplicate. So I try something else - { username: 'Mohammad' }
- and this time it will be inserted but I realized something weird and strange, The response will be {id: 3, username: 'Mohammad' }
.
Why? Why id
jumps one number (The number 2 is missed, Number 2 was the duplicate username
)?
Any though?
• IMO this is not a good thing.Albin Groen
04/21/2022, 12:21 PMengineer1234
04/21/2022, 1:49 PMjustinhandley
04/21/2022, 2:25 PM@ResolveField(() => [JournalTag], { nullable: true })
tags(@Parent() user: User) {
return user?.tags
}
or
@ResolveField(() => [JournalTag], { nullable: true })
tags(@Parent() user: User) {
return this.data.user.findUnique({where: {id: user.id}}).tags()
}
The first one requires I include the data in the query, the second one doesn’t - what do you guys do?Kasir Barati
04/21/2022, 5:01 PMJuan Gonzalez
04/21/2022, 5:09 PMtype itemType = boolean | string | number;
Trenton K
04/21/2022, 8:41 PMContext: Timed out trying to acquire a postgres advisory lock (SELECT pg_advisory_lock(72707369)). Elapsed: 10000ms. See <https://pris.ly/d/migrate-advisory-locking> for details.
Luis Kuper
04/22/2022, 7:10 AMCONCAT(firstName, ' ', lastName) AS fullName
Oleg Rudak
04/22/2022, 8:42 AMdataProxy
previewFeature and $transaction
API
Confused because of Prisma 3.8 update:
dataProxy and interactiveTransactions are now mutually exclusive
Before Prisma 3.8.0, Prisma queries would fail whenever the Data Proxy and interactive transactions Preview features were used together
Tim Dehof
04/22/2022, 11:32 AMTeodoro Villanueva
04/22/2022, 1:37 PMTeodoro Villanueva
04/22/2022, 1:37 PMTeodoro Villanueva
04/22/2022, 1:37 PMEu Jin Kim
04/22/2022, 8:39 PMHugo Vallejo
04/22/2022, 8:56 PMHugo Vallejo
04/22/2022, 8:57 PMHugo Vallejo
04/22/2022, 8:59 PMlouis-sanna-eki
04/22/2022, 9:20 PMinterface CrudServices<T> {
getDocument: (id: number) => Promise<T>;
}
function buildCrudServices<T>(model): CrudServices<T> {
const getDocument = (id: number): Promise<T> =>
model.findUnique({ where: { id } });
return { getDocument };
}
How do I type model? Each of my model have costum type in the prisma client.Pranav Sathyanarayanan
04/23/2022, 1:32 AM2n+1
and our services operate with 4 vCPU . We currently have 20 instances of our service initialized and running; yet the steady state "# active connections" for our production database shows 320
active connections. Is there any information on how to debug why this may be occuring? I can't think of any other reason we would have so many connections open.Ian Ray
04/23/2022, 9:47 AMmodel OrderedNode {
id String @id @default(uuid()) @db.Uuid
predecessor_id String? @unique @db.Uuid
predecessor OrderedNode? @relation("predecessor_successor", fields: [predecessor_id], references: [id])
successor OrderedNode? @relation("predecessor_successor")
}
and I want the element with predecessor_id = null
to show up first, and successor = null
to show up last.Fiqri Syah Redha
04/23/2022, 4:32 PMsriram hegde
04/23/2022, 9:44 PMprisma chobo
04/23/2022, 10:19 PMmodel Role {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
// ****************************************************
application Application @relation(fields: [applicationId], references: [id])
applicationId String
user User[] @relation(fields: [userIds], references: [id])
userIds String[] @db.ObjectId
@@index([applicationId])
@@index([userIds])
@@index([applicationId, userIds])
}
This is a Role schema for mongodb. when I index like above, does it mean Im indexing applicationId only, and userIds only, and both combined applicationId and userids togerther??
So my purposes are
1. i want to get all users in the application (that is why i index @@index([applicationId])
2. I want to get all applications that a user belong to (@@index([userIds])
3. I want to check if a user exists in application (@@index[userids, applicationId])
Is it too much indices? should i get rid of @@index([appicationId, userIds])??
Thank you in advance!!Joe
04/23/2022, 11:30 PMSami Ullah
04/24/2022, 12:07 AMØrjan
04/24/2022, 12:13 AMDomenico Rutigliano
04/24/2022, 1:08 AMnilsso
04/24/2022, 4:22 AM”connect”
? Currently I’m getting that the create fails to return anythingRedeemer Pace
04/24/2022, 3:29 PMBurr Sutter
04/24/2022, 4:34 PM