ANN: dbext.vim version 26.00 - Database access from within Vim

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ANN: dbext.vim version 26.00 - Database access from within Vim

David Fishburn-2
What is it?
-----------
dbext.vim : Provides database access to most databases.

This plugin contains functions/mappings/commands to enable Vim to
access several databases. Currently Mysql, PostgreSQL, Ingres, Oracle,
Sybase Adaptive Server Anywhere, Sybase Adaptive Server Enterprise,
Microsoft SQL Server, DB2, RDB,  SAP HANA, Crate.IO and Interbase 
are supported.  If you have a Perl enabled Vim, it also allows database 
connections via DBI and ODBC.

It abstracts database access, so the same Vim commands will produce
the same output regardless of the database you use.

Extensive help file with full tutorials.

New Features
------------
- New option g:dbext_default_job_show_msgs to control whether information messages are displayed when starting and stop jobs.  Regular status messages continue to display.

- New option g:dbext_default_job_pipe_regex to control how to identify and strip piped in files and specify it separately via job options.

- Renamed option g:dbext_default_use_jobs to g:dbext_default_job_enable to better support tab completion for the DBSetOption command.
                                                                          
Bug Fixes
---------
- Also check for 'timers' when checking for job support.

- Revamped job support.  Tested on Windows, Linux and OSX.  Works on long running and very short jobs where it was erratic on first release.


I am always open to suggestions, just email me.  See :h dbext.txt for contact details.

Enjoy.
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ANN: dbext.vim version 26.00 - Database access from within Vim

philip_rhoades
David,

This looks very interesting but even the tutorial is overwhelming - for
a quick start, what is the simplest way for me to connect to:

   /home/phil/src/ruby/sqlite.db

and execute a query like:

   .tables

Thanks,

Phil.


On 2017-11-18 04:32, David Fishburn wrote:

> What is it?
> -----------
> dbext.vim : Provides database access to most databases.
> http://www.vim.org/scripts/script.php?script_id=356 [1]
>
> This plugin contains functions/mappings/commands to enable Vim to
> access several databases. Currently Mysql, PostgreSQL, Ingres, Oracle,
> Sybase Adaptive Server Anywhere, Sybase Adaptive Server Enterprise,
> Microsoft SQL Server, DB2, RDB,  SAP HANA, Crate.IO and Interbase
> are supported.  If you have a Perl enabled Vim, it also allows
> database
> connections via DBI and ODBC.
>
> It abstracts database access, so the same Vim commands will produce
> the same output regardless of the database you use.
>
> Extensive help file with full tutorials.
>
> New Features
> ------------
> - New option g:dbext_default_job_show_msgs to control whether
> information messages are displayed when starting and stop jobs.
> Regular status messages continue to display.
>
> - New option g:dbext_default_job_pipe_regex to control how to identify
> and strip piped in files and specify it separately via job options.
>
> - Renamed option g:dbext_default_use_jobs to
> g:dbext_default_job_enable to better support tab completion for the
> DBSetOption command.
>
> Bug Fixes
> ---------
> - Also check for 'timers' when checking for job support.
>
> - Revamped job support.  Tested on Windows, Linux and OSX.  Works on
> long running and very short jobs where it was erratic on first
> release.
>
> I am always open to suggestions, just email me.  See :h dbext.txt for
> contact details.
>
> Enjoy.
>
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>
>
> Links:
> ------
> [1] http://www.vim.org/scripts/script.php?script_id=356

--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ANN: dbext.vim version 26.00 - Database access from within Vim

David Fishburn-2
In reply to this post by David Fishburn-2


On Fri, Nov 17, 2017 at 6:22 PM, Philip Rhoades <[hidden email]> wrote:
 
This looks very interesting but even the tutorial is overwhelming - for a quick start, what is the simplest way for me to connect to:

  /home/phil/src/ruby/sqlite.db

and execute a query like:

  .tables

Probably the easiest way is:

1. Before launching Vim, make sure the sqlite binary is in your path.

