Venyl
Venyl
Explore posts from servers
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
Ok I had a bad id in my relations
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
it shouldn't be
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
userCollections.flashcards is an empty array
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
wait
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
this solves my problem
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
Thank you
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
Oh my god why haven't I noticed that the with keyword works like that
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
so I'm trying to do something in this style
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
const userCollections = await db
.select({
id: flashcardCollections.id,
name: flashcardCollections.name,
flashcardCount: sql<number>``
})
.from(flashcardCollections)
.where(eq(flashcardCollections.creatorId, userId));
const userCollections = await db
.select({
id: flashcardCollections.id,
name: flashcardCollections.name,
flashcardCount: sql<number>``
})
.from(flashcardCollections)
.where(eq(flashcardCollections.creatorId, userId));
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
I've seen that queries like this don't work with aggregate functions and count is of such type
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
This works but doesn't return me the count
15 replies
DTDrizzle Team
Created by Venyl on 10/15/2023 in #help
Select item collection together with item count
const userCollections = await db.query.flashcardCollections.findMany({
where: eq(flashcardCollections.creatorId, userId),
});
const userCollections = await db.query.flashcardCollections.findMany({
where: eq(flashcardCollections.creatorId, userId),
});
15 replies