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.
Three 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.
- Updates are an op AST, not a row.
Incrementis not a value; expressing it as one is how 0.1.0 came to store{"__op":"Increment"}as a literal object.
Structs§
- Schema
Index - One entry of the schema API’s
indexesblock: a name, and the key document under it. - Write
Result - What a write returns.
Enums§
- AddField
Outcome - What happened when a field type was reserved.
Traits§
- Storage
Adapter - Storage operations.
Type Aliases§
- Row
- A row as stored: Parse-format values, no backend encoding.