pub struct DatabaseQueries;
Implementations§
Source§impl DatabaseQueries
impl DatabaseQueries
pub async fn truncate(pool: &PgPool) -> Result<()>
pub async fn add(pool: &PgPool, key: String, value: Vec<u8>) -> Result<()>
pub async fn load(pool: &PgPool) -> Result<HashMap<String, Vec<u8>>>
pub async fn add_currency(pool: &PgPool, currency: Currency) -> Result<()>
pub async fn load_currencies(pool: &PgPool) -> Result<Vec<Currency>>
pub async fn load_currency( pool: &PgPool, code: &str, ) -> Result<Option<Currency>>
pub async fn add_instrument( pool: &PgPool, kind: &str, instrument: Box<dyn Instrument>, ) -> Result<()>
pub async fn load_instrument( pool: &PgPool, instrument_id: &InstrumentId, ) -> Result<Option<InstrumentAny>>
pub async fn load_instruments(pool: &PgPool) -> Result<Vec<InstrumentAny>>
pub async fn add_order( pool: &PgPool, _kind: &str, updated: bool, order: Box<dyn Order>, client_id: Option<ClientId>, ) -> Result<()>
pub async fn add_order_snapshot( pool: &PgPool, snapshot: OrderSnapshot, ) -> Result<()>
pub async fn load_order_snapshot( pool: &PgPool, client_order_id: &ClientOrderId, ) -> Result<Option<OrderSnapshot>>
pub async fn add_position_snapshot( pool: &PgPool, snapshot: PositionSnapshot, ) -> Result<()>
pub async fn load_position_snapshot( pool: &PgPool, position_id: &PositionId, ) -> Result<Option<PositionSnapshot>>
pub async fn check_if_order_initialized_exists( pool: &PgPool, client_order_id: ClientOrderId, ) -> Result<bool>
pub async fn check_if_account_event_exists( pool: &PgPool, account_id: AccountId, ) -> Result<bool>
pub async fn add_order_event( pool: &PgPool, order_event: Box<dyn OrderEvent>, client_id: Option<ClientId>, ) -> Result<()>
pub async fn load_order_events( pool: &PgPool, client_order_id: &ClientOrderId, ) -> Result<Vec<OrderEventAny>>
pub async fn load_order( pool: &PgPool, client_order_id: &ClientOrderId, ) -> Result<Option<OrderAny>>
pub async fn load_orders(pool: &PgPool) -> Result<Vec<OrderAny>>
pub async fn add_account( pool: &PgPool, kind: &str, updated: bool, account: Box<dyn Account>, ) -> Result<()>
pub async fn load_account_events( pool: &PgPool, account_id: &AccountId, ) -> Result<Vec<AccountState>>
pub async fn load_account( pool: &PgPool, account_id: &AccountId, ) -> Result<Option<AccountAny>>
pub async fn load_accounts(pool: &PgPool) -> Result<Vec<AccountAny>>
pub async fn add_trade(pool: &PgPool, trade: &TradeTick) -> Result<()>
pub async fn load_trades( pool: &PgPool, instrument_id: &InstrumentId, ) -> Result<Vec<TradeTick>>
pub async fn add_quote(pool: &PgPool, quote: &QuoteTick) -> Result<()>
pub async fn load_quotes( pool: &PgPool, instrument_id: &InstrumentId, ) -> Result<Vec<QuoteTick>>
pub async fn add_bar(pool: &PgPool, bar: &Bar) -> Result<()>
pub async fn load_bars( pool: &PgPool, instrument_id: &InstrumentId, ) -> Result<Vec<Bar>>
pub async fn load_distinct_order_event_client_ids( pool: &PgPool, ) -> Result<HashMap<ClientOrderId, ClientId>>
pub async fn add_signal(pool: &PgPool, signal: &Signal) -> Result<()>
pub async fn load_signals(pool: &PgPool, name: &str) -> Result<Vec<Signal>>
pub async fn add_custom_data(pool: &PgPool, data: &CustomData) -> Result<()>
pub async fn load_custom_data( pool: &PgPool, data_type: &DataType, ) -> Result<Vec<CustomData>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DatabaseQueries
impl RefUnwindSafe for DatabaseQueries
impl Send for DatabaseQueries
impl Sync for DatabaseQueries
impl Unpin for DatabaseQueries
impl UnwindSafe for DatabaseQueries
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more