1
1
" dbext.vim - Commn Database Utility
2
2
" ---------------------------------------------------------------
3
- " Version: 4.10
3
+ " Version: 4.20
4
4
" Maintainer: David Fishburn <[email protected] >
5
5
" Authors: Peter Bagyinszki <[email protected] >
6
6
" David Fishburn <[email protected] >
7
- " Last Modified: Tue Nov 21 2006 11:46:07 AM
7
+ " Last Modified: Tue Dec 19 2006 10:39:10 PM
8
8
" Based On: sqlplus.vim (author: Jamis Buck)
9
9
" Created: 2002-05-24
10
10
" Homepage: http://vim.sourceforge.net/script.php?script_id=356
@@ -23,7 +23,7 @@ if v:version < 700
23
23
echomsg " dbext: Version 4.00 or higher requires Vim7. Version 3.50 can stil be used with Vim6."
24
24
finish
25
25
endif
26
- let g: loaded_dbext = 410
26
+ let g: loaded_dbext = 420
27
27
28
28
" Script variable defaults, these are used internal and are never displayed
29
29
" to the end user via the DBGetOption command {{{
@@ -112,6 +112,9 @@ function! s:DB_buildLists()
112
112
call add (s: script_params_mv , ' history_max_entry' )
113
113
call add (s: script_params_mv , ' dbext_version' )
114
114
call add (s: script_params_mv , ' inputdialog_cancel_support' )
115
+ call add (s: script_params_mv , ' buffers_with_dict_files' )
116
+ call add (s: script_params_mv , ' use_win32_filenames' )
117
+ call add (s: script_params_mv , ' temp_file' )
115
118
116
119
" DB server specific params
117
120
" See below for 3 additional DB2 items
@@ -184,6 +187,20 @@ function! s:DB_buildLists()
184
187
let loop_count += 1
185
188
endfor
186
189
190
+ " Check if we are using Cygwin, if so, let the user override
191
+ " the temporary filename to use backslashes
192
+ if has (' win32unix' ) && s: DB_get (' use_win32_filenames' ) == 1
193
+ let l: dbext_tempfile = system (' cygpath -w ' .s: dbext_tempfile )
194
+ if v: shell_error
195
+ call s: DB_warningMsg (' dbext:Failed to convert Cygwin path:' .v: errmsg )
196
+ else
197
+ " If executing the Windows path inside a Cygwin shell, you must
198
+ " double up the backslashes
199
+ let s: dbext_tempfile = substitute (l: dbext_tempfile , ' \\' , ' \\\\' , ' g' )
200
+ endif
201
+ " let s:dbext_tempfile = substitute(s:dbext_tempfile, '/', '\', 'g')
202
+ endif
203
+
187
204
endfunction
188
205
" }}}
189
206
@@ -590,6 +607,9 @@ function! s:DB_getDefault(name)
590
607
elseif a: name == # " replace_title" |return (exists (" g:dbext_default_replace_title" )?g: dbext_default_replace_title .' ' :0 )
591
608
elseif a: name == # " use_tbl_alias" |return (exists (" g:dbext_default_use_tbl_alias" )?g: dbext_default_use_tbl_alias .' ' :' a' )
592
609
elseif a: name == # " delete_temp_file" |return (exists (" g:dbext_default_delete_temp_file" )?g: dbext_default_delete_temp_file .' ' :' 1' )
610
+ elseif a: name == # " buffers_with_dict_files" |return s: dbext_buffers_with_dict_files
611
+ elseif a: name == # " temp_file" |return s: dbext_tempfile
612
+ elseif a: name == # " use_win32_filenames" |return (exists (" g:dbext_default_use_win32_filenames" )?g: dbext_default_use_win32_filenames .' ' :' 0' )
593
613
elseif a: name == # " dbext_version" |return (g: loaded_dbext )
594
614
elseif a: name == # " history_file" |return (exists (" g:dbext_default_history_file" )?g: dbext_default_history_file .' ' :(has (' win32' )?$VIM .' /dbext_sql_history.txt' :$HOME .' /dbext_sql_history.txt' ))
595
615
elseif a: name == # " history_bufname" |return (fnamemodify (s: DB_get (' history_file' ), " :t:r" ))
@@ -2897,7 +2917,7 @@ function! s:DB_SQLSRV_getListView(view_prefix)
2897
2917
endfunction
2898
2918
function ! s: DB_SQLSRV_getDictionaryTable () " {{{
2899
2919
let result = s: DB_SQLSRV_execSql (
2900
- \ " select " .(s: DB_get (' dict_show_owner' )== 1 ?" convert(varchar,u.name)|| '.'|| " :' ' ).
2920
+ \ " select " .(s: DB_get (' dict_show_owner' )== 1 ?" convert(varchar,u.name)+ '.'+ " :' ' ).
2901
2921
\ " convert(varchar,o.name) " .
2902
2922
\ " from sysobjects o, sysusers u " .
2903
2923
\ " where o.uid=u.uid " .
@@ -2908,7 +2928,7 @@ function! s:DB_SQLSRV_getDictionaryTable() "{{{
2908
2928
endfunction " }}}
2909
2929
function ! s: DB_SQLSRV_getDictionaryProcedure () " {{{
2910
2930
let result = s: DB_SQLSRV_execSql (
2911
- \ " select " .(s: DB_get (' dict_show_owner' )== 1 ?" convert(varchar,u.name)|| '.'|| " :' ' ).
2931
+ \ " select " .(s: DB_get (' dict_show_owner' )== 1 ?" convert(varchar,u.name)+ '.'+ " :' ' ).
2912
2932
\ " convert(varchar,o.name) " .
2913
2933
\ " from sysobjects o, sysusers u " .
2914
2934
\ " where o.uid=u.uid " .
@@ -2919,7 +2939,7 @@ function! s:DB_SQLSRV_getDictionaryProcedure() "{{{
2919
2939
endfunction " }}}
2920
2940
function ! s: DB_SQLSRV_getDictionaryView () " {{{
2921
2941
let result = s: DB_SQLSRV_execSql (
2922
- \ " select " .(s: DB_get (' dict_show_owner' )== 1 ?" convert(varchar,u.name)|| '.'|| " :' ' ).
2942
+ \ " select " .(s: DB_get (' dict_show_owner' )== 1 ?" convert(varchar,u.name)+ '.'+ " :' ' ).
2923
2943
\ " convert(varchar,o.name) " .
2924
2944
\ " from sysobjects o, sysusers u " .
2925
2945
\ " where o.uid=u.uid " .
@@ -3627,6 +3647,9 @@ endfunction "}}}
3627
3647
function ! s: DB_runCmd (cmd, sql)
3628
3648
let s: dbext_prev_sql = a: sql
3629
3649
3650
+ if has (' win32unix' ) && s: DB_get (' use_win32_filenames' ) == 1
3651
+ endif
3652
+
3630
3653
let l: display_cmd_line = s: DB_get (' display_cmd_line' )
3631
3654
3632
3655
if l: display_cmd_line == 1
0 commit comments