Marcel Overdijk
Marcel Overdijk
Explore posts from servers
CDCloudflare Developers
Created by Marcel Overdijk on 4/14/2025 in #workers-help
Rate Limiting API open beta feedback
Bump…
6 replies
CDCloudflare Developers
Created by Marcel Overdijk on 4/14/2025 in #workers-help
Rate Limiting API open beta feedback
or would it make more sense to use https://www.npmjs.com/package/@hono-rate-limiter/cloudflare using a Durable Object?
6 replies
CDCloudflare Developers
Created by Marcel Overdijk on 4/14/2025 in #workers-help
Rate Limiting API open beta feedback
cc @Matt Silverlock
6 replies
CDCloudflare Developers
Created by Marcel Overdijk on 4/14/2025 in #workers-help
Rate Limiting API open beta feedback
Correct, this is a binding the workers can use, and won't avoiding that the worker will get the request itself. But if early used in the worked you can prevent calling D1, KV etc. and of course sending an rate limited error to the client.
6 replies
CDCloudflare Developers
Created by Marcel Overdijk on 3/31/2025 in #workers-help
Periodically re-importing D1 database and Maintenance mode
If I rebind the D1 and KV namespace it takes immediate effect?
4 replies
CDCloudflare Developers
Created by Marcel Overdijk on 3/31/2025 in #workers-help
Periodically re-importing D1 database and Maintenance mode
Yes that sounds as good approach as well, thx! Now I'm also caching data in KV namespace, is there an easy way to purge the whole namespace? I would like to avoind having to clear all keys one by one...? Or should I create a new KV namespace and bind that to the worker (and delete the old one)?
4 replies
PPrisma
Created by Marcel Overdijk on 10/22/2024 in #help-and-questions
How to setup multiple Prisma clients in combination with `prismaSchemaFolder`
I changed the output path to ../../../node_modules/@prisma-db1/client and then I was able to import it with import { PrismaClient as DB1PrismaClient } from '@prisma-db1/client';
4 replies
PPrisma
Created by Marcel Overdijk on 9/12/2024 in #help-and-questions
Order by `rowid`?
Bump. Anyone an idea if this is possible?
3 replies
KKysely
Created by Marcel Overdijk on 9/9/2024 in #help
Dynamic query parts based on user input
Is that a serious answer, or being sarcastic? Nevertheless, I'm looking to see if this is possible with Kylesy or not...
5 replies
KKysely
Created by Marcel Overdijk on 9/9/2024 in #help
Dynamic query parts based on user input
e.g. I did a similar experiment with Drizzle ORM, and there I did something like:
const countryTableAlias = aliasedTable(countryTable, 'coun');
const countryJoin = leftJoin(countryTableAlias, eq(countryTableAlias.id, constructorTable.countryId));

const countryContinentTableAlias = aliasedTable(continentTable, 'coun_cont');
const countryContinentJoin = leftJoin(countryContinentTableAlias, eq(countryContinentTableAlias.id, countryTableAlias.continentId));

queryFields : {
'name': { col: constructorTable.name },
'country.code': { col: countryTableAlias.alpha2Code, join: countryJoin },
'country.continent.code': { col: countryContinentTableAlias.code, join: [countryJoin, countryContinentJoin] },
}
const countryTableAlias = aliasedTable(countryTable, 'coun');
const countryJoin = leftJoin(countryTableAlias, eq(countryTableAlias.id, constructorTable.countryId));

const countryContinentTableAlias = aliasedTable(continentTable, 'coun_cont');
const countryContinentJoin = leftJoin(countryContinentTableAlias, eq(countryContinentTableAlias.id, countryTableAlias.continentId));

queryFields : {
'name': { col: constructorTable.name },
'country.code': { col: countryTableAlias.alpha2Code, join: countryJoin },
'country.continent.code': { col: countryContinentTableAlias.code, join: [countryJoin, countryContinentJoin] },
}
which if fully type safe.
5 replies
DTDrizzle Team
Created by Marcel Overdijk on 9/1/2024 in #help
Using `$dynamic()` to enhance where clause
@alexblokh I experimented a bit with you suggestion to not pass the qb(anti pattern) . I'm now returning the filter and sort expressions from a helper, similar as the pagination informations. However for joins this I have a question for which I Created a separate post: https://discord.com/channels/1043890932593987624/1282601056244858910
22 replies
KKysely
Created by Marcel Overdijk on 9/5/2024 in #help
Error: don't await SelectQueryBuilder instances directly.
I'm now using this:
const qb = c.var.mydb
.selectFrom('customer')
.selectAll('customer');

const { query } = await this.applyQueryParams(qb)

const customers = await query.execute();
const qb = c.var.mydb
.selectFrom('customer')
.selectAll('customer');

const { query } = await this.applyQueryParams(qb)

const customers = await query.execute();
9 replies
KKysely
Created by Marcel Overdijk on 9/5/2024 in #help
Error: don't await SelectQueryBuilder instances directly.
thx @koskimas I already was using that (hopefully temporary) when I got the error:
async applyQueryParams<DB, TB extends keyof DB, O>(qb: SelectQueryBuilder<DB, TB, O>): Promise<{ qb: SelectQueryBuilder<DB, TB, O> }> {
..
return { qb };
}
async applyQueryParams<DB, TB extends keyof DB, O>(qb: SelectQueryBuilder<DB, TB, O>): Promise<{ qb: SelectQueryBuilder<DB, TB, O> }> {
..
return { qb };
}
and then using it like:
qb = (await this.applyQueryParams(qb)).qb;
qb = (await this.applyQueryParams(qb)).qb;
and that works. I must admit, it doesn't really look pretty 😉 my other alternative is to split retrieving the async request data and enhancing the query. that way I can make it non async
9 replies