1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! Export types and options.
use PathBuf;
/// Export format options.
///
/// Choose a format based on the downstream consumer:
///
/// - [`ExportFormat::Csv`] for flattened spreadsheet-friendly output
/// - [`ExportFormat::Jsonl`] for line-delimited scripting pipelines
/// - [`ExportFormat::Parquet`] for typed analytics workloads
/// Options for exporting data.
///
/// `output: None` means "write to stdout". CLI callers achieve the same effect by
/// passing `--output -`, which is normalized before reaching this struct.
///
/// # Examples
///
/// Export a single run to JSONL on stdout:
///
/// ```no_run
/// use domain_status::export::{ExportFormat, ExportOptions};
/// use std::path::PathBuf;
///
/// let opts = ExportOptions {
/// db_path: PathBuf::from("./domain_status.db"),
/// output: None,
/// format: ExportFormat::Jsonl,
/// run_id: Some("run_1700000000000".to_string()),
/// domain: None,
/// status: None,
/// since: None,
/// include_implied_tech: false,
/// };
/// ```
///
/// Export recent `200` rows for one domain to a file:
///
/// ```no_run
/// use domain_status::export::{ExportFormat, ExportOptions};
/// use std::path::PathBuf;
///
/// let opts = ExportOptions {
/// db_path: PathBuf::from("./domain_status.db"),
/// output: Some(PathBuf::from("report.parquet")),
/// format: ExportFormat::Parquet,
/// run_id: None,
/// domain: Some("example.com".to_string()),
/// status: Some(200),
/// since: Some(1_700_000_000_000),
/// include_implied_tech: false,
/// };
/// ```