freddie
freddie
Explore posts from servers
KKinde
Created by freddie on 12/4/2024 in #💻┃support
How to get `post_login_redirect_url` to work
i did the same thing, but I was wondering two things: 1. if that parameter doesn’t work why does it exist — it does not add to the URL search params 2. how do I get that redirect URL back inside my callback I’d rather use the API itself than my own solution, but for now im doing exactly that; storing the URL in a cookie and then restoring it
12 replies
KKinde
Created by freddie on 12/4/2024 in #💻┃support
How to get `post_login_redirect_url` to work
"@kinde-oss/kinde-typescript-sdk": "^2.9.1",
12 replies
KKinde
Created by DanielPuleio on 12/4/2024 in #💻┃support
Kinde returning Invalid callback URL, even though the URL is in our allowed list
probably because anything after # is the hash and not a real part of the URL do you really have to use a hash router? i’d recommend against it unless absolutely necessary
2 replies
KKinde
Created by freddie on 12/4/2024 in #💻┃support
How to get `post_login_redirect_url` to work
I ended up making a work around storing it in cookies, but wonder if i could make use of this after all?
12 replies
DTDrizzle Team
Created by shahidcodes on 4/13/2024 in #help
Fetching many to many along with some aggregation using select
btw lodash’s get is well tested and gets bundled with tree shaking so i chose over rolling my own recursive
16 replies
DTDrizzle Team
Created by tzezar on 3/3/2024 in #help
Conditional join
you’ll need dynamic with generics like the example, let me make u a sample when i’m back on computer
6 replies
DTDrizzle Team
Created by tzezar on 3/3/2024 in #help
Conditional join
https://orm.drizzle.team/docs/dynamic-query-building
let query = await db
.select()
.from(documentLine)
.$dynamic()

if (filters.includes(documentId)) {
// add to query (optionally use $dynamic() again)
return query.leftJoin(document, eq(document.id, documentLine.documentId)));
}

// fallback to just running it
return query.run();
let query = await db
.select()
.from(documentLine)
.$dynamic()

if (filters.includes(documentId)) {
// add to query (optionally use $dynamic() again)
return query.leftJoin(document, eq(document.id, documentLine.documentId)));
}

// fallback to just running it
return query.run();
6 replies
DTDrizzle Team
Created by bernardoquina on 5/23/2023 in #help
Count in relational queries
and learn some sql along the way! drizzle core API > query builder 🤣
7 replies
DTDrizzle Team
Created by shahidcodes on 4/13/2024 in #help
Fetching many to many along with some aggregation using select
well discord wont let me paste the code here, so here it goes: https://tsplay.dev/wE2LgN
16 replies
DTDrizzle Team
Created by shahidcodes on 4/13/2024 in #help
Fetching many to many along with some aggregation using select
ok so I made a more reliable verson of that function but it uses lodash’s get
16 replies
DTDrizzle Team
Created by shahidcodes on 4/13/2024 in #help
Fetching many to many along with some aggregation using select
im doing some improvements on this function already, might release that as a little drizzle toolkit library later
16 replies
DTDrizzle Team
Created by shahidcodes on 4/13/2024 in #help
Fetching many to many along with some aggregation using select
you can use it like:
const results = await db
.select({
name: BatchModel.name,
customer: CustomerModel
})
.from(BatchModel)
.fullJoin(BatchToCustomer, eq(BatchModel.id, BatchToCustomer.batch_id))
.fullJoin(CustomerModel, eq(BatchToCustomer.customer_id, CustomerModel.id))
.groupBy(BatchModel.id)
.all();

const aggregated = aggregate({rows: results, id: "name", fields: {customers: "customer"}})
const results = await db
.select({
name: BatchModel.name,
customer: CustomerModel
})
.from(BatchModel)
.fullJoin(BatchToCustomer, eq(BatchModel.id, BatchToCustomer.batch_id))
.fullJoin(CustomerModel, eq(BatchToCustomer.customer_id, CustomerModel.id))
.groupBy(BatchModel.id)
.all();

const aggregated = aggregate({rows: results, id: "name", fields: {customers: "customer"}})
lmk if that works for you!
16 replies