kbemaster
kbemaster
Explore posts from servers
DTDrizzle Team
Created by Tekipeps on 6/20/2024 in #help
How do I make .returning() return only the inserted value instead of array
I like to do the following, when I know I just return 1 element
const [insertedValue] = db.insert(table).values(someValue).returning()
const [insertedValue] = db.insert(table).values(someValue).returning()
11 replies
DTDrizzle Team
Created by kbemaster on 2/26/2024 in #help
Shouldn't the fields related to the Query API be of type <T | undefined> ?
Thanks!
6 replies
DTDrizzle Team
Created by kbemaster on 2/26/2024 in #help
Shouldn't the fields related to the Query API be of type <T | undefined> ?
I will try that
6 replies
DTDrizzle Team
Created by kbemaster on 2/26/2024 in #help
Shouldn't the fields related to the Query API be of type <T | undefined> ?
const lesson = db.query.lessonTable
.findFirst({
where: (columns, { eq }) => eq(columns.id, "lessonId"),
with:{
author: true
},
});

// lesson.author.name -> error because author was undefined and I tried to access .name
const lesson = db.query.lessonTable
.findFirst({
where: (columns, { eq }) => eq(columns.id, "lessonId"),
with:{
author: true
},
});

// lesson.author.name -> error because author was undefined and I tried to access .name
6 replies
DTDrizzle Team
Created by kbemaster on 2/22/2024 in #help
Guaranteed undefined for Nested Results? Type Mismatch in Query API
No description
4 replies
DTDrizzle Team
Created by kbemaster on 2/22/2024 in #help
Guaranteed undefined for Nested Results? Type Mismatch in Query API
No description
4 replies
DTDrizzle Team
Created by kbemaster on 2/22/2024 in #help
Guaranteed undefined for Nested Results? Type Mismatch in Query API
No description
4 replies
DTDrizzle Team
Created by MAST on 9/5/2023 in #help
[SOLVED] When running a big bulk insert I get an error, MAX_PARAMETERS_EXCEEDED
Thx!
20 replies
DTDrizzle Team
Created by MAST on 9/5/2023 in #help
[SOLVED] When running a big bulk insert I get an error, MAX_PARAMETERS_EXCEEDED
Is it a good idea to use Promise.all here?
20 replies
TtRPC
Created by kbemaster on 1/22/2024 in #❓-help
Is there any benefit to putting the db connection in the context versus having it as an global var?
a minute ago I found this thread but it is not clear for me
7 replies
TTCTheo's Typesafe Cult
Created by kbemaster on 1/22/2024 in #questions
Is there any benefit to putting the db connection in the context versus having it as an global var?
thank you for the explanation you were very clear
6 replies
TTCTheo's Typesafe Cult
Created by kbemaster on 1/22/2024 in #questions
Is there any benefit to putting the db connection in the context versus having it as an global var?
so it is a good idea only have the db conn inside the context
6 replies