Purpose
Package description from Cargo.toml: A simple tool to fetch data from MSSQL using ODBC and export to a Google Sheet.
Current state
Last touched: 2024-08-15. Functionality and completeness: Core extract-and-upload implemented; documentation and tests are pending.
Next step
Add baseline automated tests to cover critical flows; Add CI pipeline for build/test/lint; Document deployment/runtime environment (or add Dockerfile); Document interfaces (CLI flags, API endpoints, file formats); Add structured logging and basic health checks.
Interfaces
Inputs- TOML config, SQL Server via ODBC, Google Sheets API
- Configuration files (TOML)
- SQL query text
- Google Sheet ID/range
Outputs- CSV output file
- Google Sheet updated with query results
- Query results (reports/extracts)
Reality to Action trace
Reality IngestionNot in scope.
Canonical StorageContributes in this stage.
Automation EnginesNot in scope.
Human InterfacesContributes in this stage.
Operational AdoptionNot in scope.
Core workflow
TBD. Document the 5-10 steps that define the core workflow.
Artifacts
- CSV columns derive from SQL column names; sheet range must align with column count
Operational notes
Constraints and scars
- Requires correctly configured ODBC DSN and Google API credentials; large sheets may need batching improvements.
Reliability posture
Failure modes and safe behavior: ODBC or API errors abort without completing the upload. Idempotency / retries / batching behavior: Re-running overwrites the configured sheet range; no explicit retry/backoff.
Observability
- Logs: stdout/stderr prints for query and Sheets updates
- Metrics/health checks: None documented
- Logs: stdout/stderr prints for query execution and Sheets write status.
Security and privacy
Config contains database credentials and Google service-account key path; store securely and keep out of git. Sensitive secret material detected in mssql_query_to_google_sheet/priv_key.json; ensure it is excluded from docs and CI.
Dependencies
Upstream- Microsoft SQL Server
- Google Sheets API
Ownership
OwnersJosh Barton
UsersJosh Barton (owner)
mssql_query_to_google_sheet
Architecture & Major Components
High-level diagram (text):
- Entry/trigger -> core logic -> outputs (details per docs below)
Entry/trigger
→core logic
→outputs
Entry points: src/main.rs
Top-level folders: sql, src
src/ submodules: auth, config, http_client, sheets
Key abstractions: ODBC query runner, Sheets read/write helpers, config-driven output paths
Setup / Build / Run
- Build system(s): Cargo.
- Install UnixODBC and the Microsoft SQL Server ODBC driver.
- Provide a
config.toml with DSN, SQL, and sheet parameters; run the CLI to execute and upload.