Skip to main content

Crate parse_rust_storage

Crate parse_rust_storage 

Source
Expand description

StorageAdapter trait and the query/update AST adapters lower.

The trait must be shaped by two consumers, not one. Building against Mongo alone bakes Mongo-isms (BSON semantics, $ operators, implicit schema) into the interface, and the Postgres port then fights it, which is roughly what happened upstream and produced the 55 catalogued divergences. The rule: if a method can only be implemented sensibly for one backend, the trait is wrong.

0.2.0 added the query tree ($or/$and/$nor), the update op AST, atomic field reservation, join-table primitives and schema mutation. Aggregation, distinct and transactions are still absent, and a batch that asks for a transaction is refused rather than silently run without one.

Re-exports§

pub use adapter::AddFieldOutcome;
pub use adapter::Row;
pub use adapter::SchemaIndex;
pub use adapter::StorageAdapter;
pub use adapter::WriteResult;
pub use query::Clause;
pub use query::Comparison;
pub use query::Constraint;
pub use query::Query;
pub use query::QueryOptions;
pub use query::SortDirection;
pub use query::Update;
pub use query::UpdateValue;
pub use query::DEFAULT_LIMIT;
pub use schema::join_schema;
pub use schema::join_table_name;
pub use schema::ClassSchema;
pub use schema::FieldType;

Modules§

adapter
The StorageAdapter trait.
query
The query AST adapters lower, and the update AST they apply.
schema
Field types, and the per-class shape a transform needs.