Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql2csv: adds ability to pass arguments to create_engine #1252

Merged
merged 7 commits into from
Jul 12, 2024
Merged

sql2csv: adds ability to pass arguments to create_engine #1252

merged 7 commits into from
Jul 12, 2024

Conversation

sgpeter1
Copy link
Contributor

@sgpeter1 sgpeter1 commented Jul 9, 2024

Some of us with peculiar database setups need the ability to pass arguments to the underlying sqlalchemy create_engine function.

I chose to use space-separated key-value pairs, but many alternatives are possible. The syntax looks like this:

--engine-kwargs key1 value1 --engine-kwargs key2 value2

A full example looks like this:

sql2csv --db "oracle+oracledb://user:pass@hostname:port/dbname" --engine-kwargs thick_mode True --query "select trans_id, total_cost from transactions"

@coveralls
Copy link

coveralls commented Jul 9, 2024

Coverage Status

coverage: 90.281% (-0.1%) from 90.393%
when pulling 93d35b9 on sgpeter1:master
into 60fa3cf on wireservice:master.

@coveralls
Copy link

Coverage Status

coverage: 90.187% (-0.2%) from 90.393%
when pulling 278a74b on sgpeter1:master
into f73742f on wireservice:master.

@sgpeter1 sgpeter1 marked this pull request as draft July 9, 2024 22:08
Previous nargs parameter `*` would capture the FILE parameter, which then wouldn't allow use of a SQL file to query.
@sgpeter1 sgpeter1 marked this pull request as ready for review July 9, 2024 22:18
@jpmckinney jpmckinney merged commit 64eecfc into wireservice:master Jul 12, 2024
3 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants