Thomas A. Lowery wrote:

To start shell I use: dbish "dbi:CSV:f_dir=.;csv_eol=\n"

My guess is that you are somehow turning the eol character into a literal slash + char "n" and that is causing all of the following problems.I notice for example that using dbish to manually set a DSN, it only accepts the single quote as a DSN delimiter, not the double quote, so if you are passing the DSN to Shell.pm as an uninterpolated string, rather than as an interpolated string, you'll be fouling up the attributes and also behaving differently from the way that a real DBI connection works (i.e. a real connection accepts either an interpolated or uninterpolated string depending on what quotes the user supplies).

BTW, you don't need to explicitly set the f_dir to the current directory, that's the default.

This leaves me at a dbish prompt.  So to effectively use the DBD::CSV, I'll
need a plug-in to support commands like:
        /csv table table_name file_name column_names
        /csv table eol \n

In the next release there will be a SQL command along the lines of "CONNECT TO 'dbi::CSV:csv_eol=\n;col_names=foo,bar' AS myDataSource" so users will be able to configure for any kind of file from the command line or from connection strings stored in a file. But that "\n" will have to be passed as one character (not two) as well.

--
Jeff




Reply via email to