Difference between revisions of "SQL Executer Plugin"
Atlioddsson (talk | contribs) |
Atlioddsson (talk | contribs) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | (NB: | + | (NB: This plugin is mostly intended for developers and very technically inclined people) |
The SQL Executer is a sample plugin that allows anyone to run SQL queries against TimeSnapper database. | The SQL Executer is a sample plugin that allows anyone to run SQL queries against TimeSnapper database. | ||
Line 5: | Line 5: | ||
[[Image:sql-executer-plugin.png]] | [[Image:sql-executer-plugin.png]] | ||
+ | == How to use == | ||
+ | To use, type in a command in the "SQL Query" part of the screen, select the text and select Tools > Execute SQL (or Ctrl-E) | ||
+ | The results will be shown in the Results part of the window and can be copied (using Ctrl-C) to e.g. Microsoft Excel for further processing. | ||
− | + | Try these: | |
− | For a definition of TimeSnapper's database model - see [[Database Model]] | + | Count the number of screenshots that have been taken since TimeSnapper was first installed: |
+ | select count(*) from activity | ||
+ | |||
+ | Count the number of screenshots that still exist: | ||
+ | select count(*) from activity where filename is not null | ||
+ | |||
+ | |||
+ | For a definition of TimeSnapper's database model - see [[Database Model]] which shows which tables and columns exist. | ||
== Sample Queries == | == Sample Queries == | ||
Line 19: | Line 29: | ||
order by 1 | order by 1 | ||
− | + | If you develop some interesting queries, be sure to send us a copy and we'll include them here for others to enjoy! | |
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Plugins]] | [[Category:Plugins]] |
Latest revision as of 01:46, 24 February 2016
(NB: This plugin is mostly intended for developers and very technically inclined people)
The SQL Executer is a sample plugin that allows anyone to run SQL queries against TimeSnapper database.
How to use
To use, type in a command in the "SQL Query" part of the screen, select the text and select Tools > Execute SQL (or Ctrl-E) The results will be shown in the Results part of the window and can be copied (using Ctrl-C) to e.g. Microsoft Excel for further processing.
Try these:
Count the number of screenshots that have been taken since TimeSnapper was first installed:
select count(*) from activity
Count the number of screenshots that still exist:
select count(*) from activity where filename is not null
For a definition of TimeSnapper's database model - see Database Model which shows which tables and columns exist.
Sample Queries
List available TimeSnapper tables:
select rdb$relation_name from rdb$relations where rdb$view_blr is null and (rdb$system_flag is null or rdb$system_flag = 0) order by 1
If you develop some interesting queries, be sure to send us a copy and we'll include them here for others to enjoy!