Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions autoload/db/adapter/mysql.vim
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ endfunction
function! db#adapter#mysql#tables(url) abort
return db#systemlist(s:command_for_url(a:url) + ['-e', 'show tables'])[1:-1]
endfunction

function! db#adapter#mysql#procedures(url) abort
" return db#systemlist(s:command_for_url(a:url) + ['-e', 'SHOW PROCEDURE STATUS'])[1:-1]
return db#systemlist(s:command_for_url(a:url) + ['-N', '-e', 'select concat(db, ''.'', name) name from mysql.proc where db=database() and type=''PROCEDURE'''])[1:-1]
endfunction

function! db#adapter#mysql#functions(url) abort
" return db#systemlist(s:command_for_url(a:url) + ['-e', 'SHOW FUNCTION STATUS'])[1:-1]
return db#systemlist(s:command_for_url(a:url) + ['-N', '-e', 'select concat(db, ''.'', name) name from mysql.proc where db=database() and type=''FUNCTION'''])[1:-1]
endfunction
10 changes: 10 additions & 0 deletions autoload/db/adapter/postgresql.vim
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ function! db#adapter#postgresql#tables(url) abort
return s:parse_columns(db#systemlist(
\ db#adapter#postgresql#filter(a:url) + ['--no-psqlrc', '-tA', '-c', '\dtvm']), 1)
endfunction

function! db#adapter#postgresql#procedures(url) abort
return s:parse_columns(db#systemlist(
\ db#adapter#postgresql#filter(a:url) + ['--no-psqlrc', '-tA', '-c', '\dfp']), 1)
endfunction

function! db#adapter#postgresql#functions(url) abort
return s:parse_columns(db#systemlist(
\ db#adapter#postgresql#filter(a:url) + ['--no-psqlrc', '-tA', '-c', '\dfn']), 1)
endfunction