From f16b7c34a54dd335ac6c3bd9fa7ceb59e3a9d09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20H=C3=BCbler?= Date: Fri, 4 Jul 2025 23:05:59 +0200 Subject: [PATCH 1/3] schemas arg now tolerates spaces between commas --- src/sqlacodegen/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sqlacodegen/cli.py b/src/sqlacodegen/cli.py index 07f7ea59..72b6b334 100644 --- a/src/sqlacodegen/cli.py +++ b/src/sqlacodegen/cli.py @@ -118,7 +118,7 @@ def main() -> None: engine = create_engine(args.url, **engine_args) metadata = MetaData() tables = args.tables.split(",") if args.tables else None - schemas = args.schemas.split(",") if args.schemas else [None] + schemas = [schema.strip() for schema in args.schemas.split(",")] if args.schemas else [None] options = set(args.options.split(",")) if args.options else set() # Instantiate the generator From a8853a68ab37b08372d6fed6df2cdfe1d7d7b7a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20H=C3=BCbler?= Date: Fri, 4 Jul 2025 23:07:14 +0200 Subject: [PATCH 2/3] also added strip to tables and opitons arg --- src/sqlacodegen/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sqlacodegen/cli.py b/src/sqlacodegen/cli.py index 72b6b334..3966fe4b 100644 --- a/src/sqlacodegen/cli.py +++ b/src/sqlacodegen/cli.py @@ -117,9 +117,9 @@ def main() -> None: engine_args = _parse_engine_args(args.engine_arg) engine = create_engine(args.url, **engine_args) metadata = MetaData() - tables = args.tables.split(",") if args.tables else None + tables = [tablename.strip() for tablename in args.tables.split(",")] if args.tables else None schemas = [schema.strip() for schema in args.schemas.split(",")] if args.schemas else [None] - options = set(args.options.split(",")) if args.options else set() + options = set([option.strip() for option in args.options.split(",")]) if args.options else set() # Instantiate the generator generator_class = generators[args.generator].load() From 2ded2f2e341a020b3763543f83b3720b487a7839 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 21:15:38 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/sqlacodegen/cli.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/sqlacodegen/cli.py b/src/sqlacodegen/cli.py index 3966fe4b..b4d84db3 100644 --- a/src/sqlacodegen/cli.py +++ b/src/sqlacodegen/cli.py @@ -117,9 +117,21 @@ def main() -> None: engine_args = _parse_engine_args(args.engine_arg) engine = create_engine(args.url, **engine_args) metadata = MetaData() - tables = [tablename.strip() for tablename in args.tables.split(",")] if args.tables else None - schemas = [schema.strip() for schema in args.schemas.split(",")] if args.schemas else [None] - options = set([option.strip() for option in args.options.split(",")]) if args.options else set() + tables = ( + [tablename.strip() for tablename in args.tables.split(",")] + if args.tables + else None + ) + schemas = ( + [schema.strip() for schema in args.schemas.split(",")] + if args.schemas + else [None] + ) + options = ( + set([option.strip() for option in args.options.split(",")]) + if args.options + else set() + ) # Instantiate the generator generator_class = generators[args.generator].load()