Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ Cargo.lock

migrations
out

.idea/
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ struct Cli {
#[arg(long, value_name = "SQLGEN_INCLUDE_TABLES", value_delimiter = ',')]
include_tables: Option<Vec<String>>,

/// PostgreSQL schemas to include (defaults to "public").
#[arg(long, value_name = "SQLGEN_SCHEMAS", value_delimiter = ',')]
schemas: Option<Vec<String>>,

/// Enum derives to add (can be used multiple times).
#[arg(
long = "enum-derive",
Expand Down Expand Up @@ -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
Expand Down
Loading