Drive files
drive-filesThe part of the drive module that needs attachments, versions, trash and share-links: file uploads and revisions with an optional usage quota, extracted text, storage policies, the bin, starred and recent items, folder share links and the purge event. Installed with drive.
Content & filesmanagedcustom
Install
The command also installs updated-at, memberships, permissions, attachments, the modules it needs.
npx better-supabase add drive-filesConfigure
The blocks entries in your config, with the default mode.
import { defineConfig } from "better-supabase/config";
export default defineConfig({
blocks: {
// Required by drive-files; add installs them too.
"updated-at": {},
memberships: {},
permissions: {},
attachments: {},
// Modes: "managed", "custom". The default is "managed".
"drive-files": { mode: "managed" },
},
});Migrations
The files
npx better-supabase add drive-files writes into your declarative schema with the default layout.Client
This block is SQL only: call its functions from your policies, RPCs and the other modules.
Events
With the outbox installed, the module writes these in the same transaction as the change.
This module writes no outbox events.
Dependencies
Recipes
No UI recipe uses it yet. See all recipes.
More in Content & files
- Collaborative documentsdocumentsYjs documents attached to any subject: an update log, a compacted snapshot, a private realtime topic per document for updates and presence, suggestions that editors accept into the log, and named versions through the versions module.
- DrivedriveFolders and files on the attachments module: access granted to users, teams or roles and inherited down the tree, enforced by storage policies too; moves and renames with a name-conflict policy; revisions through versions, a bin through trash, starred and recent items through share-links' user state, and folder share links.
- FormsformsForms with numbered versions (steps and show or skip logic), a JSON Schema 2020-12 per version that validates every submission, drafts, public links through share-links with a rate limit and a bot-check hook, handlers that turn a submission into a record, scoring against an answer key respondents can't read, and NPS rollups.React hooks
- SignaturessignaturesSimple electronic signatures on a frozen version of a record: drawn, typed or click signatures in parallel or in order, a hash that detects edits after signing, and an approval step a signer can decide.
- TemplatestemplatesTyped, versioned templates (system starters and tenant forks) that create records, with merge fields and workflows started on each record they create.
- CoursescoursesCourses of modules and lessons ordered by rank keys, with quiz lessons graded by forms, per-lesson progress, completion and certificates. Each course runs as an enrollment program, so learners enroll through enrollments.