From b8507174a0a95a294cd50f4c5af800269f87a18c Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 16 Jan 2026 20:28:58 +0700 Subject: [PATCH 1/2] Add scheme option --- .gitignore | 2 ++ src/main.rs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 73bd6e3..4c6f604 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ Cargo.lock migrations out + +.idea/ \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 7a8aa53..e5c0948 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,6 +27,10 @@ struct Cli { #[arg(long, value_name = "SQLGEN_INCLUDE_TABLES", value_delimiter = ',')] include_tables: Option>, + /// PostgreSQL schemas to include (defaults to "public"). + #[arg(long, value_name = "SQLGEN_SCHEMAS", value_delimiter = ',')] + schemas: Option>, + /// Enum derives to add (can be used multiple times). #[arg( long = "enum-derive", @@ -109,9 +113,11 @@ async fn generate_rust_from_database(args: &Cli) -> DbSetsFsWriter { .await .unwrap(); + let schemas = args.schemas.clone().unwrap_or_else(|| vec![String::from("public")]); + let tables = postgres::queries::get_tables::get_tables( &pool, - &[String::from("public")], + &schemas, &args.include_tables, ) .await From 2372b3c4c46147fe220ea06849d83e8fc929786f Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 16 Jan 2026 20:29:48 +0700 Subject: [PATCH 2/2] fix eof --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4c6f604..4e2963e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,4 @@ Cargo.lock migrations out -.idea/ \ No newline at end of file +.idea/