GithubHelp home page GithubHelp logo

vim-dadbod's Introduction

dadbod.vim

Dadbod is a Vim plugin for interacting with databases. It's a more modern take on dbext.vim, improving on it on the following ways:

  • Connections are specified with a single URL, rather than prompting you for 14 separate variables
  • All interaction is through invoking :DB, not 53 different commands and 35 different maps (omitting many of the more esoteric features, of course)
  • Supports a modern array of backends, including NoSQL databases:
    • Big Query
    • ClickHouse
    • DuckDB
    • Impala
    • jq
    • MongoDB
    • MySQL
    • MariaDB
    • Oracle
    • osquery
    • PostgreSQL
    • Presto
    • Redis
    • SQL Server
    • SQLite
    • Your own easily implemented adapter
  • Easily configurable based on a project directory (as seen in rails.vim, for example), rather than just globally or in a per-file modeline
  • For those that just can't live without some piece of dbext functionality, the option g:dadbod_manage_dbext is provided to force dbext to use Dadbod's default database.

Usage

The :DB command has a few different usages. All forms accept a URL as the first parameter, which can be omitted if a default is configured or provided by a plugin.

Omit further arguments to spawn an interactive console (like psql or redis-cli).

:DB postgresql:///foobar
:DB redis:

If additional arguments are provided, they are interpreted as a query string to pass to the database. Results are displayed in a preview window.

:DB sqlite:myfile.sqlite3 select count(*) from widgets
:DB redis:/// CLIENT LIST

Give a range to run part or all of the current buffer as a query.

:%DB mysql://root@localhost/bazquux

Use < to pass in a filename.

:DB mongodb:///test < big_query.js

There's also a special assignment syntax for saving a URL to a Vim variable for later use.

:DB g:prod = postgres://user:[email protected]/production_database
:DB g:prod drop table users

A few additional URL like formats are accepted for interop:

  • :DB jdbc:sqlserver://...
  • :DB dbext:profile=profile_name
  • :DB dbext:type=PGSQL:host=...
  • :DB $DATABASE_URL (with optional dotenv.vim support)

Plugins can provide their own URL handlers as well. For example, heroku.vim provides support for heroku:appname style URLs.

If you want to manage multiple connections at once through UI, try dadbod-ui.

Installation

Install using your favorite package manager, or use Vim's built-in package support:

mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/dadbod.git
vim -u NONE -c "helptags dadbod/doc" -c q

Promotion

Like dadbod.vim? Star the repository on GitHub and vote for it on vim.org.

Love dadbod.vim? Follow tpope on GitHub and Twitter.

License

Copyright © Tim Pope. Distributed under the same terms as Vim itself. See :help license.

vim-dadbod's People

Contributors

acamso avatar chunleng avatar danarth avatar deathlyfrantic avatar dhakimian avatar dotdash avatar dubek avatar felixoid avatar gviamont avatar hbarral avatar hiberabyss avatar joaomsa avatar johnybx avatar jungsooyun avatar kristijanhusak avatar martinaskestad avatar mbhynes avatar meunierd avatar odnoletkov avatar praddy avatar sj26 avatar ss18 avatar stesavo avatar tamago324 avatar touchmarine avatar tpope avatar wspurgin avatar znd4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-dadbod's Issues

Oracle support please

Is this DB explorer? I could not find any screenshot. Could you please add Oracle support?

PostgreSQL Transactions

It seems PostgreSQL transactions don't work at all.

A simple test case would be:

:DB begin
:DB rollback

which results in:

psql:<stdin>:1: WARNING:  there is no transaction in progress
ROLLBACK

I don't know if this is out-of-scope for dadbod, but a good few of my use cases are impossible without this working.

With or without, I still love this for vim plugin and still use it every day, so thanks for your work.

Get output file path

The result of every query is saved in a temp file. I'd like to use that file, is it possible to get the path programmatically? (for the last query)

Using .mylogin.cnf for a mysql connection

First of all, thanks for the great work with this plugin!

In order to use encrypted password for a mysql connection I'm using .mylogin.cnf. To use a connection from this configuration file from the shell I would use
mysql --login-path=<entry-in-config>

Is there any way to supply the login-path flag using dadbod?

Thanks!

Vertical split preview window

Is it possible to open the preview window vertically?

I run the command, c-w H to move it vertical to see the results, start typing to amend the query, and then the preview autocloses after a few seconds. I could easily write a function that runs the DB command and then does the split move, but I was wondering if you think making it an option makes sense?

