Skip to content

Commit

Permalink
Support run_to_csv for duckdb
Browse files Browse the repository at this point in the history
  • Loading branch information
rskew committed Feb 2, 2025
1 parent eff0415 commit c9f9906
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions logica.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,11 @@ def main(argv):
elif engine == 'duckdb':
import duckdb
cur = duckdb.sql(formatted_sql)
o = sqlite3_logica.ArtisticTable(cur.columns,
cur.fetchall()).encode()
formatter = (sqlite3_logica.ArtisticTable
if command == 'run'
else sqlite3_logica.Csv)
o = formatter(cur.columns,
cur.fetchall()).encode()
elif engine == 'psql':
connection_str = os.environ.get('LOGICA_PSQL_CONNECTION')
if connection_str:
Expand Down

0 comments on commit c9f9906

Please sign in to comment.