Declare the column
Declare one nullablefile() column and include it in the table policy.
src/schema.ts
Bind the browser client
The browser uses a schema locator becauseschema.ts imports server-only Better Auth definitions.
createChardbReactClient, and the browser sends the Better Auth session cookie automatically. CharDB checks the active organization, current membership, table policy, row ID, and opaque file ID before returning bytes.
Do not store an R2 URL or object key. Store only the
FileId returned by the upload.