1#[cfg(feature = "duckdb")]
4pub mod duckdb;
5#[cfg(feature = "polars")]
6pub mod polars;
7
8use crate::error::TesseraError;
9use crate::models::{IntoCoins, IntoMonths, PartitionRef};
10#[cfg(any(feature = "polars", feature = "duckdb"))]
11pub type ResolvedPartition = (PartitionRef, String);
13
14pub fn expand_refs(
23 asset: &str,
24 coin: impl IntoCoins,
25 month: impl IntoMonths,
26) -> Result<Vec<PartitionRef>, TesseraError> {
27 let coins = coin.into_coins()?;
28 let months = month.into_months()?;
29 let mut refs = Vec::with_capacity(coins.len() * months.len());
30 for coin in &coins {
31 for month in &months {
32 refs.push(PartitionRef::new(asset, coin, month)?);
33 }
34 }
35 Ok(refs)
36}