pg_glimpse/lib.rs
1//! pg_glimpse - A TUI for monitoring PostgreSQL databases.
2
3pub mod app;
4pub mod cli;
5pub mod config;
6pub mod connection;
7pub mod db;
8pub mod event;
9pub mod history;
10pub mod recorder;
11pub mod replay;
12pub mod runtime;
13pub mod ssl;
14pub mod ui;
15
16use clap::Parser;
17use cli::Cli;
18use color_eyre::eyre::Result;
19
20/// Main entry point - parses CLI args and runs the application.
21///
22/// This is the primary entry point for the pg_glimpse application.
23/// It handles argument parsing, sets up the tokio runtime, and delegates
24/// to either live mode or replay mode based on the arguments.
25pub fn run_cli() -> Result<()> {
26 color_eyre::install()?;
27 let cli = Cli::parse();
28
29 let rt = tokio::runtime::Builder::new_multi_thread()
30 .enable_all()
31 .build()?;
32
33 rt.block_on(runtime::run(cli))
34}