Skip to content

Commit eadd324

Browse files
author
Søren Hansen
authored
feat: update logs (#33)
1 parent ed36874 commit eadd324

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

squeeel-cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "squeeel-cli"
33
description = "Make your raw SQL queries type-safe instantly"
4+
license = "Apache-2.0"
45
version = "0.1.2"
56
edition = "2024"
67

squeeel-cli/src/main.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn main() -> anyhow::Result<()> {
104104
fn gen_command(options: GenCommandOptions) -> anyhow::Result<()> {
105105
println!("Generating result and parameter types for sql queries\n");
106106
let root_dir = find_package_json_dir(&options.project_root)?;
107-
println!(" - Found package root located at {root_dir:?}");
107+
// println!(" - Found package root located at {root_dir:?}");
108108
let sql_libs = detect_sql_libs_in_package_json(&root_dir.join("package.json"))?;
109109
if sql_libs.is_empty() {
110110
return Err(anyhow::anyhow!(
@@ -121,13 +121,19 @@ fn gen_command(options: GenCommandOptions) -> anyhow::Result<()> {
121121
);
122122

123123
let queries = detect_queries(root_dir, sql_libs);
124-
let num_queries = queries.len();
125124
let queries_by_lib: HashMap<SupportedLib, Vec<String>> =
126125
queries.into_iter().fold(HashMap::new(), |mut acc, query| {
127126
acc.entry(query.lib).or_default().push(query.query);
128127
acc
129128
});
130-
println!(" - Found {num_queries} sql queries");
129+
println!(
130+
" - Found the following number of sql queries: {}",
131+
queries_by_lib
132+
.iter()
133+
.map(|(lib, q)| format!("{lib}: {}", q.len()))
134+
.collect::<Vec<_>>()
135+
.join(", ")
136+
);
131137

132138
tokio::runtime::Builder::new_multi_thread()
133139
.enable_all()
@@ -194,7 +200,7 @@ async fn init_databases<'a, Libs: IntoIterator<Item = &'a SupportedLib>>(
194200
supported_libs: Libs,
195201
config: &GenCommandOptions,
196202
) -> anyhow::Result<()> {
197-
println!(" - Connecting to databases");
203+
// println!(" - Connecting to databases");
198204
let _ = dotenvy::from_filename(root_dir.join(".env"));
199205
let postgres_database_url = config
200206
.postgres_database_url
@@ -291,7 +297,7 @@ async fn create_d_ts_files(
291297
dir: &Path,
292298
queries_by_lib: HashMap<SupportedLib, Vec<String>>,
293299
) -> anyhow::Result<()> {
294-
println!(" - Generating .d.ts files");
300+
// println!(" - Generating .d.ts files");
295301
let mut tasks = Vec::with_capacity(queries_by_lib.keys().len());
296302
for (lib, queries) in queries_by_lib {
297303
tasks.push(tokio::spawn({

0 commit comments

Comments
 (0)