{"id":24746604,"url":"https://github.com/samuelmarks/odbc-cli","last_synced_at":"2026-04-20T05:05:24.338Z","repository":{"id":250764034,"uuid":"835399521","full_name":"SamuelMarks/odbc-cli","owner":"SamuelMarks","description":"CLI for basic CRUD across many databases using ODBC","archived":false,"fork":false,"pushed_at":"2024-10-07T05:06:08.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-28T04:32:00.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamuelMarks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-29T18:54:07.000Z","updated_at":"2024-10-07T05:06:11.000Z","dependencies_parsed_at":"2025-01-28T04:29:41.136Z","dependency_job_id":"a2f1e5b2-d47a-4187-9dcd-2fa1e909585e","html_url":"https://github.com/SamuelMarks/odbc-cli","commit_stats":null,"previous_names":["samuelmarks/odbc-cli"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fodbc-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fodbc-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fodbc-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelMarks%2Fodbc-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamuelMarks","download_url":"https://codeload.github.com/SamuelMarks/odbc-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245042141,"owners_count":20551525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-28T04:29:33.180Z","updated_at":"2026-04-20T05:05:24.295Z","avatar_url":"https://github.com/SamuelMarks.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"odbc-cli\n========\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech)\n[![License](https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Build and release](https://github.com/SamuelMarks/odbc-cli/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/SamuelMarks/odbc-cli/actions/workflows/build-and-release.yml)\n\nDatabase abstracted CLI—using Open Database Connectivity (ODBC)—intended for basic and batch Create Read Update Delete (CRUD) operations, and negotiating database connection using a secret manager.\n\nNOTE: You may need to install `unixodbc` on macOS, Linux (though the provided `musl` binary has it statically linked), and others; and on Windows you may need to install the ODBC driver for your database. For example, PostgreSQL: https://www.postgresql.org/ftp/odbc/releases/\n\n## Usage\n\n### Example\n\nStart an ODBC compatible database. For example, to start PostgreSQL with `docker`:\n\n    docker run -p 5432:5432 -e POSTGRES_USER=rest_user -e POSTGRES_PASSWORD=rest_pass -e POSTGRES_DB=rest_db postgres:alpine\n\n(will start and initialise a new PostgreSQL instance accessible via connection string `postgresql://rest_user:rest_pass@127.0.0.1:5432/rest_db`)\n\nNow you can execute `odbc-cli` (or `cargo run -- --conn […]`):\n\n    odbc-cli \\\n      --conn \"Driver={PostgreSQL UNICODE};Server=localhost;Port=5432;Database=rest_db;Uid=rest_user;Password=rest_pass;\" \\\n      -c \"SELECT atan(1)*4 AS pi\"\n\n### Vault / OpenBao\n\nTo avoid explicitly providing credential information, you can use Vault / OpenBao.\n\nFirst, start or point to your secret store: [OpenBao](https://openbao.org) || [Hashicorp Vault](https://www.vaultproject.io) || [AWS Secret Engine](https://developer.hashicorp.com/vault/api-docs/secret/aws).\n\nFor example, for **testing only**, after [installing `bao` (guide)](https://openbao.org/docs/install):\n\n    VAULT_TOKEN='dev-only-token'\n    bao server -dev -dev-root-token-id=\"$VAULT_TOKEN\"\n\n(`docker run openbao/openbao` will do similar if you prefer Docker)\n\nThen you can populate the secret store like so:\n\n    odbc-cli \\\n      --conn \"Driver={PostgreSQL UNICODE};Server=localhost;Port=5432;Database=rest_db;Uid=rest_user;Password=rest_pass;\" \\\n      --store-secret \\\n      -c \"SELECT version();\"\n\n(there's also a full Docker Compose example in the root of this repo)\n\n#### Secret store environment variables\n\n  - `VAULT_ADDR`\n  - `VAULT_CACERT`\n  - `VAULT_CAPATH`\n  - `VAULT_CLIENT_CERT`\n  - `VAULT_CLIENT_KEY`\n  - `VAULT_SKIP_VERIFY`\n  - `VAULT_TOKEN`\n\n### `--help`\n\n    CLI for basic CRUD across many databases using ODBC\n    \n    Usage: odbc-cli [OPTIONS]\n    \n    Options:\n      -d, --data-source-name \u003cDATA_SOURCE_NAME\u003e\n              DataSourceName\n          --hostname \u003cHOSTNAME\u003e\n              Hostname to connect with\n          --port \u003cPORT\u003e\n              Port to connect with\n          --database \u003cDATABASE\u003e\n              Database name to connect to\n      -u, --username \u003cUSERNAME\u003e\n              Username to connect as\n      -P, --password \u003cPASSWORD\u003e\n              Password to connect with\n          --conn \u003cCONNECTION_STRING\u003e\n              Connect string to connect with. Takes precedence over `data_source_name`, `username`, `password`\n      -c, --command \u003cCOMMAND\u003e\n              Query to execute\n      -f, --command-file \u003cCOMMAND_FILE\u003e\n              Alternative query to execute from file or stdin\n      -p, --params \u003cPARAMS\u003e\n              Parameters to provide sanitarily to SQL query `--command`\n          --secret-store-engine \u003cSECRET_STORE_ENGINE\u003e\n              Secret storage service engine name [default: vault] [possible values: infisical, vault]\n      -a, --address \u003cADDRESS\u003e\n              Secret storage service address [env: VAULT_ADDR=]\n          --ca-cert \u003cCA_CERT\u003e\n              Secret storage Certificate Authority (CA) certificate [env: VAULT_CACERT=]\n          --ca-path \u003cCA_PATH\u003e\n              Secret storage CA path [env: VAULT_CAPATH=]\n          --client-cert \u003cCLIENT_CERT\u003e\n              Secret storage client certificate [env: VAULT_CLIENT_CERT=]\n          --client-key \u003cCLIENT_KEY\u003e\n              Secret storage client key [env: VAULT_CLIENT_KEY=]\n          --skip-verify \u003cSKIP_VERIFY\u003e\n              Whether to skip verification on secret storage [env: VAULT_SKIP_VERIFY=] [possible values: true, false]\n          --token \u003cTOKEN\u003e\n              Secret storage service vault token [env: VAULT_TOKEN=]\n          --store-secret\n              Whether to store the provided `connection_string` in the secret store\n          --secret-mount \u003cSECRET_MOUNT\u003e\n              mount of secret within secret storage engine\n          --secret-path \u003cSECRET_PATH\u003e\n              path of secret within secret storage engine\n          --output-format \u003cOUTPUT_FORMAT\u003e\n              Output format for SQL query result [default: csv] [possible values: csv, json, parquet]\n          --print-connection-str-and-exit\n              Whether to just print the connection string and then exit\n      -v, --verbose...\n              Increase logging verbosity\n      -q, --quiet...\n              Decrease logging verbosity\n      -h, --help\n              Print help\n      -V, --version\n              Print version\n\n---\n\n\u003csmall\u003e\n\n## Development guide\n\n### Install Rust\n\nFollow the [official alt-guide](https://forge.rust-lang.org/infra/other-installation-methods.html#other-ways-to-install-rustup) or alternatively run one of the following:\n\n#### Non-Windows\n```sh\n$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh sh -s -- --default-toolchain nightly\n```\n\n#### Windows\n```cmd\n\u003e curl --proto '=https' --tlsv1.2 -sSfO https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe\n\u003e rustup-init --default-toolchain nightly\n```\n\n### Build and run project\n```sh\n$ cargo run\n```\n\n### Docker\n```sh\n$ docker build . -t odbc-cli:latest\n```\n\n#### Docker Compose\n```sh\n$ docker compose up\n```\n\nThen if you want to be fancy and get the executable out so it can be added to the releases:\n```sh\n$ docker save odbc-cli:latest -o odbc-cli.tar\n# Find and extract the binary, for example:\n$ odbc-cli.tar\\blobs\\sha256\\7e3cb62b89edc58a47effa0f9a4e1fa792d3013911ab29f6bcbd6b60a64b5ffb\\usr\\local\\bin\\odbc-cli\n$ mv odbc-cli odbc-cli-x86_64-unknown-linux-musl\n# Upload this manually to the release or run\n$ gh release upload \"tag-name\" \"odbc-cli-x86_64-unknown-linux-musl\"\n```\n\n## Contribution guide\nEnsure all tests are passing [`cargo test`](https://doc.rust-lang.org/cargo/commands/cargo-test.html) and [`rustfmt`](https://github.com/rust-lang/rustfmt) has been run. This can be with [`cargo make`](https://github.com/sagiegurari/cargo-make); installable with:\n\n```sh\n$ cargo install --force cargo-make\n```\n\nThen run:\n```sh\n$ cargo make\n```\n\nFinally, we recommend [feature-branches](https://martinfowler.com/bliki/FeatureBranch.html) with an accompanying [pull-request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).\n\u003c/small\u003e\n\n\u003chr/\u003e\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmarks%2Fodbc-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelmarks%2Fodbc-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmarks%2Fodbc-cli/lists"}