.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