.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" 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" '' '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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SELECTALL_XML 1p" .TH SELECTALL_XML 1p "2011-10-14" "perl v5.12.4" "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\s0 \s-1NESTING\s0...\*(R" .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\s0 \s-1AVAILABLE\s0 \s-1TEMPLATES\s0 \s-1FOR\s0 A \s-1DB\s0" .IX Subsection "LISTING AVAILABLE TEMPLATES FOR A DB" .Vb 1 \& stag-selectall_xml \-d mydb \-h .Ve .SS "\s-1LISTING\s0 \s-1VARIABLES\s0 \s-1FOR\s0 A \s-1TEMPLATE\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