2. I assume plugin/dbext.vim has already been sourced (:DBGetOption returns something successfully)

3. Execute the following to specify connection information (fastest easiest way):
         :DBSetOption type=SQLITE:user=:passwd=:dbname=/home/phil/src/ruby/sqlite.db
         - Usernames and passwords are not used by SQLite, so we blank them out from the default here

4. Execute the following command
         :DBExecSQL .tables

Connection: T(SQLITE)  D(/home/phil/src/ruby/sqlite.db)   a
am                 fd_group           recipe             vf
am_zero            food_des           rm                 vf_zero
ar                 mealfoods          rm_zero            weight
archive_mealfoods  meals              sql_statements     weightslope
dv                 nut_opts           tcl_code           wlog
dv_defaults        nutr_def           theusual
fatslope           options            version


Instead of step #3, you can also run :DBPromptForBufferParameters.  You may have to run through this twice removing the "@askb" for username and password.  The 2nd time will allow you to enter the database name.

And that is why I would add the following to my .vimrc:
let g:dbext_default_profile_ANYTHINGYOUWANT = 'type=SQLITE:dbname=/home/phil/src/ruby/sqlite.db'

So that when you run:
:DBPromptForBufferParameters

You would simply choose:
ANYTHINGYOUWANT

From that list, which is just far easier in the long run when you use these databases on a regular basis.


Hope that helps,

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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ANN: dbext.vim version 26.00 - Database access from within Vim

Josef Fortier
In reply to this post by David Fishburn-2
Would you be willing to create a github (or alternative public repo) copy of dbext to aid package managers?

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ANN: dbext.vim version 26.00 - Database access from within Vim

David Fishburn-2


On Mon, Nov 20, 2017 at 12:58 PM, Josef Fortier <[hidden email]> wrote:
Would you be willing to create a github (or alternative public repo) copy of dbext to aid package managers?


Never considered it as I don't use a package manager.

No idea how much work it would be to bundle them up in the correct format.

There are at least 3 I would have to do right?
    Vundle
    Pathogen
    Vim 8's Package

Having not used a package manager and when only finding plugins in a package manager I find a pain in the butt, as I have to figure out how to extract them and just put them in my standard .vim (vimfiles) folder.

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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ANN: dbext.vim version 26.00 - Database access from within Vim

Josef Fortier
> No idea how much work it would be to bundle them up in the correct format.

It's not really too difficult. The loading path is altered to include the subdirectory, which in turn just maps the existing structure (in an isolated way). It's mostly "multiple ~/.vim directories". Your existing structure should work just fine.

I have a working example here:

https://github.com/fourjay/dbext
 
It's what I use to install to my various environments.

> There are at least 3 I would have to do right?
>     Vundle
>     Pathogen
>     Vim 8's Package

Pathogen was the first approach, and most just copied (and extended) this approach. Vundle uses it, as does Plug. I'm pretty sure that, other then a few extensions, Vim 8's also uses the same approach.

FWIW, there were a few competing approaches a while ago, but path manipulation has seen near universal adoption now.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ANN: dbext.vim version 26.00 - Database access from within Vim

Matěj Cepl-2
In reply to this post by David Fishburn-2
On 2017-11-20, 18:40 GMT, David Fishburn wrote:
> No idea how much work it would be to bundle them up in the
> correct format.
>
> There are at least 3 I would have to do right?
>     Vundle
>     Pathogen
>     Vim 8's Package

There is no format. Just make somewhere available your
repository with the code in the organization vim expects. Hint,
my repository https://gitlab.com/mcepl/vim-dbext is in such
form, and you can use whatever vundle/pathogen/vim8 packages
with it.

Best,

Matěj
--
http://matej.ceplovi.cz/blog/, Jabber: mcepl<at>ceplovi.cz
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
SCSI is *not* magic. There are *fundamental* *technical*
reasons why you have to sacrifice a young goat to your SCSI
chain every now and then.
     -- John F. Woods

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.