Skip to content

Commit 87caf9e

Browse files
bagyi0vim-scripts
authored andcommitted
Version 3.00
New Features ------------ - dbext supports a history of previous commands. The DBHistory command will display a numbered list of previous SQL statements. Pressing <enter> or double clicking on one of the items will execute the statement. The number of items in the list is configurable via your vimrc. The history items are stored in a file, dbext_sql_history.txt. The location of the file can also be controlled. - The 'refresh' feature added in version 2.30 has been updated to take advantage of the history feature. - The PHP parser has improved and can handle single or double quoted strings, string concatenation and host variables. It will correctly strip the quotes, join the concatenated strings and prompt the user for host variables before executing the SQL statement. - Updated documentation for Vim 7 SQL code completion. - Table, procedure and view dictionaries include the owner name of the object. This is on by default, but can be controlled via a new global option, dbext_default_dict_show_owner. This has not been enabled for all databases it depends on whether the database supports this feature. The autoload\sqlcomplete.vim plugin takes advantage of this feature. - Added support for stored procedures / functions in MySQL 5. Bug Fixes ------------ - Updated the PHP parser to work with a more varied string quotes and string concatenation. - The "extra" feature did not add a leading space for MySQL. Using the tabbed output required updates to the parsing of the output generated by MySQL. - Miscellaneous documentation updates.
1 parent 486e04a commit 87caf9e

File tree

2 files changed

+739
-159
lines changed

2 files changed

+739
-159
lines changed

doc/dbext.txt

Lines changed: 157 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*dbext.txt* For Vim version 6.0. Last change: Fri Sep 09 2005 2:11:11 PM
1+
*dbext.txt* For Vim version 6.0. Last change: Mon Apr 24 2006 9:53:37 PM
22

33

44
VIM REFERENCE MANUAL
@@ -7,14 +7,14 @@
77
David Fishburn <[email protected]>
88

99
Database extension plugin (dbext.vim) manual
10-
dbext.vim version 2.30
10+
dbext.vim version 3.00
1111

1212
For instructions on installing this file, type
1313
:help add-local-help
1414
|add-local-help| inside Vim.
1515

1616
Homepage: http://vim.sourceforge.net/script.php?script_id=356
17-
SourceForge: $Revision: 1.21 $
17+
SourceForge: $Revision: 1.23 $
1818

1919
*dbext* *dbext.vim* *db_ext* *db_ext.vim* *database-extension* *pgsql* *mysql*
2020
*asa* *ase* *ingres* *interbase* *sqlite* *sqlsrv* *ora* *db2*
@@ -37,18 +37,56 @@ SourceForge: $Revision: 1.21 $
3737
8. Creating mappings using dbext commands |dbext-in-mappings|
3838
9. Object Completion |dbext-completion|
3939
10. Listing Objects in the Database |dbext-list-objects|
40-
11. Intellisense integration |dbext-intellisense|
40+
11. Plugin integration |dbext-integration|
41+
11.1 OMNI completion integration |dbext-omni-completion|
42+
11.2 Intellisense integration |dbext-intellisense|
4143
12. Filetype support |dbext-filetypes|
4244
12.1 Using filetype support |dbext-filetypes-using|
4345
12.2 Adding new filetypes |dbext-filetypes-adding|
44-
13. Open Source |dbext-sourceforge|
45-
14. Tutorial |dbext-tutorial|
46+
13. Using SQL History |dbext-history|
47+
14. Open Source |dbext-sourceforge|
48+
15. Tutorial |dbext-tutorial|
4649

4750
{Vi does not have any of this}
4851

4952
------------------------------------------------------------------------------
5053
What's New *dbext-new*
5154

55+
Version 3.00
56+
57+
New Features
58+
------------
59+
- dbext supports a history of previous commands. The DBHistory
60+
command will display a numbered list of previous SQL statements.
61+
Pressing <enter> or double clicking on one of the items will
62+
execute the statement. The number of items in the list is
63+
configurable via your vimrc. The history items are stored in a
64+
file, dbext_sql_history.txt. The location of the file can also
65+
be controlled.
66+
- The 'refresh' feature added in version 2.30 has been updated to take
67+
advantage of the history feature.
68+
- The PHP parser has improved and can handle single or double quoted
69+
strings, string concatenation and host variables. It will correctly
70+
strip the quotes, join the concatenated strings and prompt the user
71+
for host variables before executing the SQL statement.
72+
- Updated documentation for Vim 7 SQL code completion.
73+
- Table, procedure and view dictionaries include the owner name of the
74+
object. This is on by default, but can be controlled via a new global
75+
option, dbext_default_dict_show_owner. This has not been enabled for all
76+
databases it depends on whether the database supports this feature. The
77+
autoload\sqlcomplete.vim plugin takes advantage of this feature.
78+
- Added support for stored procedures / functions in MySQL 5.
79+
80+
Bug Fixes
81+
------------
82+
- Updated the PHP parser to work with a more varied string quotes and
83+
string concatenation.
84+
- The "extra" feature did not add a leading space for MySQL. Using the
85+
tabbed output required updates to the parsing of the output generated
86+
by MySQL.
87+
- Miscellaneous documentation updates.
88+
89+
5290
Version 2.30
5391

