pub struct MockQueryRepository { /* private fields */ }Expand description
Mock implementation of QueryRepository for testing
Implementations§
Source§impl MockQueryRepository
 
impl MockQueryRepository
Sourcepub fn set_should_fail(&mut self, should_fail: bool)
 
pub fn set_should_fail(&mut self, should_fail: bool)
Set whether operations should fail
Sourcepub async fn set_execution_result(&self, result: QueryResult)
 
pub async fn set_execution_result(&self, result: QueryResult)
Set mock execution result
Trait Implementations§
Source§impl Default for MockQueryRepository
 
impl Default for MockQueryRepository
Source§impl QueryRepository for MockQueryRepository
 
impl QueryRepository for MockQueryRepository
Source§fn execute_dataset_query<'life0, 'async_trait>(
    &'life0 self,
    query: DatasetQuery,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn execute_dataset_query<'life0, 'async_trait>(
    &'life0 self,
    query: DatasetQuery,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Execute a dataset query
Source§fn execute_raw_query<'life0, 'async_trait>(
    &'life0 self,
    query: Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn execute_raw_query<'life0, 'async_trait>(
    &'life0 self,
    query: Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Execute a raw query (JSON format)
Source§fn execute_pivot_query<'life0, 'async_trait>(
    &'life0 self,
    query: Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn execute_pivot_query<'life0, 'async_trait>(
    &'life0 self,
    query: Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Execute a pivot query
Source§fn export_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _format: &'life1 str,
    _query: Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<u8>>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn export_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _format: &'life1 str,
    _query: Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<u8>>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Export query results
Source§fn execute_native<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
    _sql: &'life1 str,
    _parameters: Option<HashMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn execute_native<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
    _sql: &'life1 str,
    _parameters: Option<HashMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Execute a native SQL query
Source§fn execute_native_query<'life0, 'async_trait>(
    &'life0 self,
    database_id: i32,
    query: NativeQuery,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn execute_native_query<'life0, 'async_trait>(
    &'life0 self,
    database_id: i32,
    query: NativeQuery,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Execute a native query object
Source§fn execute_mbql<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
    _mbql: &'life1 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn execute_mbql<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
    _mbql: &'life1 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Execute an MBQL query
Source§fn save_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    query: &'life1 Query,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Query>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn save_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    query: &'life1 Query,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Query>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Save a query
Source§fn get_query<'life0, 'async_trait>(
    &'life0 self,
    id: i32,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Query>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_query<'life0, 'async_trait>(
    &'life0 self,
    id: i32,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Query>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Get a saved query
Source§fn list_queries<'life0, 'async_trait>(
    &'life0 self,
    _pagination: Option<PaginationParams>,
    filters: Option<QueryFilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Query>>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn list_queries<'life0, 'async_trait>(
    &'life0 self,
    _pagination: Option<PaginationParams>,
    filters: Option<QueryFilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Query>>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
List saved queries
Source§fn update_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    id: i32,
    query: &'life1 Query,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Query>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn update_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    id: i32,
    query: &'life1 Query,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Query>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Update a saved query
Source§fn delete_query<'life0, 'async_trait>(
    &'life0 self,
    id: i32,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn delete_query<'life0, 'async_trait>(
    &'life0 self,
    id: i32,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Delete a saved query
Source§fn get_metadata<'life0, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_metadata<'life0, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Get query metadata (schema, tables, columns)
Source§fn validate_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
    _query_type: QueryType,
    _query: &'life1 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<bool>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn validate_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    _database_id: DatabaseId,
    _query_type: QueryType,
    _query: &'life1 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<bool>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Validate a query without executing
Auto Trait Implementations§
impl Freeze for MockQueryRepository
impl !RefUnwindSafe for MockQueryRepository
impl Send for MockQueryRepository
impl Sync for MockQueryRepository
impl Unpin for MockQueryRepository
impl !UnwindSafe for MockQueryRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more