Configurable adapters command binaries

Hey,

Where do you stand on making adapters command binaries (e.g. 'sqlcmd', 'sqlite3'), configurable?

I am running on a Windows 10 machine, and while Vim is installed through Cygwin, sqlcmd is not -- I know, my life is miserable -- and because of it, when I try to use :DB to talk to the SQL Server, sqlcmd complains that it cannot read '/tmp/....' (which is expected, as sqlcmd have no idea about the Cygwin filesystem).

So I created a wrapper inside '~/bin' to preprocess arguments, and whenever the -i flag is specified its value is passed to cygpath -W. I know it's not a big deal, but right now I am forced to call this wrapper exactly sqlcmd, and that shadows the existing program and forces me to hard-code the original binary path in my wrapper as which would not be of help anymore. On the other end, if adapters binary names were configurable I could have renamed my wrapper into sqlcmdw or something, and changed my .vimrc to instruct dadbod to use it instead, done!

Thoughts? If you are happy with the proposal and have any preference on its implementation, I can put together a PR for it.

Thanks for the great work!

Presto Adapter

Not sure if this is cool but a PrestoDB adapter would be amazing.

Focus preview window after command execution

It would be nice to a have a setting that sets focusing a preview window after executing a command.

:DB g:localhost select * from people

and the cursor is at the window with the result.

Name contains insufficient wordplay

Expected behaviour

tpope repos should have names such that

let a = <word relating to purpose>
let b = <name of repo>
a =~ b && ("vim-" . a) != b  " should be true

Actual behaviour

"vim-" . "db" != "vim-db" evaluates to false.

Possible fix

Rename to vim-birdbath, vim-bloodbath, vim-redbrick, vim-windbag, vim-deadbeef, vim-breadbox, vim-tidbit, vim-cardboard...

Edited to add: vim-dadbod

Can't connect due to quotes

Hi,

I think this is due to my setup, but any advice is much appreciated.

I'm running neovim with xonsh as my shell.

I'm unable to start mysql due to the single quotes in the decoded url arguments:
:echo db#adapter#dispatch("mysql://root:mypass@localhost/db", "interactive")
gives
mysql -h 'localhost' -u 'root' -p'mypass' 'db'

The problem is that xonsh doesn't remove the internal quotes.

ODBC support via isql

I'm not very good at vimscript, but would it be possible to add support for isql from unixodbc? Some of the more proprietary databases have only ODBC drivers, so it would open up a huge world of connectivity (they all seem to work with unixodbc).

osquery adapter

I want to add an osquery adapter but it ONLY works on localhost or pointed to a file path. How should I best express this connection string?

ms sql adaptor string

I am a beginner attempting to start an interactive console with mssql using the
adapter string specified in the help documentation:

    sqlserver://[<user>[:<password>]@][<host>][:<port>]/[<database>]
    sqlserver://[<host>[:<port>]][;user=<user>][;...]

I'm using gvim 8.1 and MS SQL Server Management Studio v18.2 installed on a win
10 desktop, so I believe I don't have host or port details (perhaps thats the
issue?)

I do have a server name, username and password, and a database name ('test') which I've
used as follows:

    DB sqlserver://<username>:<password>@<DESKTOP-*****/SQLEXPRESS>/test

but sadly there is no visual indication that a console has started. I've tried to create a table but again no joy.

Help very appreciated.

:DB hangs in GVim when attempting to open interactive console

Per README, if only connection URL is provided and SQL string / file is omitted, it should spawn an interactive console. However, when executed in GVim, the Vim just locks up.

I have tpope/vim-dispatch installed and running...

Start postgresql://...

... does open psql in interactive mode (albeit) within the Ex bar.

With a little experimentation, I found that taking off the silent at https://github.com/tpope/vim-dadbod/blob/master/autoload/db.vim#L206

silent execute 'Start' escape(cmd, '%#')

... does the trick.

Execute query under cursor

I was making a lot of use of vim-dadbod in recent weeks. One thing that I was missing was the ability to run the query under the cursor. I ended up creating a query text object to help me do just that. It is implemented like this:

