'\" t .\" Title: tracker3-sql .\" Author: The Tracker developers .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 03/07/2024 .\" Manual: Tracker manual .\" Source: \ \& 3.7.rc .\" Language: English .\" .TH "TRACKER3\-SQL" "1" "03/07/2024" "\ \& 3\&.7\&.rc" "Tracker manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tracker3-sql \- Use SQL to query the Tracker databases\&. .SH "SYNOPSIS" .sp .nf tracker3 sql \-q | \-f .fi .SH "DESCRIPTION" .sp This command allows probing of the current database\&. When using commands like \fBtracker3 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\&. .sp 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\&. .sp 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" .PP \fB\-f, \-\-file=<\fR\fB\fIfile\fR\fR\fB>\fR .RS 4 Use a \fIfile\fR with SPARQL content to query\&. Don\(cqt 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\&. .RE .PP \fB\-q, \-\-query=<\fR\fB\fIsql\fR\fR\fB>\fR .RS 4 Use a \fIsql\fR string to query the database with\&. .RE .SH "EXAMPLES" .PP Show first 10 "nfo:Document" entries where the TOC is not NULL .RS 4 .sp .if n \{\ .RS 4 .\} .nf $ tracker3 sql \-q \*(AqSELECT * FROM "nfo:Document" WHERE "nfo:tableOfContents" NOT NULL LIMIT 10;\*(Aq .fi .if n \{\ .RE .\} .RE .SH "SEE ALSO" .sp \fBtracker3\-sparql\fR(1), \fBtracker3\-info\fR(1)\&. .sp \fBhttp://en\&.wikipedia\&.org/wiki/SQL\fR