= SQL Finder
SQL Finder is an executable gem that finds designated SQL statements in log/trace files.
== Use Case
Developers often have to comb through enormous log or trace files for SQL statements.
SQL Finder makes this process much easier by automatically doing a case-insensitive
search for SQL statements.
== Running the program
Run the executable from a directory of your choice using the findsql command together
with a path to the log/trace file under consideration:
findsql logs/ep_trace.txt
By default, SQL Finder searches for all lines with SELECT,INSERT, UPDATE, or DELETE
keywords in them, capturing the SQL statements and writing them to STDOUT along with the line number.
Command line options make it possible to limit the search to a subset of keywords,
to search for statements involving a particular table, or both.
== Command Line Options
<tt>-h</tt>:: Help screen.
<tt>-o <file name></tt>:: Tells SQL finder to write the captured statements to the indicated file instead of SDTOUT
<tt>-t <table name></tt>:: Tells SQL Finder to capture SQL statements only if they contain the indicated table name
<tt>-k <list of keywords></tt>:: Given a comma-separated set of SQL keywords (for example: insert,update), SQL Finder will capture statements only if they contain one of the indicated keywords
Here are some sample commands:
findsql -o trace.out ep_trace.txt
* Writes the results to trace.out instead of STDOUT
findsql -t arcconfiguration ep_trace.txt
* Restricts the search to SELECT, INSERT, UPDATE, and DELETE statements for the ArcConfiguration table
findsql -k select,insert ep_trace.txt
* Restricts the search to SELECT and INSERT statements.
findsql -k select,insert -t arcconfiguration -o trace.out ep_trace.txt
* Writes all SELECT and INSERT statements for the ArcConfiguration table to trace.out instead of STDOUT
SQL Finder is an executable gem that finds designated SQL statements in log/trace files.
== Use Case
Developers often have to comb through enormous log or trace files for SQL statements.
SQL Finder makes this process much easier by automatically doing a case-insensitive
search for SQL statements.
== Running the program
Run the executable from a directory of your choice using the findsql command together
with a path to the log/trace file under consideration:
findsql logs/ep_trace.txt
By default, SQL Finder searches for all lines with SELECT,INSERT, UPDATE, or DELETE
keywords in them, capturing the SQL statements and writing them to STDOUT along with the line number.
Command line options make it possible to limit the search to a subset of keywords,
to search for statements involving a particular table, or both.
== Command Line Options
<tt>-h</tt>:: Help screen.
<tt>-o <file name></tt>:: Tells SQL finder to write the captured statements to the indicated file instead of SDTOUT
<tt>-t <table name></tt>:: Tells SQL Finder to capture SQL statements only if they contain the indicated table name
<tt>-k <list of keywords></tt>:: Given a comma-separated set of SQL keywords (for example: insert,update), SQL Finder will capture statements only if they contain one of the indicated keywords
Here are some sample commands:
findsql -o trace.out ep_trace.txt
* Writes the results to trace.out instead of STDOUT
findsql -t arcconfiguration ep_trace.txt
* Restricts the search to SELECT, INSERT, UPDATE, and DELETE statements for the ArcConfiguration table
findsql -k select,insert ep_trace.txt
* Restricts the search to SELECT and INSERT statements.
findsql -k select,insert -t arcconfiguration -o trace.out ep_trace.txt
* Writes all SELECT and INSERT statements for the ArcConfiguration table to trace.out instead of STDOUT