Skip to content

Commit

Permalink
Pass table in - it's actually called only_tables
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCurtis committed Feb 1, 2024
1 parent 34420ea commit 5438edd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/fk_graph/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def main():
setup_data(engine)
elif args.connection_string:
engine = create_engine(args.connection_string)
graph = get_graph(engine, args.table, args.primary_key)
graph = get_graph(
engine,
args.table,
args.primary_key,
only_tables=args.only_tables)
run_app(graph)

def _parse_args():
Expand All @@ -30,7 +34,7 @@ def _parse_args():
parser.add_argument("--connection-string")
parser.add_argument("--table", required=True)
parser.add_argument("--primary-key", required=True)
parser.add_argument("--include-only", type=_to_list)
parser.add_argument("--only-tables", type=_to_list)
args = parser.parse_args()
if (
(not args.demo and args.connection_string is None)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_can_pass_in_list_of_tables_to_include(self):
" --demo"
" --table=table_a"
" --primary-key=1"
" --include-only=\"['table_a']\""
" --only-tables='[\"table_a\"]'"
)
# PIPE just stops stdout from printing to screen.
process = Popen(shlex_split(command), stdout=PIPE)
Expand Down

0 comments on commit 5438edd

Please sign in to comment.