Skip to main content

Module adapter

Module adapter 

Source
Expand description

The StorageAdapter trait.

Shaped by two consumers, not one. Building against Mongo alone bakes Mongo-isms into the interface and the Postgres port then fights it, which is what produced the 55 catalogued divergences upstream. The rule: if a method can only be implemented sensibly for one backend, the trait is wrong.

Two consequences visible in the signatures below:

  • No $ operators and no BSON. Queries are an AST the adapter lowers. Postgres cannot lower a raw Mongo query document, so accepting one here would be the first Mongo-ism.
  • Schema is passed in, not fetched. The adapter does not own a schema cache. A caller that already resolved the schema for a request threads it down, which is what keeps one request from evaluating half its work under two different schemas.

Structs§

WriteResult
What a write returns.

Traits§

StorageAdapter
Storage operations.

Type Aliases§

Row
A row as stored: Parse-format values, no backend encoding.