#![warn(
clippy::all,
clippy::panic_in_result_fn,
clippy::await_holding_refcell_ref
)]
mod client;
mod session;
mod table;
mod table_data;
mod table_ref;
mod view;
pub mod virtual_server;
pub mod config;
#[rustfmt::skip]
#[allow(clippy::all)]
pub mod proto;
pub mod utils;
pub use crate::client::{Client, ClientHandler, Features, ReconnectCallback, SystemInfo};
use crate::proto::HostedTable;
pub use crate::proto::JoinType;
pub use crate::session::{ProxySession, Session};
pub use crate::table::{
DeleteOptions, ExprValidationResult, JoinOptions, Table, TableInitOptions, TableReadFormat,
UpdateOptions,
};
pub use crate::table_data::{TableData, UpdateData};
pub use crate::table_ref::TableRef;
pub use crate::view::{
ColumnWindow, OnUpdateData, OnUpdateMode, OnUpdateOptions, View, ViewWindow,
};
pub type ClientError = utils::ClientError;
pub type ExprValidationError = crate::proto::table_validate_expr_resp::ExprValidationError;
#[doc(hidden)]
pub mod vendor {
pub use paste;
}
impl From<&str> for HostedTable {
fn from(entity_id: &str) -> Self {
HostedTable {
entity_id: entity_id.to_string(),
index: None,
limit: None,
}
}
}
#[doc(hidden)]
#[macro_export]
macro_rules! assert_table_api {
($x:ty) => {
$crate::vendor::paste::paste! {
#[cfg(debug_assertions)]
fn [< _assert_table_api_ $x:lower >]() {
let _ = (
&$x::clear,
&$x::columns,
&$x::delete,
&$x::get_index,
&$x::get_limit,
&$x::get_client,
&$x::make_port,
&$x::on_delete,
&$x::remove_delete,
&$x::replace,
&$x::schema,
&$x::size,
&$x::update,
&$x::validate_expressions,
&$x::view,
);
}
}
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! assert_view_api {
($x:ty) => {
$crate::vendor::paste::paste! {
#[cfg(debug_assertions)]
fn [< _assert_table_api_ $x:lower >]() {
let _ = (
&$x::column_paths,
&$x::delete,
&$x::dimensions,
&$x::expression_schema,
&$x::get_config,
&$x::get_min_max,
&$x::num_rows,
&$x::remove_update,
&$x::on_delete,
&$x::remove_delete,
&$x::schema,
&$x::to_arrow,
&$x::to_columns_string,
&$x::to_json_string,
&$x::to_csv,
);
}
}
};
}