From 56f1ae7310273284d32f305c442009e074463f00 Mon Sep 17 00:00:00 2001 From: Martyn Russell Date: Sat, 4 Oct 2014 16:34:22 +0100 Subject: tracker: Merged utils/tracker-sql/tracker-sql into 'tracker sql ...' --- docs/manpages/Makefile.am | 1 + docs/manpages/tracker-sparql.1 | 1 + docs/manpages/tracker-sql.1 | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 docs/manpages/tracker-sql.1 (limited to 'docs/manpages') diff --git a/docs/manpages/Makefile.am b/docs/manpages/Makefile.am index e8006a63c..1651d7727 100644 --- a/docs/manpages/Makefile.am +++ b/docs/manpages/Makefile.am @@ -9,6 +9,7 @@ common = \ tracker-daemon.1 \ tracker-search.1 \ tracker-sparql.1 \ + tracker-sql.1 \ tracker-status.1 \ tracker-store.1 \ tracker-tag.1 \ diff --git a/docs/manpages/tracker-sparql.1 b/docs/manpages/tracker-sparql.1 index 2e5df8cde..f696e86f9 100644 --- a/docs/manpages/tracker-sparql.1 +++ b/docs/manpages/tracker-sparql.1 @@ -356,6 +356,7 @@ $ tracker sparql -q "SELECT ?image ?date WHERE { .fi .SH SEE ALSO +.BR tracker-sql (1), .BR tracker-store (1), .BR tracker-info (1). .TP diff --git a/docs/manpages/tracker-sql.1 b/docs/manpages/tracker-sql.1 new file mode 100644 index 000000000..9fda4d522 --- /dev/null +++ b/docs/manpages/tracker-sql.1 @@ -0,0 +1,48 @@ +.TH tracker-sql 1 "October 2014" GNU "User Commands" + +.SH NAME +tracker-sql \- Use SQL to query the Tracker databases. + +.SH SYNOPSIS +.nf +\fBtracker sql\fR \-q <\fIsql\fR> | \-f <\fIfile\fR> +.fi + +.SH DESCRIPTION +This command allows probing of the current database. When using +commands like \fBtracker sparql\fR, the SPARQL used is translated into +SQL before being run on the database. This allows direct use of the +database using SQL avoiding the SPARQL engine entirely. + +The caller can run a query two ways, either by providing a \fIfile\fR +with the query or by providing a string with the \fIsql\fR query. + +The \fIfile\fR argument can be either a local path or a URI. It also +does not have to be an absolute path. + +.SH OPTIONS +.TP +.B \-f, \-\-file\fR=<\fIfile\fR> +Use a \fIfile\fR with SPARQL content to query. Don't forget to end all +queries with a semicolon (;) and also to use quotes around table +names. The quotes are important because most tables are named after +ontology classes like "nfo:Document" and queries will fail without the +quotes. +.TP +.B \-q, \-\-query\fR=<\fIsql\fR> +Use a \fIsql\fR string to query the database with. + +.SH EXAMPLES +.TP +Show first 10 "nfo:Document" entries where the TOC is not NULL: +.BR +.nf +$ tracker sql -q 'SELECT * FROM "nfo:Document" WHERE "nfo:tableOfContents" NOT NULL LIMIT 10;' +.fi + +.SH SEE ALSO +.BR tracker-sparql (1), +.BR tracker-store (1), +.BR tracker-info (1). +.TP +.BR http://en.wikipedia.org/wiki/SQL -- cgit v1.2.1