dbish (DBI::Shell 11.93 using DBI 1.51)
am 03.08.2006 19:11:19 von scoombe
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
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?
note: because of permission problems, I had to install dbish in
a local directory rather than /usr/local/perl586/bin.
Thanks,
Skip
Skip Coombe
Rambus CAD Engineering
skip_coombe@rambus.com
919.960.6621
=20
Re: dbish (DBI::Shell 11.93 using DBI 1.51)
am 01.09.2006 03:24:05 von tlowery
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-->
>