" sql query text object
vnoremap aq <esc>:call search(";", "cWz")<cr>:call search(";\\<bar>\\%^", "bsWz")<cr>:call search("\\v\\c^(select<bar>with<bar>insert<bar>update<bar>delete<bar>create)\>", "Wz")<cr>vg`'
omap aq :normal vaq<cr>

It searches backward for the last ; character or the beginning of the file and then from there forward for the next SQL keyword (I'm sure the list there might be refined, this worked for me though). It switches to visual mode and searches for the next ; character.

Then I mapped <C-Q> to execute the query using b:db as the database url:

" setup b:db and run queries with it
nmap <expr> <c-q> exists("b:db") ? 'vaq:DB b:db<cr>' : ':DB b:db = g:db_'
vmap <expr> <c-q> exists("b:db") ? ':DB b:db<cr>' : '<esc>:DB b:db = g:db_'

The conditional expression checks first whether b:db is set. It starts a command line expression to set it based on a g:db_* variable if it's not. We could throw an error instead here.

Would it make sense to add this to dadbod?

SQL Server encryption options

Hi Tim! 👋

I need to enable connection encryption when connecting to a SQL Server database which will involve passing some extra flags to sqlcmd. Before I get too far into this I'm wondering, is this something you'd want to support in dadbod by parsing the connection string for relevant options (encrypt=true, etc), or should I just write my own custom adapter? Either way is fine with me, but if it's something you'd want to have in dadbod itself then I could put more effort into it than just hardcoding the options. 😄

Thank you for all the plugins!

Infinite loop while resolving URL if it contains an octothorp

If the URL contains an octothorp (#), the plugin throws DB: infinite loop resolving URL. To recreate:

:DB postgres://user:pas#word@db/mydb

I've tried various ways of quoting/escaping the octothorp, to no avail. Surely I'm missing something because I'd assume they're common in passwords?

Any help would be appreciated.

Big fan of your work, by the way; thanks for so many awesome plugins.

write your own adapter

Could you give a few pointers on how to write the database adapter?

Should I just write a file which goes in the adapters folder or is there some more adjustments needed?

I would like to have one for Big Query.

Put the SQL query in the result buffer

I think it would be convinient to put the executed query in the result window that helps the remember what was queried for in case when navigating between buffers with results still open.

E492: Not an editor command: Startmysql

Erro while trying to connect with my MySql db.

:DB mysql://root@localhost/[dbname] gives me the prompt for the password and then fails.
This line Error detected while processing function db#execute_command: and the this line E492: Not an editor command: Startmysql -h 'localhost' -u 'root' -p'password' 'database'.

I'm dumb or this is a bug?

Unable to execute statements

Whenever I try to execute a sql statement (with :{range}DB [url] or :DB [url] {cmd}), I get:

Error detected while processing function db#execute_command:
line   66:
E484: Can't open file /tmp/vMjw0en/5.dbout

The mentioned file does not exist, only a $i.sql (where $i is the number of the missing file) with the statement to be executed.

Just running :DB g:bar = mysql:me@myhost seems to work fine (using the variable later on doesn't).
Connection with the mysql client works fine, executing the statements there as well.

edit: same is happening for PostgreSQL
edit2: also happening inside "clean" ubuntu:artful Docker container with only vim, git, postgresql-client and the plugin installed
edit3: forgot to mention, statement for testing was :DB mysql://user:[email protected]/db-name select count(*) from some-table

postgres table completion hangs (vim, win10)

vim 8.2.444, postgres 10.12, win10

When I issue a command:

 DB postgres://postgres:@localhost:5432/postgres <tab>

I get cmd window opened that does nothing:

C:\WINDOWS\system32\cmd.exe /c (^(psql -w -P columns=146 -v ON_ERROR_STOP=1 -f - ^"postgresql://postgres^@localhost:5432/postgres^" --no-psqlrc -tA -c ^"\dtvm^"^) ^>C:\Users\maksim.kim\AppData\Local\Temp\VIoFE4B.tmp 2^>^&1)

PS on neovim it shows 3 dots and nothing happens then.

PPS regular queries works:

 DB postgres://postgres:@localhost:5432/postgres select * from test

returns select data.

Pass buffer/selection through other command first?

This is more a question than an issue: I wonder whether it would be possible to pass the buffer/selection to be send to the DB via an additional filter or extending command. For example, if I have

SELECT COUNT(*)
FROM foo;

and execute this in e.g. PostgreSQL, then it would be very efficient to get the EXPLAIN or EXPLAIN ANALYZE output by e.g.

%DB | echo "EXPLAIN ANALYZE" | postgresql://postgres@localhost/mydb

Or a similar sequence.

My assumption: this already works out of the box and I am just not googling for the right thing. Happy about any help.

sqlcmd hangs vim on windows7

Environment
Vim8 on Windows7

Issue
When calling DB to connect to an sqlserver database, a spawned command window stays open and vim hangs until the window is closed. (names below are redacted for security)

:DB g:sandbox = sqlserver://username:password@server

Notes
This behavior does not happen when using osql in place of sqlcmd. In that case, there is no spawned command window left hanging open, and dadbod works as expected.

Desired Outcome
I would like to be able to use sqlcmd rather than osql because sqlcmd has the -W option that will trim trailing whitespace from the query results. Without trimmed trailing whitespace, for the db's I am working with, the fields are returned absurdly long, making the output nearly unreadable.

What I've Tried

  • Skimming the dadbod code for clues about how input/output are handled. Unfortunately, my combined vimscript and windows command line skills are too weak given the time I have for debugging.
  • Swapping out sqlcmd for osql. The results of that are included in the write-up above.

One line outputs of successful commands do not appear in preview window

Simple commands that run successfully and return one line of output do not show up in the preview window (*.dbout). If they return more than one line or error out in some way, they appear in the preview window.

I think it's a better user experience if all output goes to the preview file.

To reproduce, commands like drop table foo; can be run. Note that running two drop commands together results in this printed in the preview window:

DROP TABLE
DROP TABLE

Sqlcmd error when connecting to sqlserver database

Dear Tpope,

I have been trying to use Dadbod to connect to the sql server, I could connect to it by using DBext without issues, but when I tried to use dadbod with the following parameters
dadbod
It just gives me the following errors:
sqlcmd error
I have been researching for quite a while, I just couldn't work out why. The researching told me that it's something to do with the quotes or passing the connection string issue. Can you please advise?
I have also tried to integrate it with vim-dadbod-ui by having this line in my init.vim (using neovim).
dadbod-ui
When I tried to open the database in the UI, it gives me the same error from dadbod-ui:
dadbod-ui-error

Regards
Gernacke

Reuse connection

Is there a way to get the mongo driver adapter to reuse the mongo connection rather than establishing a new connection each time?

SQL Server adapter

This was really easy to stitch together. Only problem is I don't have a way to test it:

if exists('g:autoloaded_db_adapter_sqlserver')
  finish
endif
let g:autoloaded_db_adapter_sqlserver = 1

function! db#adapter#sqlserver#canonicalize(url) abort
  let url = a:url
  if url =~# ';.*=' && url !~# '?'
    let url = tr(substitute(substitute(url, ';', '?', ''), ';$', '', ''), ';', '&')
  endif
  return db#url#absorb_params(url, {
        \ 'user': 'user',
        \ 'userName': 'user',
        \ 'password': 'password',
        \ 'server': 'host',
        \ 'serverName': 'host',
        \ 'port': 'port',
        \ 'portNumber': 'port',
        \ 'database': 'database',
        \ 'databaseName': 'database'})
endfunction

function! db#adapter#sqlserver#interactive(url) abort
  return 'sqlcmd' . db#url#as_args(a:url, '-S ', '', '', '-U ', '-P ', '-d ')
endfunction

Can't get vim-dadbod to work with vim-dotenv

I must be doing something horribly wrong. I have a file in the root of my repo called .envwith a single line in it:

DATABASE_URL='mysql://db_user:[email protected]/some_db'

I'm opening vim in that folder, and executing :Dotenv shows this env var. However, executing a bare :DB select 1 results in "DB: no URL" and executing:DB $DATABASE_URL select 1 results in "DB: no adapter for file /path/to/current/dir/$DATABASE_URL".

Am I doing this dumb or is it a bug?

PHPDBO DSN support

I rigged up PHPDBO DSN support early on, thinking it might a good test candidate for interop, but I'm unconvinced it has much value. Putting it here in case anyone want to make an argument for it.

It's similar to Perl's DBI among other things, so maybe it could/should be generalized a bit and made into a general DSN parser. Does the lack of usernames/passwords in DSNs render them mostly useless?

if exists('g:autoloaded_db_adapter_phpdbo')
  finish
endif
let g:autoloaded_db_adapter_phpdbo = 1

let s:adapters = {
      \ 'pgsql': 'postgresql',
      \ }

function! db#adapter#phpdbo#canonicalize(url)
  let url = substitute(a:url, '^phpdbo:', '', '')
  let url = tr(substitute(url, ':', ':///?', ''), ';', '&')
  let url = substitute(url, '^[^:]\+', '\=get(s:adapters, submatch(0), submatch(0))', '')
  return db#url#absorb_params(url, {'dbname': 'database', 'host': 'host', 'port': 'port'})
endfunction

Default database connection

How can i change default database? like dbext?
it is very hard.

DB g:test SELECT * FROM users

Can i this like?

DB SELECT * FROM users

preview window wrapping when using autocmd to execute '%DB'

I have this strange bug that i can't figure out.

I set up an autocmd for my *.sql files to automatically execute when i write them:

autocmd BufWritePost *.sql exe '%DB'

When i write a file, preview .dbout has set wrap set.
When i execute :%DB manually, it is properly set to nowrap.

This doesn't happen when i set nowrap globally, but i'm not setting it at all, and it defaults to wrap. in that case.

Do you have an idea what can be the issue? Thanks!

Add mapping for tabbing through cells

First off thanks for this plugin I never thought the query tool of my dreams would be in vim! I was wondering how you would feel about adding a mapping in the preview window to tab back and forth between cells. The use case for me is that I am working in a new database where I am not yet familiar with the column names so I don't know what to search for yet.

So far I have just done a lot of f | and F| to jump between the cells but I can't help how nice it would be to have maybe tab to move forward and delete to move backward?

Background execution

Is there a chance to get some asynchronous background execution? I am using this with a database that takes quite long to answer on requests, so this disrupts me quite a lot at the moment.
Maybe I should just use an additional terminal window for this, but I think it would be an awesome addition, no?
Thanks in any case for this plugin.

Character encoding issues

Using with mongodb im getting some strange character encodings
{
�[37m"_id"�[m: �[32m"dd9a1b50-2198-11e8-a52e-611cb81aa9fd"�[m,
�[37m"email"�[m: �[32m"[email protected]"�[m,
�[37m"notifications"�[m: �[31m1�[m,
�[37m"type"�[m: �[32m"student"�[m,
�[37m"firstName"�[m: �[32m"POSTMAN"�[m,
�[37m"lastName"�[m: �[32m"TEST"�[m,
}

Ensure arguments which enable non-wrapping multi-line output are passed when calling database CLIs

Wrapped output on a terminal screen is very hard to comprehend when querying most realistic production databases, where single fields that can be 200+ characters long. This is really poor UX and makes it really hard to figure out if code that I've written to interact with databases is actually doing the right thing.

I'd be very surprised if database CLI designers haven't thought of this. Where possible, I'd like to see if there are command line options which can be enabled when starting up an interactive shell into the database, and see if these options can be automatically turned on by default through dadbod when they are available.

Thanks for all your hard work, Tim!

Completion error when passing range to the `:DB`

Buffer content:

select count(*) from patients;

Command:

:%DB post<tab>

Error:

I get this message:

|| Loading plugins
|| Loaded plugins
|| Error detected while processing function
/Users/hauleth/.local/share/nvim/pack/minpac/start/vim-dadbod/autoload/db.vim|344| db#command_complete[9]
/Users/hauleth/.local/share/nvim/pack/minpac/start/vim-dadbod/autoload/db.vim|129| db#connect[6]
/Users/hauleth/.local/share/nvim/pack/minpac/start/vim-dadbod/autoload/db/adapter.vim|47| db#adapter#call[1]
/Users/hauleth/.local/share/nvim/pack/minpac/start/vim-dadbod/autoload/db/adapter.vim|34| <SNR>111_fnname[1]
/Users/hauleth/.local/share/nvim/pack/minpac/start/vim-dadbod/autoload/db/adapter.vim|15| <SNR>111_prefix[4]
|| E605: Exception not caught: DB: no URL
|| Error detected while processing function
/Users/hauleth/.local/share/nvim/pack/minpac/start/vim-dadbod/autoload/db.vim|344| db#command_complete[9]
|| E171: Missing :endif

Environment:

This happens in both Vim 8:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 29 2017 18:37:46)
Included patches: 1-503, 505-680, 682-1283
Compiled by [email protected]
Normal version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    -mouse_sgr       +tag_old_static
-arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           -mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     -termguicolors
-browse          -footer          +multi_byte      -terminal
+builtin_terms   +fork()          +multi_lang      +terminfo
+byte_offset     -gettext         -mzscheme        +termresponse
+channel         -hangul_input    +netbeans_intg   +textobjects
+cindent         +iconv           +num64           +timers
-clientserver    +insert_expand   +packages        +title
-clipboard       +job             +path_extra      -toolbar
+cmdline_compl   +jumplist        -perl            +user_commands
+cmdline_hist    -keymap          +persistent_undo +vertsplit
+cmdline_info    +lambda          +postscript      +virtualedit
+comments        -langmap         +printer         +visual
-conceal         +libcall         -profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             -rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
-emacs_tags      -mouseshape      +startuptime     -xpm
+eval            -mouse_dec       +statusline      -xsmp
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_clipboard
+extra_search    -mouse_jsbterm   +syntax          -xterm_save
-farsi           -mouse_netterm   +tag_binary      
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa           

And NeoVim:

NVIM v0.3.1
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20180721-48604-1emkq4l/neovim-0.3.1/build/config -I/tmp/neovim-20180721-48604-1emkq4l/neovim-0.3.1/src -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180721-48604-1emkq4l/neovim-0.3.1/build/src/nvim/auto -I/tmp/neovim-20180721-48604-1emkq4l/neovim-0.3.1/build/include
Skompilowany przez [email protected]

Features: +acl +iconv +jemalloc +tui 
See ":help feature-compile"

       vimrc systemu: "$VIM/sysinit.vim"
   odwet dla $VIM-a: "/usr/local/Cellar/neovim/0.3.1/share/nvim"

Run :checkhealth for more info

I have defined :Start as this if this could be a problem:

command! -nargs=* Start <mods> split term://<args> <bar> startinsert

Connection over ssh

Sometimes databases are available only via a ssh server and then can be accessed with host specified as localhost.
I would like do ask if it is possible to access such database with this plugin.

BTW, Great plugin, so are many others from your foundry!

window redraw breaks in original split

When I have a document open (ie Gemfile) and I do a :DB command (:DB select * from users;) a new split window is created with the results. The original window is blanked out (no text is visible). When I jump back to the original window the line under the cursor will appear. Moving up or down in the file causes each line to reappear as the cursor gets there. If I close the DB split, the whole original window is redrawn correctly.

Save login information inside of secure store

On macOS this could be keychain I guess. There are also options for Linux.

That's basically why I don't use dbext and created my own plugin that just pastes queries from vim buffer into specified tmux window in which command line database client is opened.

Unable to connect to MongoDB that requires authentication and SSL

Executing the following

:DB mongodb://[email protected]:9011/mydb

results in the error

2018-03-15T11:03:38.728-0400 I NETWORK  [thread1] Socket recv() Connection reset by peer 1.2.3.4:9011
2018-03-15T11:03:38.728-0400 I NETWORK  [thread1] SocketException: remote: (NONE):0 error: 9001 socket exception [RECV_ERROR] server [1.2.3.4:9011] 
2018-03-15T11:03:38.728-0400 E QUERY    [thread1] Error: network error while attempting to run command 'isMaster' on host 'mymongo.com:9011'  :
connect@src/mongo/shell/mongo.js:240:13
@(connect):1:21
exception: connect failed
Press ENTER or type command to continue

Looking further with this shows the exact command being run:

:echo db#adapter#dispatch("mongodb://[email protected]:9011/mydb", "interactive")
mongo --host 'mymongo.com' --port '9011' -u 'user' 'mydb'

which does not work in another terminal.

The expected command and flags that do work are:

mongo --host 'mymongo.com' --port '9011' -u 'user' 'mydb' -p --ssl

What would be the best way to add these flags? Is there a function in the mongo adapter where I can append this or customize it?

I'm using mongodb shell v3.4.13, NVIM v0.2.3-455-gbc17ad3, and vim-db (when it was named that) as of commit hash 7e57e5a.

Preview window with query result is modifiable (Windows)

Environment:

Windows 10, vim 8.0, latest vim-dadbod

Preview window with query results is not read-only, I can modify the buffer contents, the data is not wrapped, I can list the buffer using 'ls' - it looks like s:init() function never gets executed.
Tested it with postgres and sqlite3 adapters (I don't think it's specific to any adapter though).

The same vim-dadbod behaves as expected on FreeBSD 10 with vim 8.0, so it looks like a Windows-specific issue.

Bang Version in Documentation and op_exec

Is the bang version of the command intended to be private?

I noticed that the option exists in the code, but there is no documentation. I would be happy to add it if wanted.

Relatedly, could a bang version of op_exec exist for mappings?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.