Re: dbish (DBI::Shell 11.93 using DBI 1.51)



Coombe, Skip wrote:
dbish would be a very handy tool if I could figure out how
to use it.

I've read 'perldoc DBI::Shell"

but things start badly when I type 'dbish --debug DBI:SQLite:my.db


Unrecognised options: --debug

You need to include a number to indicate the debugging level. 1 - 9. I
need to change (improve) the documentation.

I worked my way down the list of advertised cmds, with the
uniform response

@DBI:SQLite:sqliteTest.dbsqliteTest.db> help /
DBD::SQLite::db prepare failed: near "count": syntax error(1) at
dbdimp.c line 269.

@DBI:SQLite:sqliteTest.dbsqliteTest.db> count pet /do
DBI::Shell: do failed: DBD::SQLite::db do failed: near "count": syntax
error(1) at dbdimp.c line 269 at
/usr/local/perl586/lib/site_perl/5.8.6/DBI/Shell.pm line 1033.

some std SQL cmds work fine, like 'select * from table1/'

but others fail, like:

@DBI:SQLite:sqliteTest.dbsqliteTest.db> show tables /
DBD::SQLite::db prepare failed: near "show": syntax error(1) at dbdimp.c
line 269.

Can anyone see what I am doing wrong, or suggest an alternate
cmd line browser that works with dbi?

The shell requires the command prefix before the shell command:
/show tables
/help
/opt
....

I haven't tested the shell against SQLite. Let know how well it works.

Example: (note for mysql I change my command prefix to semicolon)
tlowery@pengye:~/projects/dbish/trunk> perl -w -Iblib/lib -Iblib/arch ./dbish --debug 9 dbi:mysql:test
Using formatter class 'DBI::Format::Neat'
DBI::Shell 11.93 using DBI 1.50
DBI::Shell loaded from blib/lib/DBI/Shell.pm
reference type: ARRAY
reference type: ARRAY
/option editor=vim (was vi)
reference type: ARRAY
/option sqlpath=.:/home/tlowery/sql (was .)
reference type: ARRAY
/option tmp_dir=/tmp (was undef)
reference type: ARRAY
/option tmp_file=dbish11284.sql (was dbish11284.sql)
reference type: ARRAY
/option command_prefix=; (was [/;])
Loaded plugins DBI::Shell::Timing
Loaded plugins DBI::Shell::Completion
Loaded plugins DBI::Shell::Spool
reference type: ARRAY
reference type: ARRAY
reference type: ARRAY
reference type: ARRAY
reference type: ARRAY
commandline history written to /home/tlowery/.dbish_history
Using Term::ReadLine::Gnu
reference type: ARRAY
reference type: ARRAY

WARNING: The DBI::Shell interface and functionality are
======= very likely to change in subsequent versions!


Connecting to 'dbi:mysql:test' as ''...
reference type: ARRAY
/option prompt=mysql-- (was dbi:mysql:test)
reference type: ARRAY
/option format=sqlm (was neat)
Loaded plugins DBI::Shell::SQLMinus
@mysql--> ;sho tables
command='sho' args=' tables' output='' at blib/lib/DBI/Shell.pm line 602.
TABLE_CAT,TABLE_SCHEM,TABLE_NAME,TABLE_TYPE,REMARKS
undef,undef,'testme','TABLE',undef
[1 rows of 5 fields returned]
@mysql-->

.



Relevant Pages

  • Re: undefined vs. undefined (was: new Array() vs [])
    ... or to the array performance, I dared to move it to a new thread. ... And section 10.1.3 explains the assignment of the undefined value to ... to give a Reference type. ... var arr = ...
    (comp.lang.javascript)
  • Re: GetCrossReferenceItems and sparse returns for wdCaptionTable
    ... The array that you get back from GetCrossReferenceItems is equivalent to the ... The Reference Type you must give it is equivalent to the ... wdCaptionFigure, wdCaptionEquation. ...
    (microsoft.public.word.vba.general)
  • Re: Array Fundamentals
    ... When a value-type object is created, C# allocates a single ... the values inside an Array should be allocated ... reside on the heap ... >type is that only the reference type exist on the heap. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: foreach doesnt work with array of bools?
    ... In the code above I created an array of StringBuilder objects. ... Second loop calls the Append method ... it is a reference type and it too is read-only. ... Can I call the set methods? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQL ERROR
    ... > I am trying to prepare an SQL statement to read a database. ... > running DBI v.1.14. ... I am putting my values into an array and then ... again please remember, am still new to perl myself, so some of my terminolgy ...
    (comp.lang.perl.misc)