Skip to content

Phase 2: record/metadata layer — a Python DataProvider (CRUD+query) mirror of the zodal contract #80

Description

@thorwhalen

Follow-up to #78 / #79 (which shipped the content half as dol.content). This issue tracks the record/metadata half of the content–metadata bifurcation: a queryable facade for the small rows that sit next to the blobs.

Motivation

dol.content gives a flat blob store + ContentRef. The other half of the pattern is a collection/record facade with CRUD + query, so an app can list/filter/paginate records whose large fields are offloaded to a content store (holding a ContentRef in their place). Our TypeScript side (zodal) already models exactly this as DataProvider<T>, and a Python mirror keeps the two ecosystems contract-compatible.

Proposed scope

Mirror zodal's @zodal/store contract in Python:

  • DataProvider-style facadeget_list(params) -> {data, total}, get_one(id), create, update, update_many, delete, delete_many (+ optional upsert). Structured sort/filter/search/pagination params, with a shared client-side filter_to_function fallback for backends that can't push predicates down.
  • Capability discovery — a ProviderCapabilities-style object so callers degrade gracefully (which ops / which pushdowns a backend supports).
  • Bifurcated composition — a bifurcated_provider(metadata_provider, content_provider, content_fields) that splits records on write (blobs → dol.content, rest → the metadata store), replaces content fields with ContentRefs on read, and runs the metadata-is-commit-point saga (delete content-first; compensate metadata on content-write failure).
  • wrap_provider codec layer (the analog of wrap_kvs; zodal's wrapProvider already cites dol).

Placement (per the zero-dep rule)

  • The abstract contract + in-memory/dict reference provider + bifurcated composition are pure stdlib → candidate for dol (or xdol if any helper needs a dep).
  • Concrete queryable backends (SQL, Supabase, etc.) carry deps → their own packages, never core dol.

Reference

  • zodal contract: zodal/packages/store/src/{data-provider,capabilities,bifurcated-provider,wrap-provider}.ts
  • design corpus: zodal/docs/research/ + misc/docs/dol_content_metadata_bifurcation.md

Deferred from the phase-1 decision ("blob now, DataProvider later").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions