Wednesday, August 2, 2017

Re: Configure DBext mac for SQLite

Glad you managed to get it working using DBI.

I would like to resolve this issue though Brian. 

If there are any Mac users who might have some input into this I would appreciate it.

Please read below.

On Sun, Jul 23, 2017 at 5:43 PM, Brian Libgober <libgober@gmail.com> wrote:
...
select * from CIK limit 5;

The error I get back

Connection: T(SQLITE)  D(/Users/brianlibgober/Dropbox/Collaborations/CleanMake/Main.sqlite)   at 17:32
Error: near "<": syntax error
...
 
Last command(rc=1):
sqlite3  /Users/brianlibgober/Dropbox/Collaborations/CleanMake/Main.sqlite < /var/folders/p2/nkftf47s5vb8zr6slgc7fc940000gn/T/v5uxPIb/dbext.sql
Last SQL:
.mode column
.headers ON
select * from CIK limit 5

The bizarreness of this is that the following run on terminal:

sqlite3  /Users/brianlibgober/Dropbox/Collaborations/CleanMake/Main.sqlite < /var/folders/p2/nkftf47s5vb8zr6slgc7fc940000gn/T/v5uxPIb/dbext.sql

Yields

index       CIK         COMPANYNAME
----------  ----------  -----------
0           0001438823  !J INC
1           0001509607  #1 A LIFESA
2           0001457512  #1 ARIZONA
3           0001433777  #1 PAINTBAL
4           0001427189  $ LLC

...

Sorry, Brian I have been away.

Yes, your analysis above is definitely strange, if that command worked from the command line, then I would think it also should have worked from the system() command. 

What happens when you try these steps:

1.  Use the SQLite connection type (instead of DBI as you did before)

2. Set a couple of dbext options
:DBSetOption delete_temp_file=0
:DBSetOption display_cmd_line=1

3. Run the SQL statement
:Select * from CIK limit 5


4.  Try it in Vim, without using the dbext plugin

At this point you should have the same error.
But with those options set, the dbext.sql file should still be available and the command line executed should be shown.

Use Vim's echo statement to see the results:

:echo system('sqlite3  /Users/brianlibgober/Dropbox/Collaborations/CleanMake/Main.sqlite < /var/folders/p2/nkftf47s5vb8zr6slgc7fc940000gn/T/v5uxPIb/dbext.sql')

This should result in the same error as you initially reported.
If you do get an error (I hope you do) when using the :echo statement, if you could possibly play with these settings in Vim:

:h 'shellquote'
:h 'shellslash'
:h 'shellpipe'
:h 'shellxquote'
:h 'shellxescape'
:h 'shelltype'

Perhaps :h shellpipe, since it is really complaining about the <?


5.  Provide the output from :set and from :DBGetOption

Sorry to ask you to try stuff, but I don't use a Mac, I do test on Linux though.


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:

Post a Comment