#![cfg_attr(docsrs, feature(doc_cfg))]
mod descriptor;
pub use descriptor::DESCRIPTOR;
pub mod config;
#[cfg(feature = "encryption")]
mod decrypt;
pub mod http;
#[cfg(feature = "file-format-parquet")]
mod parquet;
pub mod plan;
mod stream;
pub use config::{
FileSourceConfig, FileSourceFormat, IncrementalBy, IncrementalSpec, ParquetReadOptions,
};
pub use stream::FileSource;
#[cfg(not(feature = "file-format-parquet"))]
pub(crate) fn parquet_missing() -> faucet_core::FaucetError {
faucet_core::FaucetError::Config(
"file source: Parquet files need the `file-format-parquet` build feature".into(),
)
}
pub async fn read_records(
path: impl Into<String>,
) -> Result<Vec<faucet_core::Value>, faucet_core::FaucetError> {
use faucet_core::Source;
FileSource::new(FileSourceConfig::new(path))?
.fetch_all()
.await
}