Omar Goubail
Omar Goubail
DTDrizzle Team
Created by Omar Goubail on 3/22/2024 in #help
Dealing with Supabase Auth
Hey thank you for your relpy, I did just that and I understand things a lot more thank you. But I have a small issue, I am working with local supabase, and the sql editor does not save queries, furthermore when I link my local project to my live environment will it apply my functions and triggers there too, or do I have to rewrite them there?
5 replies
DTDrizzle Team
Created by future_js_dev on 3/22/2024 in #help
Drizzle studio never loads.
did you run npx drizzle-kit studio?
11 replies
DTDrizzle Team
Created by irelynx on 1/15/2024 in #help
Weird Query builder behavior (extras)
I am still very curious and will probably try to learn more about this later. Thank you for your help though. Will let you know if I learn anything.
24 replies
DTDrizzle Team
Created by irelynx on 1/15/2024 in #help
Weird Query builder behavior (extras)
You were right, it worked thank you! But why does this happen though, is this a js Promises thing or a drizzle thing? I am not sure I understand why.
24 replies
DTDrizzle Team
Created by irelynx on 1/15/2024 in #help
Weird Query builder behavior (extras)
This example helped me alot thank you, but If you don't mind I have a question. In my case it doesn't return number it returns an an array of objects.
const numOfDevs = await db
.select({
numOfDevs: count(developer.id),
})
.from(property)
.where(eq(developer.developerId, String(developerId)))
// the numOfDevs returns [ { numOfDevs: 0 } ] not the number directly

const project = await db.query.project.findFirst({
where: eq(project.id, String(projectId)),
with: { categories: { with: { subCategories: {} } } },
extras: {
numOfDevs: sql<number>`${numOfDevs}`.as('numOfDevs'),
},
})
const numOfDevs = await db
.select({
numOfDevs: count(developer.id),
})
.from(property)
.where(eq(developer.developerId, String(developerId)))
// the numOfDevs returns [ { numOfDevs: 0 } ] not the number directly

const project = await db.query.project.findFirst({
where: eq(project.id, String(projectId)),
with: { categories: { with: { subCategories: {} } } },
extras: {
numOfDevs: sql<number>`${numOfDevs}`.as('numOfDevs'),
},
})
Did you by any chance find a way around this?
24 replies