mod summary;
use super::notices;
use crate::database::introspection::Schema;
use crate::generators::layout::Layout;
use crate::generators::report::Outcome;
use crate::generators::typescript::writer::Report;
pub(super) fn written(schema: &Schema, report: &Report) {
summary::schema(schema);
summary::list(&report.outcomes);
if report.outcomes.iter().any(Outcome::is_preserved) {
notices::preserved();
}
notices::unwired(&report.unwired);
notices::next_steps();
}
pub(super) fn models(label: &str, layout: &Layout) {
println!("\n{label}:");
summary::list(&layout.outcomes);
notices::undeclared(&layout.undeclared);
}
pub(super) fn artifacts(label: &str, outcomes: &[Outcome]) {
println!("\n{label}:");
summary::list(outcomes);
}
pub(super) fn empty(schema_name: &str) {
println!(
"No tables found in schema '{schema_name}'. Nothing was written.\n\n\
If your tables live elsewhere, pass --schema <name>."
);
}
pub(super) fn fail(message: &str) {
eprintln!("Pull failed: {message}");
std::process::exit(1);
}