#[derive(serde::Serialize)]
pub struct ExplainResponse {
pub ok: bool,
pub query: String,
pub plan: String,
}
#[derive(serde::Serialize)]
pub struct ScriptResponse {
pub ok: bool,
pub command: String,
pub path: String,
pub succeeded: usize,
pub failed: usize,
pub message: String,
}
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct VersionResponse {
pub ok: bool,
pub command: String,
pub version: String,
/// Edition of this binary: `"standard"` (lean remote Qdrant driver),
/// `"full"` (includes local ONNX FastEmbed models and in-process edge),
/// or `"custom"` (compiled with custom/partial feature flags).
pub edition: String,
/// Cargo features enabled in this binary (e.g. `["grpc", "rest"]`;
/// full builds add `"edge"` and `"fastembed"`).
pub features: Vec<String>,
pub message: String,
}
pub fn print_success(msg: &str) {
if color_stdout() {
println!("\x1b[32m\u{2713}\x1b[0m {}", msg);
} else {
println!("\u{2713} {}", msg);
}
}
pub fn print_error(msg: &str) {
if color_stderr() {
eprintln!("\x1b[31m\u{2717}\x1b[0m {}", msg);
} else {
eprintln!("\u{2717} {}", msg);
}
}
/// Whether ANSI color is appropriate on stdout: a terminal and no `NO_COLOR`.
pub(crate) fn color_stdout() -> bool {
use std::io::IsTerminal;
std::env::var_os("NO_COLOR").is_none() && std::io::stdout().is_terminal()
}
/// Whether ANSI color is appropriate on stderr: a terminal and no `NO_COLOR`.
pub(crate) fn color_stderr() -> bool {
use std::io::IsTerminal;
std::env::var_os("NO_COLOR").is_none() && std::io::stderr().is_terminal()
}
pub fn print_banner() {
println!(
"\n\x1b[36m\u{2554}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2557}\x1b[0m\n\x1b[36m\u{2551}\x1b[0m \x1b[1;36mQQL \u{2014} Qdrant Query Language\x1b[0m \x1b[36m\u{2551}\x1b[0m\n\x1b[36m\u{255a}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{2550}\u{255d}\x1b[0m\n",
);
}