-
Notifications
You must be signed in to change notification settings - Fork 46
Description
This is probably a subset of #31, but I'm making a fresh issue because maaaybe it's a simple enough subset that I'll be able to do it myself.
I'm building a Todo app. Every user gets their own Todo list (in their own Todo Durable Object, backed by their own DO sqlite database).
As an admin, only I will be able to use the studio to look into every user's database.
All database access will via bindings inside the Worker, there won't be any http access (except I suppose by the studio?)
What's the least number of modifications I'd have to make to make this work for me? Correct me if I'm wrong)
- I'd have to read a database id dynamically (probably via cookie that I've authed the user on the app) and pass it here
Line 145 in 460bc21
const id: DurableObjectId = env.DATABASE_DURABLE_OBJECT.idFromName(DURABLE_OBJECT_ID); - I could pass the user id into the url for /studio/userId, and add it as a header to every request made here
starbasedb/src/studio/index.ts
Line 41 in 460bc21
"Authorization": "Bearer ${apiToken}"
But every user's database must have the same schema too. How do you suggest I go about that, should I manually create tables here?
Line 55 in 460bc21
What do you think I'm missing? happy to do some legwork here. Super impressed with this, and would love it to become my daily driver for my projects.