Crates.io | odbcsv |
lib.rs | odbcsv |
version | 1.0.12 |
source | src |
created_at | 2020-08-15 12:52:07.076422 |
updated_at | 2024-11-19 18:16:50.221455 |
description | Query an ODBC data source and print the result as csv. |
homepage | |
repository | https://github.com/pacman82/odbcsv/tree/main |
max_upload_size | |
id | 276970 |
size | 2,340,835 |
Query an ODBC data source and output the result as CSV or to insert from CSV into an ODBC data source.
Several installation options are available.
You can download the latest binaries here from the GitHub release: https://github.com/pacman82/odbcsv/releases/latest.
cargo install odbcsv
odbcsv query \
--output query.csv \
--connection-string "Driver={ODBC Driver 18 for SQL Server};Server=localhost;UID=SA;PWD=My@Test@Password1;" \
"SELECT title, year from Movies"
odbcsv query \
--output query.csv \
--connection-string "Driver={ODBC Driver 18 for SQL Server};Server=localhost;" \
--user "SA" \
--password "My@Test@Password1" \
"SELECT title, year from Movies"
Alternatively you may also specify the ODBC_USER
and ODBC_PASSWORD
environment variable.
odbcsv query \
--output query.csv \
--dsn my_db \
--password "My@Test@Password1" \
--user "SA" \
"SELECT * FROM Birthdays"
odbcsv query \
--output query.csv \
--connection-string "Driver={ODBC Driver 18 for SQL Server};Server=localhost;UID=SA;PWD=My@Test@Password1;" \
"SELECT * FROM Birthdays WHERE year > ? and year < ?" \
1990 2010
odbcsv insert \
--input birthdays.csv \
--connection-string "Driver={ODBC Driver 18 for SQL Server};Server=localhost;UID=SA;PWD=My@Test@Password1;" \
Birthdays \
Use --help
to see all options.