Skip to main content

SquelService

Trait SquelService 

Source
pub trait SquelService:
    Clone
    + MaybeSend
    + MaybeSync
    + 'static {
    // Required methods
    fn schema(&self) -> impl Future<Output = SchemaInfo> + MaybeSend;
    fn list(
        &self,
        request: ListRequest,
    ) -> impl Future<Output = Result<ListResponse, DibsError>> + MaybeSend;
    fn get(
        &self,
        request: GetRequest,
    ) -> impl Future<Output = Result<Option<Row>, DibsError>> + MaybeSend;
    fn create(
        &self,
        request: CreateRequest,
    ) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend;
    fn update(
        &self,
        request: UpdateRequest,
    ) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend;
    fn delete(
        &self,
        request: DeleteRequest,
    ) -> impl Future<Output = Result<u64, DibsError>> + MaybeSend;
}
Expand description

The Squel service trait - the data plane.

Provides generic CRUD operations for any registered table. Used by admin UIs that dynamically discover and interact with the schema.

Named “Squel” as a cute play on SQL.

Required Methods§

Source

fn schema(&self) -> impl Future<Output = SchemaInfo> + MaybeSend

Get the schema for all registered tables.

Source

fn list( &self, request: ListRequest, ) -> impl Future<Output = Result<ListResponse, DibsError>> + MaybeSend

List rows from a table with filtering, sorting, and pagination.

Source

fn get( &self, request: GetRequest, ) -> impl Future<Output = Result<Option<Row>, DibsError>> + MaybeSend

Get a single row by primary key.

Source

fn create( &self, request: CreateRequest, ) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend

Create a new row.

Source

fn update( &self, request: UpdateRequest, ) -> impl Future<Output = Result<Row, DibsError>> + MaybeSend

Update an existing row.

Source

fn delete( &self, request: DeleteRequest, ) -> impl Future<Output = Result<u64, DibsError>> + MaybeSend

Delete a row.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§