How cbaldelomar/extractsql works
ExtractSQL is a command-line SQL Server export utility. The user supplies connection details, a SQL script, and an output format; the CLI prepares the destination and delegates extraction, which executes the script and streams the first result set to a CSV/delimited-text or Excel writer. The README also documents batching, multi-step scripts, timestamped naming, and configurable delimiters. The graph reflects the sampled runtime calls; README-described behavior is included where its implementation was not fully shown.
Main entry points: extract.py Extraction orchestrator · main.py Argument handling · tocsv.py CSV and text writer · toexcel.py Excel writer
Components 11
Command line
- Argument handling
extractsql/main.py - Version metadata
extractsql/__version__.py
Extraction setup
- Connection and file helpers
extractsql/utils.py - Export defaults
extractsql/constants.py
Query execution
- Extraction orchestrator
extractsql/extract.py
Export formats
- CSV and text writer
extractsql/tocsv.py - Excel writer
extractsql/toexcel.py
Other components
- CLI user
- SQL script
- SQL Server
- Exported file
Connections 11
- CLI user → Argument handling: provides options
README.md - Argument handling → Version metadata: reads version
extractsql/main.py - Argument handling → Connection and file helpers: prepares output
extractsql/main.py - Argument handling → Extraction orchestrator: starts extraction
extractsql/main.py - SQL script → Extraction orchestrator: provides SQL
extractsql/extract.py - Extraction orchestrator → Connection and file helpers: reads and configures
extractsql/extract.py - Extraction orchestrator → SQL Server: connects and queries
extractsql/extract.py - Extraction orchestrator → CSV and text writer: dispatches flat files
extractsql/extract.py - Extraction orchestrator → Excel writer: dispatches xlsx
extractsql/extract.py - CSV and text writer → Exported file: writes batches
extractsql/tocsv.py - Excel writer → Exported file: writes sheets
extractsql/toexcel.py