Sabbir Hossain Shuvo
Sabbir Hossain Shuvo
Explore posts from servers
DTDrizzle Team
Created by Sabbir Hossain Shuvo on 3/10/2024 in #help
Filter from array
No description
2 replies
DTDrizzle Team
Created by Sabbir Hossain Shuvo on 1/25/2024 in #help
Filter (Where)
I want to make where is optional like is user add searchParams then it will search otherwise select all data from db. In the down I just shared my code,, please help me to fix that as soon as possible, please
const [lengths, profiles] = await Promise.all([
db.select({ count: sql<number>`count(*)` }).from(users),
db
.select()
.from(users)
.where(
or(
ilike(users.name, `%${searchParams}%`),
ilike(users.location, `%${searchParams}%`)
)
)
.limit(itemPerPage)
.offset(offset),
]);
const count = lengths[0].count;
const [lengths, profiles] = await Promise.all([
db.select({ count: sql<number>`count(*)` }).from(users),
db
.select()
.from(users)
.where(
or(
ilike(users.name, `%${searchParams}%`),
ilike(users.location, `%${searchParams}%`)
)
)
.limit(itemPerPage)
.offset(offset),
]);
const count = lengths[0].count;
7 replies
DTDrizzle Team
Created by Sabbir Hossain Shuvo on 1/20/2024 in #help
Drizzle Relations
Can any one help me to do this? like, we have a tweets so, each tweets have parent id/uuid, and author id/uuid. normally as we can see a tweet have lot's of children as children tweet which is belong on parent tweet. so, please help me make this with pg-core. i just face confusing in children tweet and parent tweet, how can i make a array of tweet which will belong on main tweet i mean parent tweet?
6 replies