ArwanceR
ArwanceR
DTDrizzle Team
Created by jrandeniya on 8/22/2023 in #help
I can't create a simple table..
I had the same issue after upgrading to 0.28.3, try downgrading to 0.28.2
6 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
happy to help
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
if there's no other API you will still have to use some workaround
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
but, that being said, I don't think sql will make you find other solution, since it's raw
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
but, to turn it on for all queries:
export const db = drizzle(pool, {
logger: true
})
export const db = drizzle(pool, {
logger: true
})
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
I don't think you can turn on logging per request
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
know where to put it ?
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
what sql it generates
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
you can turn logging on and check the generated query with this 'working' example
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
this is one solution, you might find other
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
well, I there was another solution, I would too use it : )
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
this might need some modifications, such as selecting more fields in select({})
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
modifying second example:
export async function getLoansLJ(spaceId: string) {
return db
.select({
financial_institutions: sql`(SELECT id,name,bic,logoUrl,country from financialInstitutions where financialInstitutions.id =
loans.financialInstitutionId))`
})
.from(loans)
.where(eq(loans.spaceId, spaceId));
}
export async function getLoansLJ(spaceId: string) {
return db
.select({
financial_institutions: sql`(SELECT id,name,bic,logoUrl,country from financialInstitutions where financialInstitutions.id =
loans.financialInstitutionId))`
})
.from(loans)
.where(eq(loans.spaceId, spaceId));
}
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
I see, have you thought about using a subquery?
33 replies
DTDrizzle Team
Created by binajmen on 8/7/2023 in #help
Is it possible to have nested values when doing a leftJoin?
can you give an example of what 1st approach returns and what you're looking for ?
33 replies
DTDrizzle Team
Created by nqhtrung on 8/4/2023 in #help
How to implement interface for table?
Why do it the other way? You can first declare schema and be it your interface with
type User = InferModel<typeof user>
type User = InferModel<typeof user>
5 replies
DTDrizzle Team
Created by Will on 8/3/2023 in #help
How do I import a type?
You want to use typescript interface of your defined table schema right?
14 replies
DTDrizzle Team
Created by Set on 8/1/2023 in #help
Is there any way to specify onDeletes and onUpdates with drizzleORM?
4 replies
DTDrizzle Team
Created by Set on 8/1/2023 in #help
Is there any way to specify onDeletes and onUpdates with drizzleORM?
You can do that there:
4 replies
DTDrizzle Team
Created by mgarf on 7/29/2023 in #help
Cannot query DB table get `COALESCE types smallint and text cannot be matched`
how is UserTable.id declared?
4 replies