pub struct ParquetStore { /* private fields */ }Expand description
Parquet-based storage backend for tick and bar data.
Implementations§
Source§impl ParquetStore
impl ParquetStore
Sourcepub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn open(root: impl AsRef<Path>) -> Result<Self>
Open a Parquet data store rooted at the given directory, creating it if needed.
Sourcepub fn insert_ticks(&self, ticks: &[Tick]) -> Result<usize>
pub fn insert_ticks(&self, ticks: &[Tick]) -> Result<usize>
Import ticks, deduplicating against existing data per date partition. Returns the number of rows actually inserted (after dedup).
Sourcepub fn insert_bars(&self, bars: &[Bar]) -> Result<usize>
pub fn insert_bars(&self, bars: &[Bar]) -> Result<usize>
Import bars, deduplicating against existing data per date partition. Returns the number of rows actually inserted (after dedup).
Sourcepub fn query_ticks(&self, opts: &QueryOpts) -> Result<(Vec<Tick>, u64)>
pub fn query_ticks(&self, opts: &QueryOpts) -> Result<(Vec<Tick>, u64)>
Query ticks for a given exchange+symbol, optionally filtered by date range. Returns (ticks, total_count_matching_filters).
Sourcepub fn query_bars(&self, opts: &BarQueryOpts) -> Result<(Vec<Bar>, u64)>
pub fn query_bars(&self, opts: &BarQueryOpts) -> Result<(Vec<Bar>, u64)>
Query bars for a given exchange+symbol+timeframe, optionally filtered by date range. Returns (bars, total_count_matching_filters).
Sourcepub fn delete_ticks(
&self,
exchange: &str,
symbol: &str,
from: Option<NaiveDateTime>,
to: Option<NaiveDateTime>,
) -> Result<usize>
pub fn delete_ticks( &self, exchange: &str, symbol: &str, from: Option<NaiveDateTime>, to: Option<NaiveDateTime>, ) -> Result<usize>
Delete ticks matching exchange+symbol, optionally within a date range.
Sourcepub fn delete_bars(
&self,
exchange: &str,
symbol: &str,
timeframe: &str,
from: Option<NaiveDateTime>,
to: Option<NaiveDateTime>,
) -> Result<usize>
pub fn delete_bars( &self, exchange: &str, symbol: &str, timeframe: &str, from: Option<NaiveDateTime>, to: Option<NaiveDateTime>, ) -> Result<usize>
Delete bars matching exchange+symbol+timeframe, optionally within a date range.
Sourcepub fn delete_symbol(
&self,
exchange: &str,
symbol: &str,
) -> Result<(usize, usize)>
pub fn delete_symbol( &self, exchange: &str, symbol: &str, ) -> Result<(usize, usize)>
Delete ALL data (ticks + bars) for an exchange+symbol pair.
Sourcepub fn delete_exchange(&self, exchange: &str) -> Result<(usize, usize)>
pub fn delete_exchange(&self, exchange: &str) -> Result<(usize, usize)>
Delete ALL data for an entire exchange.
Sourcepub fn stats(
&self,
exchange: Option<&str>,
symbol: Option<&str>,
) -> Result<Vec<StatRow>>
pub fn stats( &self, exchange: Option<&str>, symbol: Option<&str>, ) -> Result<Vec<StatRow>>
Summary statistics across all data, optionally filtered by exchange and/or symbol.
Sourcepub fn total_size(&self) -> Option<u64>
pub fn total_size(&self) -> Option<u64>
Total size of all Parquet files under the data root (bytes).
Auto Trait Implementations§
impl Freeze for ParquetStore
impl RefUnwindSafe for ParquetStore
impl Send for ParquetStore
impl Sync for ParquetStore
impl Unpin for ParquetStore
impl UnsafeUnpin for ParquetStore
impl UnwindSafe for ParquetStore
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
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>
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>
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