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
2
2
3
3
4
4
VIM REFERENCE MANUAL
7
7
David Fishburn <
[email protected] >
8
8
9
9
Database extension plugin (dbext.vim) manual
10
- dbext.vim version 2.30
10
+ dbext.vim version 3.00
11
11
12
12
For instructions on installing this file, type
13
13
:help add-local-help
14
14
| add-local-help | inside Vim.
15
15
16
16
Homepage: http://vim.sourceforge.net/script.php?script_id=356
17
- SourceForge: $Revision: 1.21 $
17
+ SourceForge: $Revision: 1.23 $
18
18
19
19
*dbext* *dbext.vim* *db_ext* *db_ext.vim* *database-extension* *pgsql* *mysql*
20
20
*asa* *ase* *ingres* *interbase* *sqlite* *sqlsrv* *ora* *db2*
@@ -37,18 +37,56 @@ SourceForge: $Revision: 1.21 $
37
37
8. Creating mappings using dbext commands | dbext-in-mappings |
38
38
9. Object Completion | dbext-completion |
39
39
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 |
41
43
12. Filetype support | dbext-filetypes |
42
44
12.1 Using filetype support | dbext-filetypes-using |
43
45
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 |
46
49
47
50
{Vi does not have any of this}
48
51
49
52
------------------------------------------------------------------------------
50
53
What's New *dbext-new*
51
54
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
+
52
90
Version 2.30
53
91
54
92
New Features
@@ -349,6 +387,40 @@ Version 2.00
349
387
option to 0 (off) will leave the temporary file in the
350
388
$TEMP directory for viewing. >
351
389
: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
352
424
<
353
425
Buffer variables
354
426
You can check all options for the buffer without specifying an option name
@@ -404,6 +476,9 @@ Version 2.00
404
476
additional items to the tools command line. For example,
405
477
using ASA, I could run: >
406
478
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'
407
482
<
408
483
This has the net result of creating the following command line: >
409
484
dbisql -c "UID=dba;PWD=sql;CON=myconn"
@@ -624,6 +699,12 @@ Version 2.00
624
699
nnoremap <unique> <Leader> slc <Plug> DBListColumn
625
700
:DBListColumn
626
701
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
+
627
708
" Prompt for connection information
628
709
" [Optional] Profile
629
710
" [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
962
1043
DBCompleteProcedures!
963
1044
DBCompleteViews!
964
1045
<
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 | .
967
1048
968
1049
------------------------------------------------------------------------------
969
1050
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
996
1077
If no table name is supplied, the current word is chosen as the table name.
997
1078
998
1079
------------------------------------------------------------------------------
999
- 11. Intellisense integration *dbext-intellisense *
1080
+ 11. Plugin integration *dbext-integration *
1000
1081
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.
1009
1087
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.
1012
1106
1013
1107
The first version of Intellisense to have the SQL plugin is 1.24.
1014
1108
@@ -1094,13 +1188,46 @@ To specify the type of database you connect to most often, you can place the
1094
1188
David Fishburn -and- Peter Bagyinszki for inclusion into future versions.
1095
1189
1096
1190
------------------------------------------------------------------------------
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*
1098
1225
1099
1226
dbext is now an open source project found at: >
1100
1227
https://sourceforge.net/projects/dbext/
1101
1228
<
1102
1229
------------------------------------------------------------------------------
1103
- 14 . Tutorial *dbext-tutorial*
1230
+ 15 . Tutorial *dbext-tutorial*
1104
1231
1105
1232
This tutorial is designed to take you through the common features of dbext
1106
1233
so that:
@@ -1621,6 +1748,15 @@ To specify the type of database you connect to most often, you can place the
1621
1748
1622
1749
1623
1750
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
+
1624
1760
Summary
1625
1761
-------
1626
1762
Please read through the documentation, the tutorial does a simple job
0 commit comments