How harelba/q works
q is a command-line SQL interface for querying delimited text files and SQLite databases. The main workflow takes a user’s SQL query and file inputs, makes them queryable, executes SQL, and presents results. README documents automatic caching, joins across separate SQLite files, column/type detection, and encoding support. The runtime is concentrated in bin/q.py; sampled excerpts show parsing/inference, materialization, and output components, but omit the main execution path, so links beyond documented behavior are limited to README evidence.
Main entry points: q.py SQL query
Components 12
Command interface
- q command
bin/q.py
Query processing
- SQL query
bin/q.py - SQLite query engine
bin/q.py
Data sources
- Input inference
bin/q.py - Delimited reader
bin/q.py - Table materialization
bin/q.py
Results and cache
- Query cache
bin/q.py - Output formatting
bin/q.py
Other components
- CLI user
- Delimited text files
- SQLite files
- CLI output
Connections 10
- CLI user → q command: runs query
README.markdown - q command → SQL query: accepts SQL
README.markdown - SQL query → Delimited text files: queries as tables
README.markdown - SQL query → SQLite files: queries directly
README.markdown - SQL query → SQLite query engine: executes SQL
README.markdown - Input inference → Delimited reader: infers input
bin/q.py - Delimited reader → Table materialization: provides rows
bin/q.py - Table materialization → Query cache: caches data
README.markdown - SQLite query engine → Output formatting: produces results
bin/q.py - Output formatting → CLI output: prints results