5492
New Features
@@ -349,6 +387,40 @@ Version 2.00
349387
option to 0 (off) will leave the temporary file in the
350388
$TEMP directory for viewing. >
351389
:DBSetOption delete_temp_file=0
390+
dbext_default_history_file
391+
< - The SQL history is stored within a file. This was done for
392+
a couple of reasons:
393+
1. No upper bound on the size of the history.
394+
2. If you have multiple instances of Vim running, each
395+
will see the current history without overwriting
396+
each other (thereby loosing history).
397+
3. The history can easily be removed if necessary.
398+
Each SQL statement has it's newline characters replaced with
399+
@@@ so the statement fits on one line. The default history
400+
file varies by the OS:
401+
Unix: $HOME/dbext_sql_history.txt
402+
Windows: $VIM/dbext_sql_history.txt
403+
If you wish to override the file location you can via your
404+
|vimrc|. To see the current setting run :DBGetOption. >
405+
:let g:dbext_default_history_file = '/your/loc/file.txt'
406+
:let g:dbext_default_history_file = 'c:\your\loc\file.txt'
407+
dbext_default_history_size
408+
< - Controls how many SQL statements should be stored within the
409+
history. The default value is 50. This option must be
410+
set within your |vimrc|. To see the current setting run
411+
:DBGetOption. >
412+
:let g:dbext_default_history_size = 50
413+
dbext_default_history_max_entry
414+
< - You can limit the size of the entries dbext records in the
415+
history file. The current default is 4K. Statements longer
416+
than 4K are not stored within the history file. Setting this
417+
value to 0, removes any limits on the size of a single entry. >
418+
:let g:dbext_default_history_max_entry = 4096
419+
dbext_default_dict_show_owner
420+
< - When creating a dictionary of tables, procedures and views
421+
the owner name can also be included. The default is enabled,
422+
to disable add the following to your vimrc: >
423+
:let g:dbext_default_dict_show_owner = 0
352424
<
353425
Buffer variables
354426
You can check all options for the buffer without specifying an option name
@@ -404,6 +476,9 @@ Version 2.00
404476
additional items to the tools command line. For example,
405477
using ASA, I could run: >
406478
DBSetOption extra=CON=myconn
479+
<
480+
From within a profile (set within your vimrc): >
481+
let g:dbext_default_profile_mysql = 'type=MYSQL:user=root:passwd=:dbname=mysql:extra=-t'
407482
<
408483
This has the net result of creating the following command line: >
409484
dbisql -c "UID=dba;PWD=sql;CON=myconn"
@@ -624,6 +699,12 @@ Version 2.00
624699
nnoremap <unique> <Leader>slc <Plug>DBListColumn
625700
:DBListColumn
626701

702+
" Opens the result window and displays a numbered list of
703+
" previous SQL statements. Pressing <enter> or double clicking
704+
" on a SQL statement will execute the SQL.
705+
" sql - history
706+
nnoremap <unique> <Leader>sh :DBHistory
707+
627708
" Prompt for connection information
628709
" [Optional] Profile
629710
" [Required] Database type - MySQL, ASA, Ingress, Oracle (see above)
@@ -962,8 +1043,8 @@ To specify the type of database you connect to most often, you can place the
9621043
DBCompleteProcedures!
9631044
DBCompleteViews!
9641045
<
965-
The Intellisense plugin uses this feature of dbext to populate it's popup
966-
windows, see |dbext-intellisense|.
1046+
For complete code completion added via various plugins see
1047+
|dbext-integration|.
9671048

9681049
------------------------------------------------------------------------------
9691050
10. Listing Ojects in the Database *dbext-list-objects*
@@ -996,19 +1077,32 @@ To specify the type of database you connect to most often, you can place the
9961077
If no table name is supplied, the current word is chosen as the table name.
9971078

9981079
------------------------------------------------------------------------------
999-
11. Intellisense integration *dbext-intellisense*
1080+
11. Plugin integration *dbext-integration*
10001081

