Silvan
Explore posts from serversBABetter Auth
•Created by Silvan on 4/19/2025 in #help
organization plugin for "embedded" use case (no user login)
Simple example to understand my question better. You have a restaurant and a few ipad minis. now each staff gets an ipad. instead of requiring the staff to create an account and be invited, id want that the admin can create a staff "with just name" and then generate like a magic link that logs you into a session with the correct permissions.
Is this possible? any tips to get on the right track for this?
Currently im assuming i just need to create an account for them with some fake email and random password they will never use
2 replies
BABetter Auth
•Created by Silvan on 4/11/2025 in #help
Cloudflare assets_navigation_prefers_asset_serving breaking oauth redirect

2 replies
DTDrizzle Team
•Created by Silvan on 4/7/2025 in #help
Custom query at the end of migrations
So for some context, i use Durable objects which require me to run the migrate function alot. most of the time this will be skipped because the db has not changed so its not an issue.
But i was wondering what would be a good way of running a
pragma optimize
at the end? i only want to run this IF there has been changes aka if the migrations arent skipped.
Simple way is obviously manually adding that query in the last migration file but i was wondering if there is another way of doing this? the migrate function sadly dosent return a result that says if migrations ran or were skipped1 replies
DTDrizzle Team
•Created by Silvan on 3/26/2025 in #help
Durable Object example weird import
Here in thd docs https://orm.drizzle.team/docs/connect-cloudflare-do
There is the following import
import migrations from '../drizzle/migrations';
which i dont get?
Inside my drizzle folder i have the migration files .sql and a meta folder. Where does the migrations file come from?
I did see the
We need rules so we can import migrations in the next steps
```toml
[[rules]]
type = "Text"
globs = ["**/.sql"]
fallthrough = true
```
But do i need to run some command first?11 replies
CDCloudflare Developers
•Created by Silvan on 2/27/2025 in #workers-help
D1 adding more latency than expected
Im using sveltekit and i created 2 test routes. they essentially do the same but one does a select 1; in d1.
When warm the the difference in response time is 50ms which just seems super high considering the query takes less than 1ms.
I chose the cloest location to me when i created d1
I use workers with assets. here the code for both api endpoints i used to just test it out
Is this really the expected behaviour?
No Db:
With D1:
i tried without drizzle as well but i dont see a difference
5 replies
CDCloudflare Developers
•Created by Silvan on 2/24/2025 in #workers-help
How to debug "EvalError: Code generation from strings disallowed for this context"
Im aware that this is caused by eval and new Function. i moved my entire validation to https://www.npmjs.com/package/@cfworker/json-schema because i thought it was that. but it wasnt
im using worker assets with sveltekit. i checked the _workers.js but its really small and no eval or new Function there
4 replies
BABetter Auth
•Created by Silvan on 2/19/2025 in #help
DrizzleThe model "verification" was not found in the schema object. Please pass the schema
I just followed the installation + sveltekit guide.
Clicking the login action gives me a 500 on
http://localhost:5173/api/auth/sign-in/social
Server error is ERROR [Better Auth]: BetterAuthError [BetterAuthError: [# Drizzle Adapter]: The model "verification" was not found in the schema object. Please pass the schema directly to the adapter options.] {
cause: undefined
}
the tables exist i can query them too.
my hooks.server.ts
now it asks me to pass the schema. but drizzle schemas are usually just exported tables. theres no default export or what am i missing?4 replies
BABetter Auth
•Created by Silvan on 1/29/2025 in #help
CLI cant generate using SvelteKits $app import
So i just followed the guide. when i tried generating the db things i run into
ERROR [Better Auth]: [#better-auth]: Couldn't read your auth config. Error: Cannot find module '$app/environment'
not entirely sure why this dosent work in the cli? i could use vite env stuff but still weird error imo4 replies
CDCloudflare Developers
•Created by Silvan on 1/12/2025 in #pages-help
Recommended Project structure for Pages + Durable Objects + ..
So im currently running into the issue that i cant really get sveltekit + durable objects up.
I used the cf starter cli for sveltekit that worked all fine. but as soon as i add the do binding and run dev again i get no response.
I have a DoClass exported somewhere in my project but i feel like its just wrong.
I found this repo. In his case he splits the Pages with the Worker based things (monorepo). Is this the recommended approach?
https://github.com/harshil1712/votes-app-demo
6 replies
DTDrizzle Team
•Created by Silvan on 11/5/2024 in #help
How to set PRAMGA for Sqlite
Really not sure how this would be done here. Some of them are permanent but some need to be set on every connection. in my example something like:
PRAGMA foreign_keys = ON;
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA mmap_size = 134217728;
PRAGMA journal_size_limit = 67108864;
PRAGMA cache_size = -2000;
Where would i set these?
4 replies