Skip to content

Commit

Permalink
Fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Florents-Tselai committed Jul 8, 2024
1 parent a9015dd commit 03845b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/test_tsellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ def setUp(self):
print(self.db_fp)
self.path_args = (self.db_fp,)

def test_duckdb_is_picked_up(self):
# https://github.com/Florents-Tselai/tsellm/issues/28
super().test_cli_execute_sql()


if __name__ == "__main__":
unittest.main()
3 changes: 2 additions & 1 deletion tsellm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,9 @@ def cli(*args):
if args.sqlite and args.duckdb:
raise ValueError("Only one of --sqlite and --duckdb can be specified.")

sniffer = DBSniffer(args.filename)
console = (
DuckDBConsole(args.filename) if args.duckdb else SQLiteConsole(args.filename)
DuckDBConsole(args.filename) if (args.duckdb or sniffer.is_duckdb) else SQLiteConsole(args.filename)
)

try:
Expand Down

0 comments on commit 03845b0

Please sign in to comment.