shrum.net :: Code :: Query

|
Query
|
| A small utility for displaying or writing
to a file the results from SQL statement queries from SQLite database
files. Supports command line calls for batch processing as well. |
| |
Query is a small utility for executing and displaying the results from
SQLite databases. SQL
statements can be typed in or passed in a text file. Query passes the supplied SQL statement to the SQLite engine and displays the
results or saves the results to the specified output file. If a output
file is not supplied, the results are displayed on-screen.
It's Windows-based, open source (GNU),
and solely written, maintained, hosted, and supported by me, Sean Shrum. Source code is written with
AutoIT (.au3) and the
most recent version can be found via the source link in the navbar above. If you're just looking for the latest binary build, it can be downloaded from
the binary link in the navbar above. Click
here
to get my list of AutoIT tools.
I wrote this program to allow me to extract play lists from the my
player music manager that uses SQLite as a backend.
However, this can be used to quickly see the results of a query on screen as
well.
This app can be called directly or with command line parameters. Direct
calls will prompt you for database, a SQL statement or SQL containing text file,
and prompt for screen or file output. Command line parameters supported: [d]atabase, [s]ql statement / file, [h]eader,
and [o]utput. If any of the parameters are omitted, a prompt will be
displayed for the missing input.
query d=m:\sean.dat s=m:\playlists\enigma.sql o=m:\sean.m3u h=n
query d=m:\sean.dat s="Select * from metadata where
UserEffectiveRating=99" o="m:\5 stars.m3u" h=n
Note that SQL statements that are passed on the command line (including calls
to filenames with spaces in them), need to be wrapped in dbl-quotes.