use sqlx::{Database, Executor, QueryBuilder};
use crate::table::{RowValue, TableColumn, TableStoreError};
pub trait SqlxReadModelBackend: Database {
const BACKEND: &'static str;
const INTEGER_STORAGE: &'static str;
fn push_row_value_bind(
builder: &mut QueryBuilder<Self>,
value: RowValue,
column: &TableColumn,
) -> Result<(), TableStoreError>;
fn push_null_bind(
builder: &mut QueryBuilder<Self>,
column: &TableColumn,
) -> Result<(), TableStoreError>;
fn rows_affected(result: &Self::QueryResult) -> u64;
fn push_select_column(builder: &mut QueryBuilder<Self>, column: &TableColumn);
fn row_value(row: &Self::Row, column: &TableColumn) -> Result<RowValue, TableStoreError>;
fn push_change_notify<'e, E>(
_executor: E,
_tables: &std::collections::BTreeSet<String>,
) -> impl std::future::Future<Output = Result<(), TableStoreError>> + Send
where
E: Executor<'e, Database = Self> + Send,
{
async { Ok(()) }
}
}