dimah-s3v1.5.11
Database

Database

Optional plugin to track object ownership, lifecycle, and listings in your database.

@dimah-s3/db is an optional plugin for dimahS3. It keeps object ownership, upload state, and deletion history aligned with S3 without custom SQL on every endpoint.

dimah-s3 works without a database. Add this plugin when you need ownership checks, usage totals, file listings, or server-side multipart lifecycle tracking.

What the plugin does

  • Tracks objects — writes and updates a row on presign, confirm, and delete
  • Enforces ownership — each file belongs to a scope you define (for example user:123); download requires a confirmed (active) object owned by that scope; delete rejects access from another scope. This is per-caller tenancy, not the route keyPrefix check — prefix isolation always runs in @dimah-s3/server.
  • Lists files — query by scope on the server and in the browser
  • Tracks multipart — records in-progress uploads for ownership and stale cleanup; pair it with a client UploadStore to resume after the same local file is reselected

Authentication, quota values, and business rules stay application-owned. The plugin manages object metadata and scope isolation, and can compare usage with limits supplied by your application.

Lifecycle

Each object moves through three statuses:

StatusMeaning
pendingUpload started, not confirmed
activeConfirmed in S3 — verified size stored
deletedRemoved from S3

Typical flow: pending → active → deleted. Aborted multipart uploads and purge clean up rows that never reached active.

Next steps

On this page