Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub bird_root: PathBuf,
    pub client_id: String,
    pub hot_days: u32,
    pub inline_threshold: usize,
    pub auto_extract: bool,
    pub storage_mode: StorageMode,
    pub remotes: Vec<RemoteConfig>,
    pub sync: SyncConfig,
    pub hooks: HooksConfig,
}
Expand description

BIRD configuration.

Fields§

§bird_root: PathBuf

Root directory for all BIRD data.

§client_id: String

Client identifier for this machine.

§hot_days: u32

Days to keep data in hot tier before archiving.

§inline_threshold: usize

Threshold in bytes for inline vs blob storage.

§auto_extract: bool

Automatically extract events after shq run commands.

§storage_mode: StorageMode

Storage mode for writing data.

  • parquet: Multi-writer safe, requires compaction (default)
  • duckdb: Single-writer, no compaction needed
§remotes: Vec<RemoteConfig>

Remote storage configurations.

§sync: SyncConfig

Sync configuration for push/pull operations.

§hooks: HooksConfig

Shell hook configuration.

Implementations§

Source§

impl Config

Source

pub fn with_root(bird_root: impl Into<PathBuf>) -> Self

Create a new config with the given BIRD_ROOT.

Source

pub fn with_duckdb_mode(bird_root: impl Into<PathBuf>) -> Self

Create a new config with DuckDB storage mode.

Source

pub fn default_location() -> Result<Self>

Create a config using default BIRD_ROOT resolution.

Source

pub fn load() -> Result<Self>

Load config from BIRD_ROOT/config.toml, or create default.

Source

pub fn load_from(bird_root: &Path) -> Result<Self>

Load config from a specific BIRD_ROOT.

Source

pub fn save(&self) -> Result<()>

Save config to BIRD_ROOT/config.toml.

Source

pub fn db_path(&self) -> PathBuf

Path to the DuckDB database file.

Source

pub fn data_dir(&self) -> PathBuf

Path to the data directory.

Source

pub fn recent_dir(&self) -> PathBuf

Path to the recent (hot) data directory.

Source

pub fn archive_dir(&self) -> PathBuf

Path to the archive (cold) data directory.

Source

pub fn invocations_dir(&self, date: &NaiveDate) -> PathBuf

Path to invocations parquet files for a given date.

Source

pub fn outputs_dir(&self, date: &NaiveDate) -> PathBuf

Path to outputs parquet files for a given date.

Source

pub fn sessions_dir(&self, date: &NaiveDate) -> PathBuf

Path to sessions parquet files for a given date.

Source

pub fn sql_dir(&self) -> PathBuf

Path to the SQL files directory.

Source

pub fn extensions_dir(&self) -> PathBuf

Path to the DuckDB extensions directory.

Source

pub fn blobs_dir(&self) -> PathBuf

Path to the blobs content directory.

Source

pub fn blob_path(&self, hash: &str, cmd_hint: &str) -> PathBuf

Path to a specific blob file by hash and command.

Source

pub fn event_formats_path(&self) -> PathBuf

Path to the event-formats.toml config file (legacy).

Source

pub fn format_hints_path(&self) -> PathBuf

Path to the format-hints.toml config file.

Source

pub fn events_dir(&self, date: &NaiveDate) -> PathBuf

Path to events parquet files for a given date.

Source

pub fn get_remote(&self, name: &str) -> Option<&RemoteConfig>

Get a remote by name.

Source

pub fn add_remote(&mut self, remote: RemoteConfig)

Add a remote configuration.

Source

pub fn remove_remote(&mut self, name: &str) -> bool

Remove a remote by name. Returns true if removed.

Source

pub fn blob_roots(&self) -> Vec<String>

Get all blob roots for multi-location resolution. Returns local blobs dir first, then remote blob URLs.

Source

pub fn auto_attach_remotes(&self) -> Vec<&RemoteConfig>

Get remotes that should be auto-attached.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,