boots
boots
CDCloudflare Developers
Created by Sithu Khant on 2/11/2025 in #workers-help
How D1 work with Drizzle ORM?
okay yeah one of my colleagues double checked bc i didn't have time to work on the templates this week — for note: our template handles a local D1 if you're interested in that. my colleague pointed out that your setup has a remote Dev database and a remote Prod database. still a nice solution you found, definitely seems like it works best for that case
12 replies
CDCloudflare Developers
Created by Sithu Khant on 2/11/2025 in #workers-help
How D1 work with Drizzle ORM?
to throw another example in the mix here, this is what we do for our template Hono app with Drizzle + D1: https://github.com/fiberplane/create-honc-app/blob/main/templates/d1/drizzle.config.ts it's a little less elegant, does a manual search for the local D1 database in .wrangler to find the correct file. which makes our migration scripts look like this:
"db:migrate": "wrangler d1 migrations apply honc-d1-database --local",
"db:migrate:prod": "ENVIRONMENT=production drizzle-kit migrate",
"db:migrate": "wrangler d1 migrations apply honc-d1-database --local",
"db:migrate:prod": "ENVIRONMENT=production drizzle-kit migrate",
then we rely on having separate .dev.vars and .prod.vars files. i gotta say, i rather like your solution @Sithu Khant – might end up updating our templates to use something like yours instead
12 replies
CDCloudflare Developers
Created by echoes221 on 9/29/2024 in #workers-ai
I'm trying to get started with workers
6 replies
CDCloudflare Developers
Created by echoes221 on 9/29/2024 in #workers-ai
I'm trying to get started with workers
ah also my prompt did include the instruction: "Use the tool "make_request". Always respond in valid JSON. Help the user test the happy path."
6 replies
CDCloudflare Developers
Created by echoes221 on 9/29/2024 in #workers-ai
I'm trying to get started with workers
i was using hermes 2 as an experiment but the latency was too high for my use case. i never had problems with not getting structured output, and did indeed use tool_choice, similar to the openai api. here's example code: https://github.com/fiberplane/fpx/blob/main/examples/ai-request-generation/src/index.ts
6 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
also depending on your oauth flow there are some interesting patterns you can do with that state param. (you can use it to reference a record in the database that understands the "state" of the user's authorization flow, i.e., pending or granted or rejected, and update it accordingly depending on the response from spotify)
18 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
of course!! good luck
18 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
you see this pretty often in oauth flows
18 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
18 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
yep! that's what i meant by state 🙂
18 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
yes
18 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
hmmmm even if you add it as a queryparam in the redirectUri?
18 replies
HHono
Created by Joker on 7/14/2024 in #help
Cookies not available in other Route
just off the cuff — my impression is that since you're redirecting the response from /login/:userId, the set-cookie header won't actually be sent. which would explain why you don't have the cookie in /callback it would be better to pass the userId param as part of the redirectUI, that way you can parse it from the url in /callback also most authorization providers will document a way to pass state in your auth url, the spotify docs might tell you how to do something like that
18 replies