Friday, October 3, 2014

Re: dbext 20.00 and DBI_column_delimiter



On Thu, Oct 2, 2014 at 7:06 PM, Josef Fortier <josef.fortier@gmail.com> wrote:
I've googled correspondence from David Fishburn here, it seems as good a place as any to ask (please forgive me if vim_use is totally inappropriate).


Yes, vim_use is the right spot to ask plugin questions, that way other lurkers get the benefit of seeing the question and the solution.

Typically I will take if offline for a bit while we research and then post back with the final solution, so it remains in the vim_use archives.

 
I'm using Vundle.

I've tried to call DBSetOption in a variety of automated fashions. It appears that I need to call a dbext function before I'm able to set the option


(edited) DBGetoptions shows

.....


-------------------------------
** Overrides (via the vimrc) **
-------------------------------
history_file = ~/tmp/.vim/dbext.history
menu_mode = 3
DBI_column_delimiter = ^I
...
-------------------------------
** dbext Component Versions   **
-------------------------------
plugin/dbext.vim = 2000
autoload/dbext.vim = 2000
autoload/dbext_dbi.vim = unknown
-------------------------------
** Vim Version Information   **
-------------------------------
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  2 2014 19:39:59)
Included patches: 1-52
Modified by pkg-vim-maintainers@XXXX.alioth.debian.org
Compiled by buildd@
Huge version with GTK2 GUI


Putting the following in my .vimrc:
let g:dbext_default_DBI_column_delimiter = "\t"

Choose a DBI connection and running :DBGetOption shows:
DBI_column_delimiter = funny character representing a tab when using listchars:

listchars=eol:$,tab:» ,eol:¶,trail:·,extends:…,precedes:…

Also, doing this test:
echo '"'.b:dbext_DBI_column_delimiter.'"'
" "

Which is more than the 3 character default.

And looking at a resultset things are correctly tab delimited which is again shown via listchars:
TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS --------- -------------- ------------------------------- ------------ ------- NULL DBA SYNC_LOG TABLE NULL



My 2nd test was using a profile to set this option.


When I create a profile using:
let g:dbext_default_profile_ASA_Test_DBI = 'type=DBI:user=bob:passwd=bob:driver=SQLAnywhere:conn_parms=DSN=bobs_dsn:DBI_column_delimiter=\t'

Then run :DBGetOption I see:
DBI_column_delimiter = \t

Unfortunately, it does not expand the \t, so I get output that looks like this:

TABLE_CAT\tTABLE_SCHEM   \tTABLE_NAME                     \tTABLE_TYPE  \tREMARKS\t
---------\t--------------\t-------------------------------\t------------\t-------\t
NULL     \tDBA           \tSYNC_LOG                       \tTABLE       \tNULL   \t


Which was not what was intended (or should I say wanted).


The 3rd test was using:

DBSetOption DBI_column_delimiter="\t"

But this has the same result of the 2nd test.



Now, I am using dbext 21.00, which I have not released yet.  Not certain if 20.00 works the same way or not.

We can take this offline and you can email me directly.
I would like to get the setting via the profile working as this is what I always use.


David


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: