.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .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. | will give a .\" real vertical bar. \*(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-|\(bv\*(Tr .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\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" 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 "DBIMON 1" .TH DBIMON 1 "2002-10-01" "perl v5.8.0" "User Contributed Perl Documentation" .SH "NAME" dbimon \- interactive shell with readline for DBI .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\f(CW\*(C`dbimon [ []]\*(C'\fR [] .SH "DESCRIPTION" .IX Header "DESCRIPTION" dbimon lets you talk to a running \s-1SQL\s0 server via the database independent Perl interface \s-1DBI\s0. dbimon was inspired by Andreas Koenig's pmsql and borrows both design ideas and code from it. Thus the look and feel is almost identical to pmsql, in particular the following holds: .IP "\(bu" 4 The output is formatted much in the same way as by the msql or mysql monitor (see below), the msqlexport command and the relshow (mysqlshow) programs, which are coming with msql or mysql. .IP "\(bu" 4 The additional capability is a connection to a readline interface (if available) and a pipe to your favorite pager. .IP "\(bu" 4 Additionally you may switch between hosts and databases within one session and you don't have to type the nasty \f(CW\*(C`\eg\*(C'\fR or \f(CW\*(C`;\*(C'\fR (a trailing \f(CW\*(C`\eg\*(C'\fR, \f(CW\*(C`\eq\*(C'\fR, and \f(CW\*(C`\ep\*(C'\fR will be ignored). .PP If a command starts with one of the following reserved words, it's treated specially, otherwise it is passed on verbatim to the \s-1DBMS\s0. Output from the daemon is piped to your pager specified by either the \&\s-1DBIMON_PAGER\s0 or the \s-1PAGER\s0 environment variable. If both are undefined, the \s-1PATH\s0 is searched for either \*(L"less\*(R" or \*(L"more\*(R" and the first program found is taken. If no pager can be determined or your pager variable is empty or set to \f(CW\*(C`stdout\*(C'\fR, the program writes to unfiltered \&\s-1STDOUT\s0. .ie n .IP """?""" 2 .el .IP "\f(CW?\fR" 2 .IX Item "?" print usage summary .ie n .IP """dsn """ 2 .el .IP "\f(CWdsn \fR" 2 .IX Item "dsn " Connects to the given , the old connection is closed. .ie n .IP """q[uit]""" 2 .el .IP "\f(CWq[uit]\fR" 2 .IX Item "q[uit]" Leave dbimon. .ie n .IP """re[lshow] [ []]""" 2 .el .IP "\f(CWre[lshow] [ [
]]\fR" 2 .IX Item "re[lshow] [ [
]]" Without arguments this lists possible data sources by calling \s-1DBI\s0's \&\fIdata_sources\fR method. Data sources are driver dependent, the driver of the last connection will be used. Unfortunately \s-1DBI\s0 offers no possibilities of specifying a hostname or similar dsn attributes, so you can hardly list a remote hosts dsns, for example. .Sp If a \f(CW\*(C`dsn\*(C'\fR is given, dbimon will connect to the given dsn and list its tables. If both \f(CW\*(C`dsn\*(C'\fR and \f(CW\*(C`table\*(C'\fR are present, dbimon will list the tables fields. .Sp The latter possibilities are not supported by the \s-1DBI\s0 \- these work with private methods. Currently they are implemented for DBD::mSQL and DBD::mysql. .ie n .IP """se[t] [ []]""" 2 .el .IP "\f(CWse[t] [ []]\fR" 2 .IX Item "se[t] [ []]" This command displays and modifies dbimon's internal variables. Without arguments, all variables and their current settings are listed. With a variable name only you query the variables value. The two argument form modifies a variable. Supported variables are: .RS 2 .IP "showMode" 4 .IX Item "showMode" This variable controls the output of an \s-1SQL\s0 result table. Possible values are \f(CW\*(C`Box\*(C'\fR, \f(CW\*(C`Export\*(C'\fR, \f(CW\*(C`List\*(C'\fR, \f(CW\*(C`Table\*(C'\fR and \f(CW\*(C`HTML\*(C'\fR. These correspond to modes of the \fIData::ShowTable\fR module with the exception of \f(CW\*(C`Export\*(C'\fR: This is handled by dbimon internally, as \fIData::ShowTable\fR doesn't offer such a mode. The \f(CW\*(C`Export\*(C'\fR mode is well suited for exporting data to other database systems. See \fIData::ShowTable\fR\|(3). .IP "less" 4 .IX Item "less" This is the pager variable. You can turn off paging by setting this to 'stdout'. .IP "listWrapMargin" 4 .IX Item "listWrapMargin" .PD 0 .IP "maxTableWidth" 4 .IX Item "maxTableWidth" .IP "noEscape" 4 .IX Item "noEscape" .PD These correspond to the variables \f(CW$List_Wrap_Margin\fR, \f(CW$Max_Table_Width\fR and \f(CW$No_Escape\fR of the \fIData::ShowTable\fR module. See \fIData::ShowTable\fR\|(3). .IP "escapeChar" 4 .IX Item "escapeChar" .PD 0 .IP "quoteChar" 4 .IX Item "quoteChar" .IP "sepChar" 4 .IX Item "sepChar" .PD For \f(CW\*(C`Export\*(C'\fR mode dbimon will use these variables. Columns are surrounded by the \fIquoteChar\fR, separated by the \fIsepChar\fR and the \fIescapeChar\fR is used for inserting these special characters. The defaults are well suited for Excel (\fIescapeChar\fR = \f(CW\*(C`"\*(C'\fR, \&\fIquoteChar\fR = \f(CW\*(C`"\*(C'\fR and \fIsepChar\fR = \f(CW\*(C`;\*(C'\fR), thus a row with the values 1, 'walrus' and 'Nat \*(L"King\*(R" Cole' will be displayed as .Sp .Vb 1 \& "1";"walrus";"Nat ""King"" Cole" .Ve .RE .RS 2 .RE .ie n .IP """! EXPR""" 2 .el .IP "\f(CW! EXPR\fR" 2 .IX Item "! EXPR" Eval the \s-1EXPR\s0 in perl .Sh "Dumping a database contents" .IX Subsection "Dumping a database contents" The option \fB\-\-dump\fR forces dump of a databases contents, much like \&\fImsqldump\fR or \fImysqldump\fR do. By default all tables are dumped, but you can override this with a sequence of \fB\-\-table \f(CB$table\fB\fR options. .PP Dumping means to emit a .PP .Vb 1 \& CREATE TABLE $table (...) .Ve .PP statement (unless the option \fB\-\-no\-dump\-structure\fR is given), followed by a sequence of .PP .Vb 1 \& INSERT INTO $table (...) .Ve .PP statements, one per row, unless you use the option \fB\-\-no\-dump\-data\fR. By default \s-1INSERT\s0 statements don't include column names, but the option \fB\-\-dump\-names\fR can force that. .Sh "Completion" .IX Subsection "Completion" dbimon comes with some basic completion definitions that are far from being perfect. Completion means, you can use the \s-1TAB\s0 character to run some lookup routines on the current dsn or table and use the results to save a few keystrokes. .PP The completion mechanism is very basic, and I'm not intending to refine it in the near future. Feel free to implement your own refinements and let me know, if you have something better than what we have here. .SH "SEE ALSO" .IX Header "SEE ALSO" You need a readline package installed to get the advantage of a readline interface. If you don't have it, you won't be able to use the arrow keys in a meaningful manner. Term::ReadKey and Term::ReadLine do not come with the perl distribution but are available from \s-1CPAN\s0 (see http://www.perl.com/CPAN). .PP See \*(L"pmsql (1)\*(R", \*(L"\s-1DBI\s0 (3)\*(R", \*(L"Term::ReadKey (3)\*(R", \*(L"Term::ReadLine (3)\*(R",