1001-
Intellisense.vim (http://www.vim.org/scripts/script.php?script_id=747) is a
1002-
plugin that provides a popup window that allows the user to choose from a
1003-
list of values. The SQL intellisense plugin provides drop down windows for
1004-
various static elements (statements, functions, types, keywords, ...).
1005-
1006-
Intellisense can also provide dynamic lists for tables, procedures and views.
1007-
It does this by calling dbext's DBComplete[ Table | Procedure | View ]
1008-
commands, see |dbext-completion|.
1082+
SQL code completion has an interface component which provides a popup window
1083+
that allows the user to choose from a list of values. The values include
1084+
various static elements (statements, functions, types, keywords, ...). But
1085+
they can also provide dynamic lists for tables, procedures, views and even
1086+
column lists for tables.
10091087

1010-
dbext provides the database interface to the intellisense plugin. To enable
1011-
the dynamic lists via Intellisense, you must install the dbext plugin.
1088+
If you want the code completion to work with dynamic lists, you must ensure
1089+
each buffer can connect to the required database. You can do this easily by
1090+
creating a profile (|dbext-connect-profiles|), and making it the default
1091+
profile (dbext_default_profile). If you start editing a new file, dbext will
1092+
automatically connect using the specified default profile.
1093+
1094+
11.1 OMNI completion integration *dbext-omni-completion*
1095+
1096+
Vim 7 has natively included features provide an interface which allows plugin
1097+
developers to provide code completion. The SQL completion plugin is included
1098+
with Vim 7. It will detect if dbext.vim is already installed and take
1099+
advantage of it.
1100+
1101+
11.2 Intellisense integration *dbext-intellisense*
1102+
1103+
Intellisense.vim (http://www.vim.org/scripts/script.php?script_id=747) is a
1104+
windows only solution. It has support for a number of different languages
1105+
and provides a popup window which can be dynamically populated.
10121106

10131107
The first version of Intellisense to have the SQL plugin is 1.24.
10141108

@@ -1094,13 +1188,46 @@ To specify the type of database you connect to most often, you can place the
10941188
David Fishburn -and- Peter Bagyinszki for inclusion into future versions.
10951189

10961190
------------------------------------------------------------------------------
1097-
13. Open Source *dbext-sourceforge*
1191+
13. Using SQL History *dbext-history*
1192+
1193+
As of version 3.0, dbext maintains a history file which is shared between
1194+
multiple instances of Vim. A statement added in one instance of Vim
1195+
will be immediately available in a different instance of Vim on the
1196+
same computer.
1197+
1198+
To access the history you can run the command, :DBHistory, or use the
1199+
mapping <Leader>sh (\sh using Vim defaults). This opens a window similar
1200+
to the result window. This buffer is readonly, but has several buffer
1201+
specific maps to allow you to interact with it.
1202+
1203+
To re-run a statement you can either press <enter> on the line, or if you
1204+
prefer the mouse you can double click on the statement. When a statement
1205+
is chosen you are switched back to the buffer which opened the history
1206+
window. The statement is executed using that buffers connection
1207+
parameters.
1208+
1209+
To remove statements from the history you can press "dd" as you would
1210+
delete a line in a regular Vim buffer.
1211+
1212+
The history buffer is automatically saved each time it is changed.
1213+
1214+
The default file location for the history file is stored in your $HOME
1215+
directory for Unix and in the $VIM directory for Windows. It can be
1216+
configured via the g:dbext_default_history_file variable. The number
1217+
of statements stored within the history can be configured via the
1218+
g:dbext_default_history_size variable. By default statements < 4K
1219+
are stored in the history this can be configured via the
1220+
g:dbext_default_history_max_entry variable. See |dbext-configure-variables|
1221+
for more details.
1222+
1223+
------------------------------------------------------------------------------
1224+
14. Open Source *dbext-sourceforge*
10981225

10991226
dbext is now an open source project found at: >
11001227
https://sourceforge.net/projects/dbext/
11011228
<
11021229
------------------------------------------------------------------------------
1103-
14. Tutorial *dbext-tutorial*
1230+
15. Tutorial *dbext-tutorial*
11041231

11051232
This tutorial is designed to take you through the common features of dbext
11061233
so that:
@@ -1621,6 +1748,15 @@ To specify the type of database you connect to most often, you can place the
16211748

16221749

16231750

1751+
History
1752+
-------
1753+
History is a new feature of dbext 3.0. Previous statements are
1754+
automatically recorded into a history file. To view these statements
1755+
run :DBHistory or <Leader>sh. Pressing <enter> or double clicking will
1756+
re-run the statement. See |dbext-history| for more details.
1757+
1758+
1759+
16241760
Summary
16251761
-------
16261762
Please read through the documentation, the tutorial does a simple job

0 commit comments

Comments
 (0)