.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SELECTALL_XML 1p" .TH SELECTALL_XML 1p "2016-05-29" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" stag-selectall_xml \- Query all elements from database with an XML output .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& stag-selectall_xml [\-d ] [\-f file of sql] [\-nesting|n ] SQL .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This script will query a database using either \s-1SQL\s0 provided by the script user, or using an \s-1SQL\s0 templates; the query results will be turned into \s-1XML\s0 using the DBIx::DBStag module. The nesting of the \&\s-1XML\s0 can be controlled by the DBStag \s-1SQL\s0 extension \*(L"\s-1USE NESTING...\*(R"\s0 .SS "\s-1EXAMPLES\s0" .IX Subsection "EXAMPLES" .Vb 2 \& stag-selectall_xml \-d "dbi:Pg:dbname=mydb;host=localhost"\e \& "SELECT * FROM a NATURAL JOIN b" .Ve .SS "\s-1TEMPLATES\s0" .IX Subsection "TEMPLATES" A parameterized \s-1SQL\s0 template (canned query) can be used instead of specifying the full \s-1SQL\s0 .PP For example: .PP .Vb 1 \& stag-selectall_xml \-d genedb /genedb\-gene gene_symbol=Adh .Ve .PP Or: .PP .Vb 1 \& stag-selectall_xml \-d genedb /genedb\-gene Adh .Ve .PP Or: .PP .Vb 1 \& stag-selectall_xml \-d genedb /genedb\-gene gene_symbol@=Adh,dpp,bam,indy .Ve .PP A template is indicated by the syntactic shorthand of using a slash to precede the template name; in this case the template is called \&\fBgenedb-gene\fR. the \-t option can also be used. .PP All the remaining arguments are passed in as \s-1SQL\s0 template parameters. They can be passed in as either name=value pairs, or as a simple list of arguments which get passed into the template in order .PP To use templates, you should have the environment variable \&\fB\s-1DBSTAG_TEMPLATE_DIRS\s0\fR set. See \fBDBIx::DBStag\fR for details. .SS "\s-1LISTING AVAILABLE TEMPLATES FOR A DB\s0" .IX Subsection "LISTING AVAILABLE TEMPLATES FOR A DB" .Vb 1 \& stag-selectall_xml \-d mydb \-h .Ve .SS "\s-1LISTING VARIABLES FOR A TEMPLATE\s0" .IX Subsection "LISTING VARIABLES FOR A TEMPLATE" .Vb 1 \& stag-selectall_xml /genedb\-gene \-h .Ve .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" .IP "\s-1DBSTAG_DBIMAP_FILE\s0" 4 .IX Item "DBSTAG_DBIMAP_FILE" A file containing configuration details for local databases .IP "\s-1DBSTAG_TEMPLATE_DIRS\s0" 4 .IX Item "DBSTAG_TEMPLATE_DIRS" list of directories (separated by \fB:\fRs) to be searched when templates are requested .SH "COMMAND LINE ARGUMENTS" .IX Header "COMMAND LINE ARGUMENTS" .IP "\-h|help" 4 .IX Item "-h|help" shows this page if no other arguments are given .Sp if a template is specified, gives template details .Sp if a db is specified, lists templates for that db .Sp use in conjunction with \-v for full descriptions .IP "\-d|dbname \s-1DBNAME\s0" 4 .IX Item "-d|dbname DBNAME" this is either a full \s-1DBI\s0 locator string (eg \&\fBdbi:Pg:dbname=mydb;host=localhost\fR) or it can also be a shortened \&\*(L"nickname\*(R", which is then looked up in the file pointed at by the environment variable \fB\s-1DBSTAG_DBIMAP_FILE\s0\fR .IP "\-u|user \s-1USER\s0" 4 .IX Item "-u|user USER" database user identity .IP "\-p|password \s-1PASS\s0" 4 .IX Item "-p|password PASS" database password .IP "\-f|file \s-1SQLFILE\s0" 4 .IX Item "-f|file SQLFILE" this is a path to a file containing \s-1SQL\s0 that will be executed, as an alternative to writing the \s-1SQL\s0 on the command line .IP "\-n|nesting NESTING-EXPRESSIONS" 4 .IX Item "-n|nesting NESTING-EXPRESSIONS" a bracketed expression indicating how to the resulting objects/XML should be nested. See DBIx::DBStag for details. .IP "\-t|template TEMPLATE-NAME" 4 .IX Item "-t|template TEMPLATE-NAME" the name of a template; see above .IP "\-wh|where WHERE-CLAUSE" 4 .IX Item "-wh|where WHERE-CLAUSE" used to override the \s-1WHERE\s0 clause of the query; useful for combining with templates .Sp You can append to an existing where clause by using the prefix \fB+\fR .IP "\-s|select SELECT-COLS" 4 .IX Item "-s|select SELECT-COLS" used to override the \s-1SELECT\s0 clause of the query; useful for combining with templates .IP "\-rows" 4 .IX Item "-rows" sometimes it is preferable to return the results as a table rather than xml or a similar nested structure. specifying \-rows will fetch a table, one line per row, and columns separated by tabs .IP "\-pre \s-1SQL\s0" 4 .IX Item "-pre SQL" a piece of \s-1SQL\s0 is that is executed immediately before the main query; e.g.: .Sp .Vb 1 \& \-pre "SET search_path=myschema,public" .Ve .IP "\-o|out \s-1FILE\s0" 4 .IX Item "-o|out FILE" a file to output the results to .IP "\-w|writer \s-1WRITER\s0" 4 .IX Item "-w|writer WRITER" writer class; can be any perl class, or one of these .RS 4 .IP "xml [default]" 4 .IX Item "xml [default]" .PD 0 .IP "sxpr" 4 .IX Item "sxpr" .PD lisp S\-Expressions .IP "itext" 4 .IX Item "itext" indented text .RE .RS 4 .RE .IP "\-color" 4 .IX Item "-color" shows results in color (sxpr and itext only) .IP "\-show" 4 .IX Item "-show" will show the parse of the \s-1SQL\s0 statement