2.0 beta — new releases can include breaking changes. Stable 1.x docs
dimah-s3v2.0.0-beta.0
Database

Database

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

@dimah-s3/db is an optional plugin for dimahS3. It keeps object ownership, upload state, folders, 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 and quotas, file listings with folders, or server-side tracking of each upload.

What the plugin does

  • Tracks objects: writes a row when an upload starts, marks it active on confirm, and updates it on delete.
  • Enforces ownership: each file belongs to a scope you define (for example user:123), and upload tickets are bound to it. Download requires a confirmed (active) object owned by that scope, and delete rejects another scope. This is per-caller tenancy, not the route keyPrefix check: prefix isolation always runs in @dimah-s3/server.
  • Lists files: by scope on the server, and by folder, search, and sort in the browser.
  • Adds folders: logical folders, renames, moves, and typed attributes per object. Folders never change the S3 key.
  • Caps usage: checks a quota at upload and again with the verified size at confirm.

Authentication, quota values, and business rules stay application-owned. The plugin manages object metadata and scope isolation, and compares usage with the limits your application supplies.

Lifecycle

Each object moves through these statuses:

StatusMeaning
pendingUpload started, not confirmed
activeConfirmed in S3, with the verified size stored
deletedRemoved from S3, row kept (soft delete)
purgingExpired before confirm, and being cleaned up by purge

Typical flow: pending → active → deleted. A pending row expires with its upload ticket, and purge cleans up rows that never reached active.

Next steps

On this page