| 1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
| 2 | .\" |
| 3 | .\" Standard preamble: |
| 4 | .\" ======================================================================== |
| 5 | .de Sh \" Subsection heading |
| 6 | .br |
| 7 | .if t .Sp |
| 8 | .ne 5 |
| 9 | .PP |
| 10 | \fB\\$1\fR |
| 11 | .PP |
| 12 | .. |
| 13 | .de Sp \" Vertical space (when we can't use .PP) |
| 14 | .if t .sp .5v |
| 15 | .if n .sp |
| 16 | .. |
| 17 | .de Vb \" Begin verbatim text |
| 18 | .ft CW |
| 19 | .nf |
| 20 | .ne \\$1 |
| 21 | .. |
| 22 | .de Ve \" End verbatim text |
| 23 | .ft R |
| 24 | .fi |
| 25 | .. |
| 26 | .\" Set up some character translations and predefined strings. \*(-- will |
| 27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| 28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
| 29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
| 30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
| 31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
| 32 | .tr \(*W-|\(bv\*(Tr |
| 33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| 34 | .ie n \{\ |
| 35 | . ds -- \(*W- |
| 36 | . ds PI pi |
| 37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| 38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| 39 | . ds L" "" |
| 40 | . ds R" "" |
| 41 | . ds C` "" |
| 42 | . ds C' "" |
| 43 | 'br\} |
| 44 | .el\{\ |
| 45 | . ds -- \|\(em\| |
| 46 | . ds PI \(*p |
| 47 | . ds L" `` |
| 48 | . ds R" '' |
| 49 | 'br\} |
| 50 | .\" |
| 51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
| 52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| 53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
| 54 | .\" output yourself in some meaningful fashion. |
| 55 | .if \nF \{\ |
| 56 | . de IX |
| 57 | . tm Index:\\$1\t\\n%\t"\\$2" |
| 58 | .. |
| 59 | . nr % 0 |
| 60 | . rr F |
| 61 | .\} |
| 62 | .\" |
| 63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 64 | .\" way too many mistakes in technical documents. |
| 65 | .hy 0 |
| 66 | .if n .na |
| 67 | .\" |
| 68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| 69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
| 70 | . \" fudge factors for nroff and troff |
| 71 | .if n \{\ |
| 72 | . ds #H 0 |
| 73 | . ds #V .8m |
| 74 | . ds #F .3m |
| 75 | . ds #[ \f1 |
| 76 | . ds #] \fP |
| 77 | .\} |
| 78 | .if t \{\ |
| 79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| 80 | . ds #V .6m |
| 81 | . ds #F 0 |
| 82 | . ds #[ \& |
| 83 | . ds #] \& |
| 84 | .\} |
| 85 | . \" simple accents for nroff and troff |
| 86 | .if n \{\ |
| 87 | . ds ' \& |
| 88 | . ds ` \& |
| 89 | . ds ^ \& |
| 90 | . ds , \& |
| 91 | . ds ~ ~ |
| 92 | . ds / |
| 93 | .\} |
| 94 | .if t \{\ |
| 95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| 96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| 97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| 98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| 99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| 100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| 101 | .\} |
| 102 | . \" troff and (daisy-wheel) nroff accents |
| 103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| 104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| 105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| 106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| 107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| 108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| 109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| 110 | .ds ae a\h'-(\w'a'u*4/10)'e |
| 111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
| 112 | . \" corrections for vroff |
| 113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| 114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| 115 | . \" for low resolution devices (crt and lpr) |
| 116 | .if \n(.H>23 .if \n(.V>19 \ |
| 117 | \{\ |
| 118 | . ds : e |
| 119 | . ds 8 ss |
| 120 | . ds o a |
| 121 | . ds d- d\h'-1'\(ga |
| 122 | . ds D- D\h'-1'\(hy |
| 123 | . ds th \o'bp' |
| 124 | . ds Th \o'LP' |
| 125 | . ds ae ae |
| 126 | . ds Ae AE |
| 127 | .\} |
| 128 | .rm #[ #] #H #V #F C |
| 129 | .\" ======================================================================== |
| 130 | .\" |
| 131 | .IX Title "DBIMON 1" |
| 132 | .TH DBIMON 1 "2002-10-01" "perl v5.8.0" "User Contributed Perl Documentation" |
| 133 | .SH "NAME" |
| 134 | dbimon \- interactive shell with readline for DBI |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | \&\f(CW\*(C`dbimon <dsn> [<user> [<password>]]\*(C'\fR |
| 138 | [<options>] |
| 139 | .SH "DESCRIPTION" |
| 140 | .IX Header "DESCRIPTION" |
| 141 | dbimon lets you talk to a running \s-1SQL\s0 server via the database independent |
| 142 | Perl interface \s-1DBI\s0. dbimon was inspired by Andreas Koenig's pmsql and |
| 143 | borrows both design ideas and code from it. Thus the look and feel is |
| 144 | almost identical to pmsql, in particular the following holds: |
| 145 | .IP "\(bu" 4 |
| 146 | The output is formatted much in the same way as by the msql or mysql |
| 147 | monitor (see below), the msqlexport command and the relshow (mysqlshow) |
| 148 | programs, which are coming with msql or mysql. |
| 149 | .IP "\(bu" 4 |
| 150 | The additional capability is a connection to a readline interface (if |
| 151 | available) and a pipe to your favorite pager. |
| 152 | .IP "\(bu" 4 |
| 153 | Additionally you may switch between hosts and databases within one session |
| 154 | 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, |
| 155 | and \f(CW\*(C`\ep\*(C'\fR will be ignored). |
| 156 | .PP |
| 157 | If a command starts with one of the following reserved words, it's |
| 158 | treated specially, otherwise it is passed on verbatim to the \s-1DBMS\s0. |
| 159 | Output from the daemon is piped to your pager specified by either the |
| 160 | \&\s-1DBIMON_PAGER\s0 or the \s-1PAGER\s0 environment variable. If both are undefined, |
| 161 | the \s-1PATH\s0 is searched for either \*(L"less\*(R" or \*(L"more\*(R" and the first program |
| 162 | found is taken. If no pager can be determined or your pager |
| 163 | variable is empty or set to \f(CW\*(C`stdout\*(C'\fR, the program writes to unfiltered |
| 164 | \&\s-1STDOUT\s0. |
| 165 | .ie n .IP """?""" 2 |
| 166 | .el .IP "\f(CW?\fR" 2 |
| 167 | .IX Item "?" |
| 168 | print usage summary |
| 169 | .ie n .IP """dsn <dsn>""" 2 |
| 170 | .el .IP "\f(CWdsn <dsn>\fR" 2 |
| 171 | .IX Item "dsn <dsn>" |
| 172 | Connects to the given <dsn>, the old connection is closed. |
| 173 | .ie n .IP """q[uit]""" 2 |
| 174 | .el .IP "\f(CWq[uit]\fR" 2 |
| 175 | .IX Item "q[uit]" |
| 176 | Leave dbimon. |
| 177 | .ie n .IP """re[lshow] [<dsn> [<table>]]""" 2 |
| 178 | .el .IP "\f(CWre[lshow] [<dsn> [<table>]]\fR" 2 |
| 179 | .IX Item "re[lshow] [<dsn> [<table>]]" |
| 180 | Without arguments this lists possible data sources by calling \s-1DBI\s0's |
| 181 | \&\fIdata_sources\fR method. Data sources are driver dependent, the driver |
| 182 | of the last connection will be used. Unfortunately \s-1DBI\s0 offers no |
| 183 | possibilities of specifying a hostname or similar dsn attributes, |
| 184 | so you can hardly list a remote hosts dsns, for example. |
| 185 | .Sp |
| 186 | If a \f(CW\*(C`dsn\*(C'\fR is given, dbimon will connect to the given dsn and list |
| 187 | its tables. If both \f(CW\*(C`dsn\*(C'\fR and \f(CW\*(C`table\*(C'\fR are present, dbimon will list |
| 188 | the tables fields. |
| 189 | .Sp |
| 190 | The latter possibilities are not supported by the \s-1DBI\s0 \- these work |
| 191 | with private methods. Currently they are implemented for DBD::mSQL |
| 192 | and DBD::mysql. |
| 193 | .ie n .IP """se[t] [<var> [<val>]]""" 2 |
| 194 | .el .IP "\f(CWse[t] [<var> [<val>]]\fR" 2 |
| 195 | .IX Item "se[t] [<var> [<val>]]" |
| 196 | This command displays and modifies dbimon's internal variables. |
| 197 | Without arguments, all variables and their current settings are |
| 198 | listed. With a variable name only you query the variables value. |
| 199 | The two argument form modifies a variable. Supported variables |
| 200 | are: |
| 201 | .RS 2 |
| 202 | .IP "showMode" 4 |
| 203 | .IX Item "showMode" |
| 204 | This variable controls the output of an \s-1SQL\s0 result table. Possible values |
| 205 | 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 |
| 206 | to modes of the \fIData::ShowTable\fR module with the exception of \f(CW\*(C`Export\*(C'\fR: |
| 207 | This is handled by dbimon internally, as \fIData::ShowTable\fR doesn't |
| 208 | offer such a mode. The \f(CW\*(C`Export\*(C'\fR mode is well suited for exporting data to |
| 209 | other database systems. See \fIData::ShowTable\fR\|(3). |
| 210 | .IP "less" 4 |
| 211 | .IX Item "less" |
| 212 | This is the pager variable. You can turn off paging by setting this |
| 213 | to 'stdout'. |
| 214 | .IP "listWrapMargin" 4 |
| 215 | .IX Item "listWrapMargin" |
| 216 | .PD 0 |
| 217 | .IP "maxTableWidth" 4 |
| 218 | .IX Item "maxTableWidth" |
| 219 | .IP "noEscape" 4 |
| 220 | .IX Item "noEscape" |
| 221 | .PD |
| 222 | These correspond to the variables \f(CW$List_Wrap_Margin\fR, \f(CW$Max_Table_Width\fR |
| 223 | and \f(CW$No_Escape\fR of the \fIData::ShowTable\fR module. See \fIData::ShowTable\fR\|(3). |
| 224 | .IP "escapeChar" 4 |
| 225 | .IX Item "escapeChar" |
| 226 | .PD 0 |
| 227 | .IP "quoteChar" 4 |
| 228 | .IX Item "quoteChar" |
| 229 | .IP "sepChar" 4 |
| 230 | .IX Item "sepChar" |
| 231 | .PD |
| 232 | For \f(CW\*(C`Export\*(C'\fR mode dbimon will use these variables. Columns are |
| 233 | surrounded by the \fIquoteChar\fR, separated by the \fIsepChar\fR and |
| 234 | the \fIescapeChar\fR is used for inserting these special characters. |
| 235 | The defaults are well suited for Excel (\fIescapeChar\fR = \f(CW\*(C`"\*(C'\fR, |
| 236 | \&\fIquoteChar\fR = \f(CW\*(C`"\*(C'\fR and \fIsepChar\fR = \f(CW\*(C`;\*(C'\fR), thus a row with the |
| 237 | values 1, 'walrus' and 'Nat \*(L"King\*(R" Cole' will be displayed as |
| 238 | .Sp |
| 239 | .Vb 1 |
| 240 | \& "1";"walrus";"Nat ""King"" Cole" |
| 241 | .Ve |
| 242 | .RE |
| 243 | .RS 2 |
| 244 | .RE |
| 245 | .ie n .IP """! EXPR""" 2 |
| 246 | .el .IP "\f(CW! EXPR\fR" 2 |
| 247 | .IX Item "! EXPR" |
| 248 | Eval the \s-1EXPR\s0 in perl |
| 249 | .Sh "Dumping a database contents" |
| 250 | .IX Subsection "Dumping a database contents" |
| 251 | The option \fB\-\-dump\fR forces dump of a databases contents, much like |
| 252 | \&\fImsqldump\fR or \fImysqldump\fR do. By default all tables are dumped, |
| 253 | but you can override this with a sequence of \fB\-\-table \f(CB$table\fB\fR options. |
| 254 | .PP |
| 255 | Dumping means to emit a |
| 256 | .PP |
| 257 | .Vb 1 |
| 258 | \& CREATE TABLE $table (...) |
| 259 | .Ve |
| 260 | .PP |
| 261 | statement (unless the option \fB\-\-no\-dump\-structure\fR is given), followed |
| 262 | by a sequence of |
| 263 | .PP |
| 264 | .Vb 1 |
| 265 | \& INSERT INTO $table (...) |
| 266 | .Ve |
| 267 | .PP |
| 268 | statements, one per row, unless you use the option \fB\-\-no\-dump\-data\fR. |
| 269 | By default \s-1INSERT\s0 statements don't include column names, but the |
| 270 | option \fB\-\-dump\-names\fR can force that. |
| 271 | .Sh "Completion" |
| 272 | .IX Subsection "Completion" |
| 273 | dbimon comes with some basic completion definitions that are far from |
| 274 | being perfect. Completion means, you can use the \s-1TAB\s0 character to run |
| 275 | some lookup routines on the current dsn or table and use the results |
| 276 | to save a few keystrokes. |
| 277 | .PP |
| 278 | The completion mechanism is very basic, and I'm not intending to |
| 279 | refine it in the near future. Feel free to implement your own |
| 280 | refinements and let me know, if you have something better than what we |
| 281 | have here. |
| 282 | .SH "SEE ALSO" |
| 283 | .IX Header "SEE ALSO" |
| 284 | You need a readline package installed to get the advantage of a |
| 285 | readline interface. If you don't have it, you won't be able to use the |
| 286 | arrow keys in a meaningful manner. Term::ReadKey and Term::ReadLine do |
| 287 | not come with the perl distribution but are available from \s-1CPAN\s0 (see |
| 288 | http://www.perl.com/CPAN). |
| 289 | .PP |
| 290 | See \*(L"pmsql (1)\*(R", \*(L"\s-1DBI\s0 (3)\*(R", \*(L"Term::ReadKey (3)\*(R", \*(L"Term::ReadLine (3)\*(R", |