Skip to main content

D1DataStore

Struct D1DataStore 

Source
pub struct D1DataStore<E: D1Executor> { /* private fields */ }

Implementations§

Source§

impl<E: D1Executor> D1DataStore<E>

Source

pub fn new(executor: E, manifest: AppManifest) -> Self

Trait Implementations§

Source§

impl<E: D1Executor> DataStore for D1DataStore<E>

Source§

fn manifest(&self) -> &AppManifest

Source§

fn insert(&self, entity: &str, data: &Value) -> Result<String, DataError>

Source§

fn get_by_id(&self, entity: &str, id: &str) -> Result<Option<Value>, DataError>

Source§

fn list(&self, entity: &str) -> Result<Vec<Value>, DataError>

Source§

fn list_after( &self, entity: &str, after: Option<&str>, limit: usize, ) -> Result<Vec<Value>, DataError>

Source§

fn update( &self, entity: &str, id: &str, data: &Value, ) -> Result<bool, DataError>

Source§

fn delete(&self, entity: &str, id: &str) -> Result<bool, DataError>

Source§

fn lookup( &self, entity: &str, field: &str, value: &str, ) -> Result<Option<Value>, DataError>

Source§

fn query_filtered( &self, entity: &str, filter: &Value, ) -> Result<Vec<Value>, DataError>

Source§

fn query_graph(&self, query: &Value) -> Result<Value, DataError>

Source§

fn transact(&self, ops: &[Value]) -> Result<(bool, Vec<Value>), DataError>

Execute transactional operations. Each element is a JSON object with op (“insert”/“update”/“delete”), entity, and optionally id/data. Read more
Source§

fn aggregate(&self, _entity: &str, _spec: &Value) -> Result<Value, DataError>

Run an aggregation query. Read more
Source§

fn search(&self, _entity: &str, _query: &Value) -> Result<Value, DataError>

Run a faceted full-text search against a searchable entity. query is a JSON object with the keys defined by SearchQuery in pylon_storage::search; returns a JSON object shaped like SearchResult ({ hits, facetCounts, total, tookMs }). Read more
Source§

fn crdt_snapshot( &self, _entity: &str, _row_id: &str, ) -> Result<Option<Vec<u8>>, DataError>

Return the binary CRDT snapshot for a row, used by the router to ship a binary update over WebSocket after every successful write. Read more
Source§

fn crdt_apply_update( &self, _entity: &str, _row_id: &str, _update: &[u8], ) -> Result<Vec<u8>, DataError>

Apply a binary CRDT update from a client to the row’s LoroDoc, project the new state into the SQLite materialized view, and return the post-merge snapshot bytes (so the caller can broadcast them to OTHER subscribed clients). Read more

Auto Trait Implementations§

§

impl<E> Freeze for D1DataStore<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for D1DataStore<E>
where E: RefUnwindSafe,

§

impl<E> Send for D1DataStore<E>

§

impl<E> Sync for D1DataStore<E>

§

impl<E> Unpin for D1DataStore<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for D1DataStore<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for D1DataStore<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more