Mercurial > emacs
annotate lisp/progmodes/sql.el @ 110886:001fbc0986c9
Fix previous doc/*/Makefile.in change.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 09 Oct 2010 12:27:22 -0700 |
parents | 03a492f2d1ce |
children | 029e4783cbae |
rev | line source |
---|---|
24050 | 1 ;;; sql.el --- specialized comint.el for SQL interpreters |
2 | |
100908 | 3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
106815 | 4 ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
24050 | 5 |
25381
970b18c6803f
(sql-sybase): use sql-server instead of sql-database.
Alex Schroeder <alex@gnu.org>
parents:
25183
diff
changeset
|
6 ;; Author: Alex Schroeder <alex@gnu.org> |
52482 | 7 ;; Maintainer: Michael Mauger <mmaug@yahoo.com> |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
8 ;; Version: 2.8 |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
9 ;; Keywords: comm languages processes |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
10 ;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el |
24050 | 11 |
12 ;; This file is part of GNU Emacs. | |
13 | |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; GNU Emacs is free software: you can redistribute it and/or modify |
24050 | 15 ;; it under the terms of the GNU General Public License as published by |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
16 ;; the Free Software Foundation, either version 3 of the License, or |
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
17 ;; (at your option) any later version. |
24050 | 18 |
19 ;; GNU Emacs is distributed in the hope that it will be useful, | |
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 ;; GNU General Public License for more details. | |
23 | |
24 ;; You should have received a copy of the GNU General Public License | |
94673
52b7a8c22af5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
24050 | 26 |
27 ;;; Commentary: | |
28 | |
24354
6a438ef0b573
Set version to 1.4.1. Changed mail address to
Richard M. Stallman <rms@gnu.org>
parents:
24353
diff
changeset
|
29 ;; Please send bug reports and bug fixes to the mailing list at |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
30 ;; help-gnu-emacs@gnu.org. If you want to subscribe to the mailing |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
31 ;; list, see the web page at |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
32 ;; http://lists.gnu.org/mailman/listinfo/help-gnu-emacs for |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
33 ;; instructions. I monitor this list actively. If you send an e-mail |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
34 ;; to Alex Schroeder it usually makes it to me when Alex has a chance |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
35 ;; to forward them along (Thanks, Alex). |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
36 |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
37 ;; This file provides a sql-mode and a sql-interactive-mode. The |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
38 ;; original goals were two simple modes providing syntactic |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
39 ;; highlighting. The interactive mode had to provide a command-line |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
40 ;; history; the other mode had to provide "send region/buffer to SQL |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
41 ;; interpreter" functions. "simple" in this context means easy to |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
42 ;; use, easy to maintain and little or no bells and whistles. This |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
43 ;; has changed somewhat as experience with the mode has accumulated. |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
44 |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
45 ;; Support for different flavors of SQL and command interpreters was |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
46 ;; available in early versions of sql.el. This support has been |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
47 ;; extended and formalized in later versions. Part of the impetus for |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
48 ;; the improved support of SQL flavors was borne out of the current |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
49 ;; maintainer's consulting experience. In the past fifteen years, I |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
50 ;; have used Oracle, Sybase, Informix, MySQL, Postgres, and SQLServer. |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
51 ;; On some assignments, I have used two or more of these concurrently. |
24050 | 52 |
53 ;; If anybody feels like extending this sql mode, take a look at the | |
54 ;; above mentioned modes and write a sqlx-mode on top of this one. If | |
55 ;; this proves to be difficult, please suggest changes that will | |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
56 ;; facilitate your plans. Facilities have been provided to add |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
57 ;; products and product-specific configuration. |
24050 | 58 |
59 ;; sql-interactive-mode is used to interact with a SQL interpreter | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
60 ;; process in a SQLi buffer (usually called `*SQL*'). The SQLi buffer |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
61 ;; is created by calling a SQL interpreter-specific entry function or |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
62 ;; sql-product-interactive. Do *not* call sql-interactive-mode by |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
63 ;; itself. |
24050 | 64 |
65 ;; The list of currently supported interpreters and the corresponding | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
66 ;; entry function used to create the SQLi buffers is shown with |
24050 | 67 ;; `sql-help' (M-x sql-help). |
68 | |
69 ;; Since sql-interactive-mode is built on top of the general | |
70 ;; command-interpreter-in-a-buffer mode (comint mode), it shares a | |
71 ;; common base functionality, and a common set of bindings, with all | |
72 ;; modes derived from comint mode. This makes these modes easier to | |
73 ;; use. | |
74 | |
31392
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
75 ;; sql-mode can be used to keep editing SQL statements. The SQL |
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
76 ;; statements can be sent to the SQL process in the SQLi buffer. |
24050 | 77 |
78 ;; For documentation on the functionality provided by comint mode, and | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
79 ;; the hooks available for customizing it, see the file `comint.el'. |
24050 | 80 |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
81 ;; Hint for newbies: take a look at `dabbrev-expand', `abbrev-mode', and |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
82 ;; `imenu-add-menubar-index'. |
24050 | 83 |
84 ;;; Requirements for Emacs 19.34: | |
85 | |
86 ;; If you are using Emacs 19.34, you will have to get and install | |
87 ;; the file regexp-opt.el | |
88 ;; <URL:ftp://ftp.ifi.uio.no/pub/emacs/emacs-20.3/lisp/emacs-lisp/regexp-opt.el> | |
89 ;; and the custom package | |
90 ;; <URL:http://www.dina.kvl.dk/~abraham/custom/>. | |
91 | |
92 ;;; Bugs: | |
93 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
94 ;; sql-ms now uses osql instead of isql. Osql flushes its error |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
95 ;; stream more frequently than isql so that error messages are |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
96 ;; available. There is no prompt and some output still is buffered. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
97 ;; This improves the interaction under Emacs but it still is somewhat |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
98 ;; awkward. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
99 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
100 ;; Quoted identifiers are not supported for hilighting. Most |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
101 ;; databases support the use of double quoted strings in place of |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
102 ;; identifiers; ms (Microsoft SQLServer) also supports identifiers |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
103 ;; enclosed within brackets []. |
24050 | 104 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
105 ;;; Product Support: |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
106 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
107 ;; To add support for additional SQL products the following steps |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
108 ;; must be followed ("xyz" is the name of the product in the examples |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
109 ;; below): |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
110 |
108381 | 111 ;; 1) Add the product to the list of known products. |
112 | |
113 ;; (sql-add-product 'xyz "XyzDB" | |
114 ;; '(:free-software t)) | |
115 | |
116 ;; 2) Define font lock settings. All ANSI keywords will be | |
117 ;; highlighted automatically, so only product specific keywords | |
118 ;; need to be defined here. | |
119 | |
120 ;; (defvar my-sql-mode-xyz-font-lock-keywords | |
121 ;; '(("\\b\\(red\\|orange\\|yellow\\)\\b" | |
122 ;; . font-lock-keyword-face)) | |
123 ;; "XyzDB SQL keywords used by font-lock.") | |
124 | |
125 ;; (sql-set-product-feature 'xyz | |
126 ;; :font-lock | |
127 ;; 'my-sql-mode-xyz-font-lock-keywords) | |
128 | |
129 ;; 3) Define any special syntax characters including comments and | |
130 ;; identifier characters. | |
131 | |
132 ;; (sql-set-product-feature 'xyz | |
133 ;; :syntax-alist ((?# . "w"))) | |
134 | |
135 ;; 4) Define the interactive command interpreter for the database | |
136 ;; product. | |
137 | |
138 ;; (defcustom my-sql-xyz-program "ixyz" | |
139 ;; "Command to start ixyz by XyzDB." | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
140 ;; :type 'file |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
141 ;; :group 'SQL) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
142 ;; |
108381 | 143 ;; (sql-set-product-feature 'xyz |
144 ;; :sqli-program 'my-sql-xyz-program) | |
145 ;; (sql-set-product-feature 'xyz | |
146 ;; :prompt-regexp "^xyzdb> ") | |
147 ;; (sql-set-product-feature 'xyz | |
148 ;; :prompt-length 7) | |
149 | |
150 ;; 5) Define login parameters and command line formatting. | |
151 | |
152 ;; (defcustom my-sql-xyz-login-params '(user password server database) | |
153 ;; "Login parameters to needed to connect to XyzDB." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
154 ;; :type 'sql-login-params |
108381 | 155 ;; :group 'SQL) |
156 ;; | |
157 ;; (sql-set-product-feature 'xyz | |
158 ;; :sqli-login 'my-sql-xyz-login-params) | |
159 | |
160 ;; (defcustom my-sql-xyz-options '("-X" "-Y" "-Z") | |
161 ;; "List of additional options for `sql-xyz-program'." | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
162 ;; :type '(repeat string) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
163 ;; :group 'SQL) |
108381 | 164 ;; |
165 ;; (sql-set-product-feature 'xyz | |
166 ;; :sqli-options 'my-sql-xyz-options)) | |
167 | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
168 ;; (defun my-sql-comint-xyz (product options) |
108381 | 169 ;; "Connect ti XyzDB in a comint buffer." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
170 ;; |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
171 ;; ;; Do something with `sql-user', `sql-password', |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
172 ;; ;; `sql-database', and `sql-server'. |
108381 | 173 ;; (let ((params options)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
174 ;; (if (not (string= "" sql-server)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
175 ;; (setq params (append (list "-S" sql-server) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
176 ;; (if (not (string= "" sql-database)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
177 ;; (setq params (append (list "-D" sql-database) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
178 ;; (if (not (string= "" sql-password)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
179 ;; (setq params (append (list "-P" sql-password) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
180 ;; (if (not (string= "" sql-user)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
181 ;; (setq params (append (list "-U" sql-user) params))) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
182 ;; (sql-comint product params))) |
108381 | 183 ;; |
184 ;; (sql-set-product-feature 'xyz | |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
185 ;; :sqli-comint-func 'my-sql-comint-xyz) |
108381 | 186 |
187 ;; 6) Define a convienence function to invoke the SQL interpreter. | |
188 | |
110309 | 189 ;; (defun my-sql-xyz (&optional buffer) |
108381 | 190 ;; "Run ixyz by XyzDB as an inferior process." |
110309 | 191 ;; (interactive "P") |
192 ;; (sql-product-interactive 'xyz buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
193 |
51929
3da2cf447bf9
Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents:
51893
diff
changeset
|
194 ;;; To Do: |
51893
1a294cfb1636
Version 1.8.0 of sql-mode.
Juanma Barranquero <lekktu@gmail.com>
parents:
51607
diff
changeset
|
195 |
108381 | 196 ;; Improve keyword highlighting for individual products. I have tried |
197 ;; to update those database that I use. Feel free to send me updates, | |
198 ;; or direct me to the reference manuals for your favorite database. | |
199 | |
200 ;; When there are no keywords defined, the ANSI keywords are | |
201 ;; highlighted. ANSI keywords are highlighted even if the keyword is | |
202 ;; not used for your current product. This should help identify | |
203 ;; portability concerns. | |
204 | |
205 ;; Add different highlighting levels. | |
206 | |
207 ;; Add support for listing available tables or the columns in a table. | |
24050 | 208 |
209 ;;; Thanks to all the people who helped me out: | |
210 | |
108381 | 211 ;; Alex Schroeder <alex@gnu.org> -- the original author |
24050 | 212 ;; Kai Blauberg <kai.blauberg@metla.fi> |
213 ;; <ibalaban@dalet.com> | |
214 ;; Yair Friedman <yfriedma@JohnBryce.Co.Il> | |
215 ;; Gregor Zych <zych@pool.informatik.rwth-aachen.de> | |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
216 ;; nino <nino@inform.dk> |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
217 ;; Berend de Boer <berend@pobox.com> |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
218 ;; Adam Jenkins <adam@thejenkins.org> |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
219 ;; Michael Mauger <mmaug@yahoo.com> -- improved product support |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
220 ;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
221 ;; Harald Maier <maierh@myself.com> -- sql-send-string |
108381 | 222 ;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections; code polish |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
223 |
24050 | 224 |
225 | |
226 ;;; Code: | |
227 | |
228 (require 'comint) | |
229 ;; Need the following to allow GNU Emacs 19 to compile the file. | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
230 (eval-when-compile |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
231 (require 'regexp-opt)) |
24050 | 232 (require 'custom) |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
233 (eval-when-compile ;; needed in Emacs 19, 20 |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
234 (setq max-specpdl-size (max max-specpdl-size 2000))) |
24050 | 235 |
65240
e3995ff46137
(font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents:
65198
diff
changeset
|
236 (defvar font-lock-keyword-face) |
e3995ff46137
(font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents:
65198
diff
changeset
|
237 (defvar font-lock-set-defaults) |
e3995ff46137
(font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents:
65198
diff
changeset
|
238 (defvar font-lock-string-face) |
e3995ff46137
(font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents:
65198
diff
changeset
|
239 |
24050 | 240 ;;; Allow customization |
241 | |
242 (defgroup SQL nil | |
64052
68f51d595f7f
(SQL): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents:
63410
diff
changeset
|
243 "Running a SQL interpreter from within Emacs buffers." |
24556 | 244 :version "20.4" |
108381 | 245 :group 'languages |
24050 | 246 :group 'processes) |
247 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
248 ;; These four variables will be used as defaults, if set. |
24050 | 249 |
250 (defcustom sql-user "" | |
108381 | 251 "Default username." |
24050 | 252 :type 'string |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
253 :group 'SQL |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
254 :safe 'stringp) |
24050 | 255 |
256 (defcustom sql-password "" | |
108381 | 257 "Default password. |
24050 | 258 |
259 Storing your password in a textfile such as ~/.emacs could be dangerous. | |
260 Customizing your password will store it in your ~/.emacs file." | |
261 :type 'string | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
262 :group 'SQL |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
263 :risky t) |
24050 | 264 |
265 (defcustom sql-database "" | |
108381 | 266 "Default database." |
24050 | 267 :type 'string |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
268 :group 'SQL |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
269 :safe 'stringp) |
24050 | 270 |
271 (defcustom sql-server "" | |
108381 | 272 "Default server or host." |
24050 | 273 :type 'string |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
274 :group 'SQL |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
275 :safe 'stringp) |
108381 | 276 |
110309 | 277 (defcustom sql-port 0 |
278 "Default port." | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
279 :version "24.1" |
108381 | 280 :type 'number |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
281 :group 'SQL |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
282 :safe 'numberp) |
24050 | 283 |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
284 ;; Login parameter type |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
285 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
286 (define-widget 'sql-login-params 'lazy |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
287 "Widget definition of the login parameters list" |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
288 ;; FIXME: does not implement :default property for the user, |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
289 ;; database and server options. Anybody have some guidance on how to |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
290 ;; do this. |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
291 :tag "Login Parameters" |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
292 :type '(repeat (choice |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
293 (const user) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
294 (const password) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
295 (choice :tag "server" |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
296 (const server) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
297 (list :tag "file" |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
298 (const :format "" server) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
299 (const :format "" :file) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
300 regexp) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
301 (list :tag "completion" |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
302 (const :format "" server) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
303 (const :format "" :completion) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
304 (restricted-sexp |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
305 :match-alternatives (listp stringp)))) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
306 (choice :tag "database" |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
307 (const database) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
308 (list :tag "file" |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
309 (const :format "" database) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
310 (const :format "" :file) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
311 regexp) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
312 (list :tag "completion" |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
313 (const :format "" database) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
314 (const :format "" :completion) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
315 (restricted-sexp |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
316 :match-alternatives (listp stringp)))) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
317 (const port)))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
318 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
319 ;; SQL Product support |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
320 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
321 (defvar sql-interactive-product nil |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
322 "Product under `sql-interactive-mode'.") |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
323 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
324 (defvar sql-connection nil |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
325 "Connection name if interactive session started by `sql-connect'.") |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
326 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
327 (defvar sql-product-alist |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
328 '((ansi |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
329 :name "ANSI" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
330 :font-lock sql-mode-ansi-font-lock-keywords) |
108381 | 331 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
332 (db2 |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
333 :name "DB2" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
334 :font-lock sql-mode-db2-font-lock-keywords |
108381 | 335 :sqli-program sql-db2-program |
336 :sqli-options sql-db2-options | |
337 :sqli-login sql-db2-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
338 :sqli-comint-func sql-comint-db2 |
108381 | 339 :prompt-regexp "^db2 => " |
340 :prompt-length 7 | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
341 :prompt-cont-regexp "^db2 (cont\.) => " |
108381 | 342 :input-filter sql-escape-newlines-filter) |
343 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
344 (informix |
108381 | 345 :name "Informix" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
346 :font-lock sql-mode-informix-font-lock-keywords |
108381 | 347 :sqli-program sql-informix-program |
348 :sqli-options sql-informix-options | |
349 :sqli-login sql-informix-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
350 :sqli-comint-func sql-comint-informix |
108381 | 351 :prompt-regexp "^> " |
352 :prompt-length 2 | |
353 :syntax-alist ((?{ . "<") (?} . ">"))) | |
354 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
355 (ingres |
108381 | 356 :name "Ingres" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
357 :font-lock sql-mode-ingres-font-lock-keywords |
108381 | 358 :sqli-program sql-ingres-program |
359 :sqli-options sql-ingres-options | |
360 :sqli-login sql-ingres-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
361 :sqli-comint-func sql-comint-ingres |
108381 | 362 :prompt-regexp "^\* " |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
363 :prompt-length 2 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
364 :prompt-cont-regexp "^\* ") |
108381 | 365 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
366 (interbase |
108381 | 367 :name "Interbase" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
368 :font-lock sql-mode-interbase-font-lock-keywords |
108381 | 369 :sqli-program sql-interbase-program |
370 :sqli-options sql-interbase-options | |
371 :sqli-login sql-interbase-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
372 :sqli-comint-func sql-comint-interbase |
108381 | 373 :prompt-regexp "^SQL> " |
374 :prompt-length 5) | |
375 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
376 (linter |
108381 | 377 :name "Linter" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
378 :font-lock sql-mode-linter-font-lock-keywords |
108381 | 379 :sqli-program sql-linter-program |
380 :sqli-options sql-linter-options | |
381 :sqli-login sql-linter-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
382 :sqli-comint-func sql-comint-linter |
108381 | 383 :prompt-regexp "^SQL>" |
384 :prompt-length 4) | |
385 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
386 (ms |
108381 | 387 :name "Microsoft" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
388 :font-lock sql-mode-ms-font-lock-keywords |
108381 | 389 :sqli-program sql-ms-program |
390 :sqli-options sql-ms-options | |
391 :sqli-login sql-ms-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
392 :sqli-comint-func sql-comint-ms |
108381 | 393 :prompt-regexp "^[0-9]*>" |
394 :prompt-length 5 | |
395 :syntax-alist ((?@ . "w")) | |
396 :terminator ("^go" . "go")) | |
397 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
398 (mysql |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
399 :name "MySQL" |
108381 | 400 :free-software t |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
401 :font-lock sql-mode-mysql-font-lock-keywords |
108381 | 402 :sqli-program sql-mysql-program |
403 :sqli-options sql-mysql-options | |
404 :sqli-login sql-mysql-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
405 :sqli-comint-func sql-comint-mysql |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
406 :list-all "SHOW TABLES;" |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
407 :list-table "DESCRIBE %s;" |
108381 | 408 :prompt-regexp "^mysql> " |
409 :prompt-length 6 | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
410 :prompt-cont-regexp "^ -> " |
108381 | 411 :input-filter sql-remove-tabs-filter) |
412 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
413 (oracle |
108381 | 414 :name "Oracle" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
415 :font-lock sql-mode-oracle-font-lock-keywords |
108381 | 416 :sqli-program sql-oracle-program |
417 :sqli-options sql-oracle-options | |
418 :sqli-login sql-oracle-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
419 :sqli-comint-func sql-comint-oracle |
108381 | 420 :prompt-regexp "^SQL> " |
421 :prompt-length 5 | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
422 :prompt-cont-regexp "^\\s-*\\d+> " |
108381 | 423 :syntax-alist ((?$ . "w") (?# . "w")) |
424 :terminator ("\\(^/\\|;\\)" . "/") | |
425 :input-filter sql-placeholders-filter) | |
426 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
427 (postgres |
108381 | 428 :name "Postgres" |
429 :free-software t | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
430 :font-lock sql-mode-postgres-font-lock-keywords |
108381 | 431 :sqli-program sql-postgres-program |
432 :sqli-options sql-postgres-options | |
433 :sqli-login sql-postgres-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
434 :sqli-comint-func sql-comint-postgres |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
435 :list-all ("\\d+" . "\\dS+") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
436 :list-table ("\\d+ %s" . "\\dS+ %s") |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
437 :prompt-regexp "^.*=[#>] " |
108381 | 438 :prompt-length 5 |
110309 | 439 :prompt-cont-regexp "^.*[-(][#>] " |
108381 | 440 :input-filter sql-remove-tabs-filter |
110309 | 441 :terminator ("\\(^\\s-*\\\\g\\|;\\)" . ";")) |
108381 | 442 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
443 (solid |
108381 | 444 :name "Solid" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
445 :font-lock sql-mode-solid-font-lock-keywords |
108381 | 446 :sqli-program sql-solid-program |
447 :sqli-options sql-solid-options | |
448 :sqli-login sql-solid-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
449 :sqli-comint-func sql-comint-solid |
108381 | 450 :prompt-regexp "^" |
451 :prompt-length 0) | |
452 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
453 (sqlite |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
454 :name "SQLite" |
108381 | 455 :free-software t |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
456 :font-lock sql-mode-sqlite-font-lock-keywords |
108381 | 457 :sqli-program sql-sqlite-program |
458 :sqli-options sql-sqlite-options | |
459 :sqli-login sql-sqlite-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
460 :sqli-comint-func sql-comint-sqlite |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
461 :list-all ".tables" |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
462 :list-table ".schema %s" |
108381 | 463 :prompt-regexp "^sqlite> " |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
464 :prompt-length 8 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
465 :prompt-cont-regexp "^ ...> " |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
466 :terminator ";") |
108381 | 467 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
468 (sybase |
108381 | 469 :name "Sybase" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
470 :font-lock sql-mode-sybase-font-lock-keywords |
108381 | 471 :sqli-program sql-sybase-program |
472 :sqli-options sql-sybase-options | |
473 :sqli-login sql-sybase-login-params | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
474 :sqli-comint-func sql-comint-sybase |
108381 | 475 :prompt-regexp "^SQL> " |
476 :prompt-length 5 | |
477 :syntax-alist ((?@ . "w")) | |
478 :terminator ("^go" . "go")) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
479 ) |
108381 | 480 "An alist of product specific configuration settings. |
481 | |
482 Without an entry in this list a product will not be properly | |
483 highlighted and will not support `sql-interactive-mode'. | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
484 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
485 Each element in the list is in the following format: |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
486 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
487 \(PRODUCT FEATURE VALUE ...) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
488 |
108381 | 489 where PRODUCT is the appropriate value of `sql-product'. The |
490 product name is then followed by FEATURE-VALUE pairs. If a | |
491 FEATURE is not specified, its VALUE is treated as nil. FEATURE | |
492 may be any one of the following: | |
493 | |
494 :name string containing the displayable name of | |
495 the product. | |
496 | |
497 :free-software is the product Free (as in Freedom) software? | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
498 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
499 :font-lock name of the variable containing the product |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
500 specific font lock highlighting patterns. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
501 |
108381 | 502 :sqli-program name of the variable containing the product |
503 specific interactive program name. | |
504 | |
505 :sqli-options name of the variable containing the list | |
506 of product specific options. | |
507 | |
508 :sqli-login name of the variable containing the list of | |
509 login parameters (i.e., user, password, | |
510 database and server) needed to connect to | |
511 the database. | |
512 | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
513 :sqli-comint-func name of a function which accepts no |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
514 parameters that will use the values of |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
515 `sql-user', `sql-password', |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
516 `sql-database' and `sql-server' to open a |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
517 comint buffer and connect to the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
518 database. Do product specific |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
519 configuration of comint in this function. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
520 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
521 :list-all Command string or function which produces |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
522 a listing of all objects in the database. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
523 If it's a cons cell, then the car |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
524 produces the standard list of objects and |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
525 the cdr produces an enhanced list of |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
526 objects. What \"enhanced\" means is |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
527 dependent on the SQL product and may not |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
528 exist. In general though, the |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
529 \"enhanced\" list should include visible |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
530 objects from other schemas. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
531 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
532 :list-table Command string or function which produces |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
533 a detailed listing of a specific database |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
534 table. If its a cons cell, then the car |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
535 produces the standard list and the cdr |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
536 produces an enhanced list. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
537 |
108381 | 538 :prompt-regexp regular expression string that matches |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
539 the prompt issued by the product |
108381 | 540 interpreter. |
541 | |
542 :prompt-length length of the prompt on the line. | |
543 | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
544 :prompt-cont-regexp regular expression string that matches |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
545 the continuation prompt issued by the |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
546 product interpreter. |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
547 |
108381 | 548 :input-filter function which can filter strings sent to |
549 the command interpreter. It is also used | |
550 by the `sql-send-string', | |
551 `sql-send-region', `sql-send-paragraph' | |
552 and `sql-send-buffer' functions. The | |
553 function is passed the string sent to the | |
554 command interpreter and must return the | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
555 filtered string. May also be a list of |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
556 such functions. |
108381 | 557 |
558 :terminator the terminator to be sent after a | |
559 `sql-send-string', `sql-send-region', | |
560 `sql-send-paragraph' and | |
561 `sql-send-buffer' command. May be the | |
562 literal string or a cons of a regexp to | |
563 match an existing terminator in the | |
564 string and the terminator to be used if | |
565 its absent. By default \";\". | |
566 | |
567 :syntax-alist alist of syntax table entries to enable | |
568 special character treatment by font-lock | |
569 and imenu. | |
570 | |
571 Other features can be stored but they will be ignored. However, | |
572 you can develop new functionality which is product independent by | |
573 using `sql-get-product-feature' to lookup the product specific | |
574 settings.") | |
575 | |
576 (defvar sql-indirect-features | |
577 '(:font-lock :sqli-program :sqli-options :sqli-login)) | |
578 | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
579 (defcustom sql-connection-alist nil |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
580 "An alist of connection parameters for interacting with a SQL |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
581 product. |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
582 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
583 Each element of the alist is as follows: |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
584 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
585 \(CONNECTION \(SQL-VARIABLE VALUE) ...) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
586 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
587 Where CONNECTION is a symbol identifying the connection, SQL-VARIABLE |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
588 is the symbol name of a SQL mode variable, and VALUE is the value to |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
589 be assigned to the variable. |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
590 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
591 The most common SQL-VARIABLE settings associated with a connection |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
592 are: |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
593 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
594 `sql-product' |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
595 `sql-user' |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
596 `sql-password' |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
597 `sql-port' |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
598 `sql-server' |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
599 `sql-database' |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
600 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
601 If a SQL-VARIABLE is part of the connection, it will not be |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
602 prompted for during login." |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
603 |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
604 :type `(alist :key-type (string :tag "Connection") |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
605 :value-type |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
606 (set |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
607 (group (const :tag "Product" sql-product) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
608 (choice |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
609 ,@(mapcar (lambda (prod-info) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
610 `(const :tag |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
611 ,(or (plist-get (cdr prod-info) :name) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
612 (capitalize (symbol-name (car prod-info)))) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
613 (quote ,(car prod-info)))) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
614 sql-product-alist))) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
615 (group (const :tag "Username" sql-user) string) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
616 (group (const :tag "Password" sql-password) string) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
617 (group (const :tag "Server" sql-server) string) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
618 (group (const :tag "Database" sql-database) string) |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
619 (group (const :tag "Port" sql-port) integer) |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
620 (repeat :inline t |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
621 (list :tab "Other" |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
622 (symbol :tag " Variable Symbol") |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
623 (sexp :tag "Value Expression"))))) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
624 :version "24.1" |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
625 :group 'SQL) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
626 |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
627 (defcustom sql-product 'ansi |
108381 | 628 "Select the SQL database product used so that buffers can be |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
629 highlighted properly when you open them." |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
630 :type `(choice |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
631 ,@(mapcar (lambda (prod-info) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
632 `(const :tag |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
633 ,(or (plist-get (cdr prod-info) :name) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
634 (capitalize (symbol-name (car prod-info)))) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
635 ,(car prod-info))) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
636 sql-product-alist)) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
637 :group 'SQL |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
638 :safe 'symbolp) |
110309 | 639 (defvaralias 'sql-dialect 'sql-product) |
108381 | 640 |
641 ;; misc customization of sql.el behaviour | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
642 |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
643 (defcustom sql-electric-stuff nil |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
644 "Treat some input as electric. |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
645 If set to the symbol `semicolon', then hitting `;' will send current |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
646 input in the SQLi buffer to the process. |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
647 If set to the symbol `go', then hitting `go' on a line by itself will |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
648 send current input in the SQLi buffer to the process. |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
649 If set to nil, then you must use \\[comint-send-input] in order to send |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
650 current input in the SQLi buffer to the process." |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
651 :type '(choice (const :tag "Nothing" nil) |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
652 (const :tag "The semicolon `;'" semicolon) |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
653 (const :tag "The string `go' by itself" go)) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
654 :version "20.8" |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
655 :group 'SQL) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
656 |
108381 | 657 (defcustom sql-send-terminator nil |
658 "When non-nil, add a terminator to text sent to the SQL interpreter. | |
659 | |
660 When text is sent to the SQL interpreter (via `sql-send-string', | |
661 `sql-send-region', `sql-send-paragraph' or `sql-send-buffer'), a | |
662 command terminator can be automatically sent as well. The | |
663 terminator is not sent, if the string sent already ends with the | |
664 terminator. | |
665 | |
666 If this value is t, then the default command terminator for the | |
667 SQL interpreter is sent. If this value is a string, then the | |
668 string is sent. | |
669 | |
670 If the value is a cons cell of the form (PAT . TERM), then PAT is | |
671 a regexp used to match the terminator in the string and TERM is | |
672 the terminator to be sent. This form is useful if the SQL | |
673 interpreter has more than one way of submitting a SQL command. | |
674 The PAT regexp can match any of them, and TERM is the way we do | |
675 it automatically." | |
676 | |
677 :type '(choice (const :tag "No Terminator" nil) | |
678 (const :tag "Default Terminator" t) | |
679 (string :tag "Terminator String") | |
680 (cons :tag "Terminator Pattern and String" | |
681 (string :tag "Terminator Pattern") | |
682 (string :tag "Terminator String"))) | |
683 :version "22.2" | |
684 :group 'SQL) | |
685 | |
24050 | 686 (defcustom sql-pop-to-buffer-after-send-region nil |
108381 | 687 "When non-nil, pop to the buffer SQL statements are sent to. |
688 | |
689 After a call to `sql-sent-string', `sql-send-region', | |
690 `sql-send-paragraph' or `sql-send-buffer', the window is split | |
691 and the SQLi buffer is shown. If this variable is not nil, that | |
692 buffer's window will be selected by calling `pop-to-buffer'. If | |
693 this variable is nil, that buffer is shown using | |
694 `display-buffer'." | |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
695 :type 'boolean |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
696 :group 'SQL) |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
697 |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
698 ;; imenu support for sql-mode. |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
699 |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
700 (defvar sql-imenu-generic-expression |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
701 ;; Items are in reverse order because they are rendered in reverse. |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
702 '(("Rules/Defaults" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(rule\\|default\\)\\s-+\\(\\w+\\)" 3) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
703 ("Sequences" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*sequence\\s-+\\(\\w+\\)" 2) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
704 ("Triggers" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*trigger\\s-+\\(\\w+\\)" 2) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
705 ("Functions" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?function\\s-+\\(\\w+\\)" 3) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
706 ("Procedures" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
707 ("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3) |
108381 | 708 ("Types" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*type\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3) |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
709 ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
710 ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3)) |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
711 "Define interesting points in the SQL buffer for `imenu'. |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
712 |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
713 This is used to set `imenu-generic-expression' when SQL mode is |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
714 entered. Subsequent changes to `sql-imenu-generic-expression' will |
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
715 not affect existing SQL buffers because imenu-generic-expression is |
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
716 a local variable.") |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
717 |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
718 ;; history file |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
719 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
720 (defcustom sql-input-ring-file-name nil |
108381 | 721 "If non-nil, name of the file to read/write input history. |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
722 |
24861
0d593aa15c0f
(sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
24591
diff
changeset
|
723 You have to set this variable if you want the history of your commands |
0d593aa15c0f
(sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
24591
diff
changeset
|
724 saved from one Emacs session to the next. If this variable is set, |
0d593aa15c0f
(sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
24591
diff
changeset
|
725 exiting the SQL interpreter in an SQLi buffer will write the input |
0d593aa15c0f
(sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
24591
diff
changeset
|
726 history to the specified file. Starting a new process in a SQLi buffer |
0d593aa15c0f
(sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
24591
diff
changeset
|
727 will read the input history from the specified file. |
0d593aa15c0f
(sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
24591
diff
changeset
|
728 |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
729 This is used to initialize `comint-input-ring-file-name'. |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
730 |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
731 Note that the size of the input history is determined by the variable |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
732 `comint-input-ring-size'." |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
733 :type '(choice (const :tag "none" nil) |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
734 (file)) |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
735 :group 'SQL) |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
736 |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
737 (defcustom sql-input-ring-separator "\n--\n" |
108381 | 738 "Separator between commands in the history file. |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
739 |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
740 If set to \"\\n\", each line in the history file will be interpreted as |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
741 one command. Multi-line commands are split into several commands when |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
742 the input ring is initialized from a history file. |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
743 |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
744 This variable used to initialize `comint-input-ring-separator'. |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
745 `comint-input-ring-separator' is part of Emacs 21; if your Emacs |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
746 does not have it, setting `sql-input-ring-separator' will have no |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
747 effect. In that case multiline commands will be split into several |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
748 commands when the input history is read, as if you had set |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
749 `sql-input-ring-separator' to \"\\n\"." |
24050 | 750 :type 'string |
751 :group 'SQL) | |
752 | |
753 ;; The usual hooks | |
754 | |
755 (defcustom sql-interactive-mode-hook '() | |
108381 | 756 "Hook for customizing `sql-interactive-mode'." |
24050 | 757 :type 'hook |
758 :group 'SQL) | |
759 | |
760 (defcustom sql-mode-hook '() | |
108381 | 761 "Hook for customizing `sql-mode'." |
24050 | 762 :type 'hook |
763 :group 'SQL) | |
764 | |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
765 (defcustom sql-set-sqli-hook '() |
108381 | 766 "Hook for reacting to changes of `sql-buffer'. |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
767 |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
768 This is called by `sql-set-sqli-buffer' when the value of `sql-buffer' |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
769 is changed." |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
770 :type 'hook |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
771 :group 'SQL) |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
772 |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
773 ;; Customization for Oracle |
24050 | 774 |
775 (defcustom sql-oracle-program "sqlplus" | |
108381 | 776 "Command to start sqlplus by Oracle. |
24050 | 777 |
778 Starts `sql-interactive-mode' after doing some setup. | |
779 | |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
780 On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\". In order |
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
781 to start the sqlplus console, use \"plus33\" or something similar. |
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
782 You will find the file in your Orant\\bin directory." |
24050 | 783 :type 'file |
784 :group 'SQL) | |
785 | |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
786 (defcustom sql-oracle-options nil |
108381 | 787 "List of additional options for `sql-oracle-program'." |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
788 :type '(repeat string) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
789 :version "20.8" |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
790 :group 'SQL) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
791 |
108381 | 792 (defcustom sql-oracle-login-params '(user password database) |
793 "List of login parameters needed to connect to Oracle." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
794 :type 'sql-login-params |
108381 | 795 :version "24.1" |
796 :group 'SQL) | |
797 | |
798 (defcustom sql-oracle-scan-on t | |
799 "Non-nil if placeholders should be replaced in Oracle SQLi. | |
800 | |
801 When non-nil, Emacs will scan text sent to sqlplus and prompt | |
802 for replacement text for & placeholders as sqlplus does. This | |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
803 is needed on Windows where sqlplus output is buffered and the |
108381 | 804 prompts are not shown until after the text is entered. |
805 | |
806 You will probably want to issue the following command in sqlplus | |
807 to be safe: | |
808 | |
809 SET SCAN OFF" | |
810 :type 'boolean | |
811 :group 'SQL) | |
812 | |
51607
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
813 ;; Customization for SQLite |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
814 |
110309 | 815 (defcustom sql-sqlite-program (or (executable-find "sqlite3") |
816 (executable-find "sqlite") | |
817 "sqlite") | |
108381 | 818 "Command to start SQLite. |
819 | |
820 Starts `sql-interactive-mode' after doing some setup." | |
51607
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
821 :type 'file |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
822 :group 'SQL) |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
823 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
824 (defcustom sql-sqlite-options nil |
108381 | 825 "List of additional options for `sql-sqlite-program'." |
51607
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
826 :type '(repeat string) |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
827 :version "20.8" |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
828 :group 'SQL) |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
829 |
110309 | 830 (defcustom sql-sqlite-login-params '((database :file ".*\\.\\(db\\|sqlite[23]?\\)")) |
108381 | 831 "List of login parameters needed to connect to SQLite." |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
832 :type 'sql-login-params |
108381 | 833 :version "24.1" |
834 :group 'SQL) | |
835 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
836 ;; Customization for MySql |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
837 |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
838 (defcustom sql-mysql-program "mysql" |
108381 | 839 "Command to start mysql by TcX. |
840 | |
841 Starts `sql-interactive-mode' after doing some setup." | |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
842 :type 'file |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
843 :group 'SQL) |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
844 |
32169
5aa8b2b669b7
(sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31392
diff
changeset
|
845 (defcustom sql-mysql-options nil |
108381 | 846 "List of additional options for `sql-mysql-program'. |
34704
7cb3b80e66b8
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32621
diff
changeset
|
847 The following list of options is reported to make things work |
7cb3b80e66b8
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32621
diff
changeset
|
848 on Windows: \"-C\" \"-t\" \"-f\" \"-n\"." |
32169
5aa8b2b669b7
(sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31392
diff
changeset
|
849 :type '(repeat string) |
5aa8b2b669b7
(sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31392
diff
changeset
|
850 :version "20.8" |
5aa8b2b669b7
(sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31392
diff
changeset
|
851 :group 'SQL) |
5aa8b2b669b7
(sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31392
diff
changeset
|
852 |
108381 | 853 (defcustom sql-mysql-login-params '(user password database server) |
854 "List of login parameters needed to connect to MySql." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
855 :type 'sql-login-params |
108381 | 856 :version "24.1" |
857 :group 'SQL) | |
858 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
859 ;; Customization for Solid |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
860 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
861 (defcustom sql-solid-program "solsql" |
108381 | 862 "Command to start SOLID SQL Editor. |
863 | |
864 Starts `sql-interactive-mode' after doing some setup." | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
865 :type 'file |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
866 :group 'SQL) |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
867 |
108381 | 868 (defcustom sql-solid-login-params '(user password server) |
869 "List of login parameters needed to connect to Solid." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
870 :type 'sql-login-params |
108381 | 871 :version "24.1" |
872 :group 'SQL) | |
873 | |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
874 ;; Customization for Sybase |
24050 | 875 |
876 (defcustom sql-sybase-program "isql" | |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
877 "Command to start isql by Sybase. |
108381 | 878 |
879 Starts `sql-interactive-mode' after doing some setup." | |
24050 | 880 :type 'file |
881 :group 'SQL) | |
882 | |
32621
50c28d51e0f2
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32169
diff
changeset
|
883 (defcustom sql-sybase-options nil |
108381 | 884 "List of additional options for `sql-sybase-program'. |
32621
50c28d51e0f2
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32169
diff
changeset
|
885 Some versions of isql might require the -n option in order to work." |
50c28d51e0f2
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32169
diff
changeset
|
886 :type '(repeat string) |
50c28d51e0f2
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32169
diff
changeset
|
887 :version "20.8" |
50c28d51e0f2
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32169
diff
changeset
|
888 :group 'SQL) |
50c28d51e0f2
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32169
diff
changeset
|
889 |
108381 | 890 (defcustom sql-sybase-login-params '(server user password database) |
891 "List of login parameters needed to connect to Sybase." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
892 :type 'sql-login-params |
108381 | 893 :version "24.1" |
894 :group 'SQL) | |
895 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
896 ;; Customization for Informix |
24050 | 897 |
898 (defcustom sql-informix-program "dbaccess" | |
108381 | 899 "Command to start dbaccess by Informix. |
900 | |
901 Starts `sql-interactive-mode' after doing some setup." | |
24050 | 902 :type 'file |
903 :group 'SQL) | |
904 | |
108381 | 905 (defcustom sql-informix-login-params '(database) |
906 "List of login parameters needed to connect to Informix." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
907 :type 'sql-login-params |
108381 | 908 :version "24.1" |
909 :group 'SQL) | |
910 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
911 ;; Customization for Ingres |
24050 | 912 |
913 (defcustom sql-ingres-program "sql" | |
108381 | 914 "Command to start sql by Ingres. |
915 | |
916 Starts `sql-interactive-mode' after doing some setup." | |
24050 | 917 :type 'file |
918 :group 'SQL) | |
919 | |
108381 | 920 (defcustom sql-ingres-login-params '(database) |
921 "List of login parameters needed to connect to Ingres." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
922 :type 'sql-login-params |
108381 | 923 :version "24.1" |
924 :group 'SQL) | |
925 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
926 ;; Customization for Microsoft |
24050 | 927 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
928 (defcustom sql-ms-program "osql" |
108381 | 929 "Command to start osql by Microsoft. |
930 | |
931 Starts `sql-interactive-mode' after doing some setup." | |
24050 | 932 :type 'file |
933 :group 'SQL) | |
934 | |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
935 (defcustom sql-ms-options '("-w" "300" "-n") |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
936 ;; -w is the linesize |
108381 | 937 "List of additional options for `sql-ms-program'." |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
938 :type '(repeat string) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
55370
diff
changeset
|
939 :version "22.1" |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
940 :group 'SQL) |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
941 |
108381 | 942 (defcustom sql-ms-login-params '(user password server database) |
943 "List of login parameters needed to connect to Microsoft." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
944 :type 'sql-login-params |
108381 | 945 :version "24.1" |
946 :group 'SQL) | |
947 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
948 ;; Customization for Postgres |
24050 | 949 |
950 (defcustom sql-postgres-program "psql" | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
951 "Command to start psql by Postgres. |
24050 | 952 |
108381 | 953 Starts `sql-interactive-mode' after doing some setup." |
24050 | 954 :type 'file |
955 :group 'SQL) | |
956 | |
34704
7cb3b80e66b8
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32621
diff
changeset
|
957 (defcustom sql-postgres-options '("-P" "pager=off") |
108381 | 958 "List of additional options for `sql-postgres-program'. |
38872 | 959 The default setting includes the -P option which breaks older versions |
960 of the psql client (such as version 6.5.3). The -P option is equivalent | |
961 to the --pset option. If you want the psql to prompt you for a user | |
962 name, add the string \"-u\" to the list of options. If you want to | |
963 provide a user name on the command line (newer versions such as 7.1), | |
964 add your name with a \"-U\" prefix (such as \"-Umark\") to the list." | |
31392
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
965 :type '(repeat string) |
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
966 :version "20.8" |
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
967 :group 'SQL) |
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
968 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
969 (defcustom sql-postgres-login-params `((user :default ,(user-login-name)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
970 (database :default ,(user-login-name)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
971 server) |
108381 | 972 "List of login parameters needed to connect to Postgres." |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
973 :type 'sql-login-params |
108381 | 974 :version "24.1" |
975 :group 'SQL) | |
976 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
977 ;; Customization for Interbase |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
978 |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
979 (defcustom sql-interbase-program "isql" |
108381 | 980 "Command to start isql by Interbase. |
981 | |
982 Starts `sql-interactive-mode' after doing some setup." | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
983 :type 'file |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
984 :group 'SQL) |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
985 |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
986 (defcustom sql-interbase-options nil |
108381 | 987 "List of additional options for `sql-interbase-program'." |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
988 :type '(repeat string) |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
989 :version "20.8" |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
990 :group 'SQL) |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
991 |
108381 | 992 (defcustom sql-interbase-login-params '(user password database) |
993 "List of login parameters needed to connect to Interbase." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
994 :type 'sql-login-params |
108381 | 995 :version "24.1" |
996 :group 'SQL) | |
997 | |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
998 ;; Customization for DB2 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
999 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1000 (defcustom sql-db2-program "db2" |
108381 | 1001 "Command to start db2 by IBM. |
1002 | |
1003 Starts `sql-interactive-mode' after doing some setup." | |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1004 :type 'file |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1005 :group 'SQL) |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1006 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1007 (defcustom sql-db2-options nil |
108381 | 1008 "List of additional options for `sql-db2-program'." |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1009 :type '(repeat string) |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1010 :version "20.8" |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1011 :group 'SQL) |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1012 |
108381 | 1013 (defcustom sql-db2-login-params nil |
1014 "List of login parameters needed to connect to DB2." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
1015 :type 'sql-login-params |
108381 | 1016 :version "24.1" |
1017 :group 'SQL) | |
1018 | |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1019 ;; Customization for Linter |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1020 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1021 (defcustom sql-linter-program "inl" |
108381 | 1022 "Command to start inl by RELEX. |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1023 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1024 Starts `sql-interactive-mode' after doing some setup." |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1025 :type 'file |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1026 :group 'SQL) |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1027 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1028 (defcustom sql-linter-options nil |
108381 | 1029 "List of additional options for `sql-linter-program'." |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1030 :type '(repeat string) |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1031 :version "21.3" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1032 :group 'SQL) |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1033 |
108381 | 1034 (defcustom sql-linter-login-params '(user password database server) |
1035 "Login parameters to needed to connect to Linter." | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
1036 :type 'sql-login-params |
108381 | 1037 :version "24.1" |
1038 :group 'SQL) | |
1039 | |
24050 | 1040 |
1041 | |
1042 ;;; Variables which do not need customization | |
1043 | |
1044 (defvar sql-user-history nil | |
1045 "History of usernames used.") | |
1046 | |
1047 (defvar sql-database-history nil | |
1048 "History of databases used.") | |
1049 | |
1050 (defvar sql-server-history nil | |
1051 "History of servers used.") | |
1052 | |
1053 ;; Passwords are not kept in a history. | |
1054 | |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1055 (defvar sql-product-history nil |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1056 "History of products used.") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1057 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1058 (defvar sql-connection-history nil |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1059 "History of connections used.") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1060 |
24050 | 1061 (defvar sql-buffer nil |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
1062 "Current SQLi buffer. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
1063 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1064 The global value of `sql-buffer' is the name of the latest SQLi buffer |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
1065 created. Any SQL buffer created will make a local copy of this value. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
1066 See `sql-interactive-mode' for more on multiple sessions. If you want |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
1067 to change the SQLi buffer a SQL mode sends its SQL strings to, change |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1068 the local value of `sql-buffer' using \\[sql-set-sqli-buffer].") |
24050 | 1069 |
1070 (defvar sql-prompt-regexp nil | |
1071 "Prompt used to initialize `comint-prompt-regexp'. | |
1072 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1073 You can change `sql-prompt-regexp' on `sql-interactive-mode-hook'.") |
24050 | 1074 |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
1075 (defvar sql-prompt-length 0 |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
1076 "Prompt used to set `left-margin' in `sql-interactive-mode'. |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
1077 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1078 You can change `sql-prompt-length' on `sql-interactive-mode-hook'.") |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
1079 |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
1080 (defvar sql-prompt-cont-regexp nil |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
1081 "Prompt pattern of statement continuation prompts.") |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
1082 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1083 (defvar sql-alternate-buffer-name nil |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1084 "Buffer-local string used to possibly rename the SQLi buffer. |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1085 |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1086 Used by `sql-rename-buffer'.") |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1087 |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1088 (defun sql-buffer-live-p (buffer &optional product) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1089 "Returns non-nil if the process associated with buffer is live. |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1090 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1091 BUFFER can be a buffer object or a buffer name. The buffer must |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1092 be a live buffer, have an running process attached to it, be in |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1093 `sql-interactive-mode', and, if PRODUCT is specified, it's |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1094 `sql-product' must match." |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1095 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1096 (when buffer |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1097 (setq buffer (get-buffer buffer)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1098 (and buffer |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1099 (buffer-live-p buffer) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1100 (get-buffer-process buffer) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1101 (comint-check-proc buffer) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1102 (with-current-buffer buffer |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1103 (and (derived-mode-p 'sql-interactive-mode) |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1104 (or (not product) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
1105 (eq product sql-product))))))) |
110309 | 1106 |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1107 ;; Keymap for sql-interactive-mode. |
24050 | 1108 |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1109 (defvar sql-interactive-mode-map |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1110 (let ((map (make-sparse-keymap))) |
64837
f80fef683ab5
(sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
64699
diff
changeset
|
1111 (if (fboundp 'set-keymap-parent) |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1112 (set-keymap-parent map comint-mode-map); Emacs |
64837
f80fef683ab5
(sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
64699
diff
changeset
|
1113 (if (fboundp 'set-keymap-parents) |
f80fef683ab5
(sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
64699
diff
changeset
|
1114 (set-keymap-parents map (list comint-mode-map)))); XEmacs |
f80fef683ab5
(sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
64699
diff
changeset
|
1115 (if (fboundp 'set-keymap-name) |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1116 (set-keymap-name map 'sql-interactive-mode-map)); XEmacs |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1117 (define-key map (kbd "C-j") 'sql-accumulate-and-indent) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1118 (define-key map (kbd "C-c C-w") 'sql-copy-column) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1119 (define-key map (kbd "O") 'sql-magic-go) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1120 (define-key map (kbd "o") 'sql-magic-go) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1121 (define-key map (kbd ";") 'sql-magic-semicolon) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1122 (define-key map (kbd "C-c C-l a") 'sql-list-all) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1123 (define-key map (kbd "C-c C-l t") 'sql-list-table) |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1124 map) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1125 "Mode map used for `sql-interactive-mode'. |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1126 Based on `comint-mode-map'.") |
24050 | 1127 |
1128 ;; Keymap for sql-mode. | |
1129 | |
1130 (defvar sql-mode-map | |
1131 (let ((map (make-sparse-keymap))) | |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1132 (define-key map (kbd "C-c C-c") 'sql-send-paragraph) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1133 (define-key map (kbd "C-c C-r") 'sql-send-region) |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1134 (define-key map (kbd "C-c C-s") 'sql-send-string) |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
1135 (define-key map (kbd "C-c C-b") 'sql-send-buffer) |
108381 | 1136 (define-key map (kbd "C-c C-i") 'sql-product-interactive) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1137 (define-key map (kbd "C-c C-l a") 'sql-list-all) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1138 (define-key map (kbd "C-c C-l t") 'sql-list-table) |
24050 | 1139 map) |
1140 "Mode map used for `sql-mode'.") | |
1141 | |
1142 ;; easy menu for sql-mode. | |
1143 | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
1144 (easy-menu-define |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
1145 sql-mode-menu sql-mode-map |
24050 | 1146 "Menu for `sql-mode'." |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1147 `("SQL" |
110309 | 1148 ["Send Paragraph" sql-send-paragraph (sql-buffer-live-p sql-buffer)] |
108381 | 1149 ["Send Region" sql-send-region (and mark-active |
110309 | 1150 (sql-buffer-live-p sql-buffer))] |
1151 ["Send Buffer" sql-send-buffer (sql-buffer-live-p sql-buffer)] | |
1152 ["Send String" sql-send-string (sql-buffer-live-p sql-buffer)] | |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1153 "--" |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1154 ["List all objects" sql-list-all (sql-buffer-live-p sql-buffer)] |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1155 ["List table details" sql-list-table (sql-buffer-live-p sql-buffer)] |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1156 "--" |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1157 ["Start SQLi session" sql-product-interactive |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1158 :visible (not sql-connection-alist) |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1159 :enable (sql-get-product-feature sql-product :sqli-comint-func)] |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1160 ("Start..." |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1161 :visible sql-connection-alist |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1162 :filter sql-connection-menu-filter |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1163 "--" |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1164 ["New SQLi Session" sql-product-interactive (sql-get-product-feature sql-product :sqli-comint-func)]) |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1165 ["--" |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1166 :visible sql-connection-alist] |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
1167 ["Show SQLi buffer" sql-show-sqli-buffer t] |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1168 ["Set SQLi buffer" sql-set-sqli-buffer t] |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
1169 ["Pop to SQLi buffer after send" |
24050 | 1170 sql-toggle-pop-to-buffer-after-send-region |
1171 :style toggle | |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
1172 :selected sql-pop-to-buffer-after-send-region] |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1173 ["--" nil nil] |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1174 ("Product" |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1175 ,@(mapcar (lambda (prod-info) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1176 (let* ((prod (pop prod-info)) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1177 (name (or (plist-get prod-info :name) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1178 (capitalize (symbol-name prod)))) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1179 (cmd (intern (format "sql-highlight-%s-keywords" prod)))) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1180 (fset cmd `(lambda () ,(format "Highlight %s SQL keywords." name) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1181 (interactive) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1182 (sql-set-product ',prod))) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1183 (vector name cmd |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1184 :style 'radio |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1185 :selected `(eq sql-product ',prod)))) |
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
1186 sql-product-alist)))) |
24050 | 1187 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1188 ;; easy menu for sql-interactive-mode. |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1189 |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
1190 (easy-menu-define |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1191 sql-interactive-mode-menu sql-interactive-mode-map |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1192 "Menu for `sql-interactive-mode'." |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1193 '("SQL" |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
1194 ["Rename Buffer" sql-rename-buffer t] |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1195 ["Save Connection" sql-save-connection (not sql-connection)] |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1196 "--" |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1197 ["List all objects" sql-list-all t] |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
1198 ["List table details" sql-list-table t])) |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
1199 |
24050 | 1200 ;; Abbreviations -- if you want more of them, define them in your |
1201 ;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too. | |
1202 | |
1203 (defvar sql-mode-abbrev-table nil | |
1204 "Abbrev table used in `sql-mode' and `sql-interactive-mode'.") | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1205 (unless sql-mode-abbrev-table |
74433
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1206 (define-abbrev-table 'sql-mode-abbrev-table nil)) |
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1207 |
84922
1b6b77d0f75a
(top): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
78234
diff
changeset
|
1208 (mapc |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1209 ;; In Emacs 22+, provide SYSTEM-FLAG to define-abbrev. |
74433
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1210 '(lambda (abbrev) |
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1211 (let ((name (car abbrev)) |
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1212 (expansion (cdr abbrev))) |
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1213 (condition-case nil |
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1214 (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) |
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1215 (error |
89cf360cc26e
(sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents:
68773
diff
changeset
|
1216 (define-abbrev sql-mode-abbrev-table name expansion))))) |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1217 '(("ins" . "insert") |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1218 ("upd" . "update") |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1219 ("del" . "delete") |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1220 ("sel" . "select") |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1221 ("proc" . "procedure") |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1222 ("func" . "function") |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1223 ("cr" . "create"))) |
24050 | 1224 |
1225 ;; Syntax Table | |
1226 | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
1227 (defvar sql-mode-syntax-table |
24050 | 1228 (let ((table (make-syntax-table))) |
1229 ;; C-style comments /**/ (see elisp manual "Syntax Flags")) | |
1230 (modify-syntax-entry ?/ ". 14" table) | |
1231 (modify-syntax-entry ?* ". 23" table) | |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1232 ;; double-dash starts comments |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
1233 (modify-syntax-entry ?- ". 12b" table) |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1234 ;; newline and formfeed end comments |
24050 | 1235 (modify-syntax-entry ?\n "> b" table) |
1236 (modify-syntax-entry ?\f "> b" table) | |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1237 ;; single quotes (') delimit strings |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
1238 (modify-syntax-entry ?' "\"" table) |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1239 ;; double quotes (") don't delimit strings |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1240 (modify-syntax-entry ?\" "." table) |
40971
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
1241 ;; backslash is no escape character |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
1242 (modify-syntax-entry ?\\ "." table) |
24050 | 1243 table) |
1244 "Syntax table used in `sql-mode' and `sql-interactive-mode'.") | |
1245 | |
1246 ;; Font lock support | |
1247 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1248 (defvar sql-mode-font-lock-object-name |
74898
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1249 (eval-when-compile |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1250 (list (concat "^\\s-*\\(?:create\\|drop\\|alter\\)\\s-+" ;; lead off with CREATE, DROP or ALTER |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1251 "\\(?:\\w+\\s-+\\)*" ;; optional intervening keywords |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1252 "\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?" |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1253 "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1254 "\\(\\w+\\)") |
60595cfe604f
(sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents:
74433
diff
changeset
|
1255 1 'font-lock-function-name-face)) |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1256 |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1257 "Pattern to match the names of top-level objects. |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1258 |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1259 The pattern matches the name in a CREATE, DROP or ALTER |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1260 statement. The format of variable should be a valid |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1261 `font-lock-keywords' entry.") |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1262 |
108381 | 1263 ;; While there are international and American standards for SQL, they |
1264 ;; are not followed closely, and most vendors offer significant | |
1265 ;; capabilities beyond those defined in the standard specifications. | |
1266 | |
1267 ;; SQL mode provides support for hilighting based on the product. In | |
1268 ;; addition to hilighting the product keywords, any ANSI keywords not | |
1269 ;; used by the product are also hilighted. This will help identify | |
1270 ;; keywords that could be restricted in future versions of the product | |
1271 ;; or might be a problem if ported to another product. | |
1272 | |
1273 ;; To reduce the complexity and size of the regular expressions | |
1274 ;; generated to match keywords, ANSI keywords are filtered out of | |
1275 ;; product keywords if they are equivalent. To do this, we define a | |
1276 ;; function `sql-font-lock-keywords-builder' that removes any keywords | |
1277 ;; that are matched by the ANSI patterns and results in the same face | |
1278 ;; being applied. For this to work properly, we must play some games | |
1279 ;; with the execution and compile time behavior. This code is a | |
1280 ;; little tricky but works properly. | |
1281 | |
1282 ;; When defining the keywords for individual products you should | |
1283 ;; include all of the keywords that you want matched. The filtering | |
1284 ;; against the ANSI keywords will be automatic if you use the | |
1285 ;; `sql-font-lock-keywords-builder' function and follow the | |
1286 ;; implementation pattern used for the other products in this file. | |
1287 | |
1288 (eval-when-compile | |
1289 (defvar sql-mode-ansi-font-lock-keywords) | |
1290 (setq sql-mode-ansi-font-lock-keywords nil)) | |
1291 | |
1292 (eval-and-compile | |
1293 (defun sql-font-lock-keywords-builder (face boundaries &rest keywords) | |
1294 "Generation of regexp matching any one of KEYWORDS." | |
1295 | |
1296 (let ((bdy (or boundaries '("\\b" . "\\b"))) | |
1297 kwd) | |
1298 | |
1299 ;; Remove keywords that are defined in ANSI | |
1300 (setq kwd keywords) | |
1301 (dolist (k keywords) | |
1302 (catch 'next | |
1303 (dolist (a sql-mode-ansi-font-lock-keywords) | |
1304 (when (and (eq face (cdr a)) | |
1305 (eq (string-match (car a) k 0) 0) | |
1306 (eq (match-end 0) (length k))) | |
1307 (setq kwd (delq k kwd)) | |
1308 (throw 'next nil))))) | |
1309 | |
1310 ;; Create a properly formed font-lock-keywords item | |
1311 (cons (concat (car bdy) | |
1312 (regexp-opt kwd t) | |
1313 (cdr bdy)) | |
1314 face)))) | |
1315 | |
1316 (eval-when-compile | |
1317 (setq sql-mode-ansi-font-lock-keywords | |
1318 (list | |
1319 ;; ANSI Non Reserved keywords | |
1320 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1321 "ada" "asensitive" "assignment" "asymmetric" "atomic" "between" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1322 "bitvar" "called" "catalog_name" "chain" "character_set_catalog" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1323 "character_set_name" "character_set_schema" "checked" "class_origin" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1324 "cobol" "collation_catalog" "collation_name" "collation_schema" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1325 "column_name" "command_function" "command_function_code" "committed" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1326 "condition_number" "connection_name" "constraint_catalog" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1327 "constraint_name" "constraint_schema" "contains" "cursor_name" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1328 "datetime_interval_code" "datetime_interval_precision" "defined" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1329 "definer" "dispatch" "dynamic_function" "dynamic_function_code" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1330 "existing" "exists" "final" "fortran" "generated" "granted" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1331 "hierarchy" "hold" "implementation" "infix" "insensitive" "instance" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1332 "instantiable" "invoker" "key_member" "key_type" "length" "m" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1333 "message_length" "message_octet_length" "message_text" "method" "more" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1334 "mumps" "name" "nullable" "number" "options" "overlaps" "overriding" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1335 "parameter_mode" "parameter_name" "parameter_ordinal_position" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1336 "parameter_specific_catalog" "parameter_specific_name" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1337 "parameter_specific_schema" "pascal" "pli" "position" "repeatable" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1338 "returned_length" "returned_octet_length" "returned_sqlstate" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1339 "routine_catalog" "routine_name" "routine_schema" "row_count" "scale" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1340 "schema_name" "security" "self" "sensitive" "serializable" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1341 "server_name" "similar" "simple" "source" "specific_name" "style" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1342 "subclass_origin" "sublist" "symmetric" "system" "table_name" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1343 "transaction_active" "transactions_committed" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1344 "transactions_rolled_back" "transform" "transforms" "trigger_catalog" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1345 "trigger_name" "trigger_schema" "type" "uncommitted" "unnamed" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1346 "user_defined_type_catalog" "user_defined_type_name" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1347 "user_defined_type_schema" |
108381 | 1348 ) |
1349 ;; ANSI Reserved keywords | |
1350 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1351 "absolute" "action" "add" "admin" "after" "aggregate" "alias" "all" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1352 "allocate" "alter" "and" "any" "are" "as" "asc" "assertion" "at" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1353 "authorization" "before" "begin" "both" "breadth" "by" "call" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1354 "cascade" "cascaded" "case" "catalog" "check" "class" "close" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1355 "collate" "collation" "column" "commit" "completion" "connect" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1356 "connection" "constraint" "constraints" "constructor" "continue" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1357 "corresponding" "create" "cross" "cube" "current" "cursor" "cycle" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1358 "data" "day" "deallocate" "declare" "default" "deferrable" "deferred" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1359 "delete" "depth" "deref" "desc" "describe" "descriptor" "destroy" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1360 "destructor" "deterministic" "diagnostics" "dictionary" "disconnect" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1361 "distinct" "domain" "drop" "dynamic" "each" "else" "end" "equals" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1362 "escape" "every" "except" "exception" "exec" "execute" "external" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1363 "false" "fetch" "first" "for" "foreign" "found" "free" "from" "full" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1364 "function" "general" "get" "global" "go" "goto" "grant" "group" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1365 "grouping" "having" "host" "hour" "identity" "ignore" "immediate" "in" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1366 "indicator" "initialize" "initially" "inner" "inout" "input" "insert" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1367 "intersect" "into" "is" "isolation" "iterate" "join" "key" "language" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1368 "last" "lateral" "leading" "left" "less" "level" "like" "limit" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1369 "local" "locator" "map" "match" "minute" "modifies" "modify" "module" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1370 "month" "names" "natural" "new" "next" "no" "none" "not" "null" "of" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1371 "off" "old" "on" "only" "open" "operation" "option" "or" "order" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1372 "ordinality" "out" "outer" "output" "pad" "parameter" "parameters" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1373 "partial" "path" "postfix" "prefix" "preorder" "prepare" "preserve" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1374 "primary" "prior" "privileges" "procedure" "public" "read" "reads" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1375 "recursive" "references" "referencing" "relative" "restrict" "result" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1376 "return" "returns" "revoke" "right" "role" "rollback" "rollup" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1377 "routine" "rows" "savepoint" "schema" "scroll" "search" "second" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1378 "section" "select" "sequence" "session" "set" "sets" "size" "some" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1379 "space" "specific" "specifictype" "sql" "sqlexception" "sqlstate" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1380 "sqlwarning" "start" "state" "statement" "static" "structure" "table" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1381 "temporary" "terminate" "than" "then" "timezone_hour" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1382 "timezone_minute" "to" "trailing" "transaction" "translation" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1383 "trigger" "true" "under" "union" "unique" "unknown" "unnest" "update" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1384 "usage" "using" "value" "values" "variable" "view" "when" "whenever" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1385 "where" "with" "without" "work" "write" "year" |
108381 | 1386 ) |
1387 | |
1388 ;; ANSI Functions | |
1389 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil | |
1390 "abs" "avg" "bit_length" "cardinality" "cast" "char_length" | |
1391 "character_length" "coalesce" "convert" "count" "current_date" | |
1392 "current_path" "current_role" "current_time" "current_timestamp" | |
1393 "current_user" "extract" "localtime" "localtimestamp" "lower" "max" | |
1394 "min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user" | |
1395 "substring" "sum" "system_user" "translate" "treat" "trim" "upper" | |
1396 "user" | |
1397 ) | |
1398 ;; ANSI Data Types | |
1399 (sql-font-lock-keywords-builder 'font-lock-type-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1400 "array" "binary" "bit" "blob" "boolean" "char" "character" "clob" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1401 "date" "dec" "decimal" "double" "float" "int" "integer" "interval" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1402 "large" "national" "nchar" "nclob" "numeric" "object" "precision" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1403 "real" "ref" "row" "scope" "smallint" "time" "timestamp" "varchar" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1404 "varying" "zone" |
108381 | 1405 )))) |
1406 | |
1407 (defvar sql-mode-ansi-font-lock-keywords | |
1408 (eval-when-compile sql-mode-ansi-font-lock-keywords) | |
24050 | 1409 "ANSI SQL keywords used by font-lock. |
1410 | |
1411 This variable is used by `sql-mode' and `sql-interactive-mode'. The | |
1412 regular expressions are created during compilation by calling the | |
1413 function `regexp-opt'. Therefore, take a look at the source before | |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1414 you define your own `sql-mode-ansi-font-lock-keywords'. You may want |
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1415 to add functions and PL/SQL keywords.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1416 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1417 (defvar sql-mode-oracle-font-lock-keywords |
108381 | 1418 (eval-when-compile |
1419 (list | |
1420 ;; Oracle SQL*Plus Commands | |
1421 (cons | |
1422 (concat | |
110309 | 1423 "^\\s-*\\(?:\\(?:" (regexp-opt '( |
108381 | 1424 "@" "@@" "accept" "append" "archive" "attribute" "break" |
1425 "btitle" "change" "clear" "column" "connect" "copy" "define" | |
1426 "del" "describe" "disconnect" "edit" "execute" "exit" "get" "help" | |
1427 "host" "input" "list" "password" "pause" "print" "prompt" "recover" | |
1428 "remark" "repfooter" "repheader" "run" "save" "show" "shutdown" | |
1429 "spool" "start" "startup" "store" "timing" "ttitle" "undefine" | |
1430 "variable" "whenever" | |
1431 ) t) | |
1432 | |
1433 "\\)\\|" | |
1434 "\\(?:compute\\s-+\\(?:avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|" | |
1435 "\\(?:set\\s-+\\(" | |
1436 | |
1437 (regexp-opt | |
1438 '("appi" "appinfo" "array" "arraysize" "auto" "autocommit" | |
1439 "autop" "autoprint" "autorecovery" "autot" "autotrace" "blo" | |
1440 "blockterminator" "buffer" "closecursor" "cmds" "cmdsep" | |
1441 "colsep" "com" "compatibility" "con" "concat" "constraint" | |
1442 "constraints" "copyc" "copycommit" "copytypecheck" "database" | |
1443 "def" "define" "document" "echo" "editf" "editfile" "emb" | |
1444 "embedded" "esc" "escape" "feed" "feedback" "flagger" "flu" | |
1445 "flush" "hea" "heading" "heads" "headsep" "instance" "lin" | |
1446 "linesize" "lobof" "loboffset" "logsource" "long" "longc" | |
1447 "longchunksize" "maxdata" "newp" "newpage" "null" "num" | |
1448 "numf" "numformat" "numwidth" "pages" "pagesize" "pau" | |
1449 "pause" "recsep" "recsepchar" "role" "scan" "serveroutput" | |
1450 "shift" "shiftinout" "show" "showmode" "space" "sqlbl" | |
1451 "sqlblanklines" "sqlc" "sqlcase" "sqlco" "sqlcontinue" "sqln" | |
1452 "sqlnumber" "sqlp" "sqlpluscompat" "sqlpluscompatibility" | |
1453 "sqlpre" "sqlprefix" "sqlprompt" "sqlt" "sqlterminator" | |
1454 "statement_id" "suf" "suffix" "tab" "term" "termout" "ti" | |
1455 "time" "timi" "timing" "transaction" "trim" "trimout" "trims" | |
1456 "trimspool" "truncate" "und" "underline" "ver" "verify" "wra" | |
1457 "wrap")) "\\)\\)" | |
1458 | |
1459 "\\)\\b.*" | |
1460 ) | |
1461 'font-lock-doc-face) | |
110309 | 1462 '("^\\s-*rem\\(?:ark\\)?\\>.*" . font-lock-comment-face) |
108381 | 1463 |
1464 ;; Oracle Functions | |
1465 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1466 "abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1467 "avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1468 "chr" "coalesce" "compose" "concat" "convert" "corr" "cos" "cosh" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1469 "count" "covar_pop" "covar_samp" "cume_dist" "current_date" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1470 "current_timestamp" "current_user" "dbtimezone" "decode" "decompose" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1471 "dense_rank" "depth" "deref" "dump" "empty_clob" "existsnode" "exp" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1472 "extract" "extractvalue" "first" "first_value" "floor" "following" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1473 "from_tz" "greatest" "group_id" "grouping_id" "hextoraw" "initcap" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1474 "instr" "lag" "last" "last_day" "last_value" "lead" "least" "length" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1475 "ln" "localtimestamp" "lower" "lpad" "ltrim" "make_ref" "max" "min" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1476 "mod" "months_between" "new_time" "next_day" "nls_charset_decl_len" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1477 "nls_charset_id" "nls_charset_name" "nls_initcap" "nls_lower" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1478 "nls_upper" "nlssort" "ntile" "nullif" "numtodsinterval" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1479 "numtoyminterval" "nvl" "nvl2" "over" "path" "percent_rank" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1480 "percentile_cont" "percentile_disc" "power" "preceding" "rank" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1481 "ratio_to_report" "rawtohex" "rawtonhex" "reftohex" "regr_" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1482 "regr_avgx" "regr_avgy" "regr_count" "regr_intercept" "regr_r2" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1483 "regr_slope" "regr_sxx" "regr_sxy" "regr_syy" "replace" "round" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1484 "row_number" "rowidtochar" "rowidtonchar" "rpad" "rtrim" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1485 "sessiontimezone" "sign" "sin" "sinh" "soundex" "sqrt" "stddev" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1486 "stddev_pop" "stddev_samp" "substr" "sum" "sys_connect_by_path" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1487 "sys_context" "sys_dburigen" "sys_extract_utc" "sys_guid" "sys_typeid" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1488 "sys_xmlagg" "sys_xmlgen" "sysdate" "systimestamp" "tan" "tanh" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1489 "to_char" "to_clob" "to_date" "to_dsinterval" "to_lob" "to_multi_byte" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1490 "to_nchar" "to_nclob" "to_number" "to_single_byte" "to_timestamp" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1491 "to_timestamp_tz" "to_yminterval" "translate" "treat" "trim" "trunc" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1492 "tz_offset" "uid" "unbounded" "unistr" "updatexml" "upper" "user" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1493 "userenv" "var_pop" "var_samp" "variance" "vsize" "width_bucket" "xml" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1494 "xmlagg" "xmlattribute" "xmlcolattval" "xmlconcat" "xmlelement" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1495 "xmlforest" "xmlsequence" "xmltransform" |
108381 | 1496 ) |
1497 ;; Oracle Keywords | |
1498 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1499 "abort" "access" "accessed" "account" "activate" "add" "admin" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1500 "advise" "after" "agent" "aggregate" "all" "allocate" "allow" "alter" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1501 "always" "analyze" "ancillary" "and" "any" "apply" "archive" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1502 "archivelog" "array" "as" "asc" "associate" "at" "attribute" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1503 "attributes" "audit" "authenticated" "authid" "authorization" "auto" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1504 "autoallocate" "automatic" "availability" "backup" "before" "begin" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1505 "behalf" "between" "binding" "bitmap" "block" "blocksize" "body" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1506 "both" "buffer_pool" "build" "by" "cache" "call" "cancel" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1507 "cascade" "case" "category" "certificate" "chained" "change" "check" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1508 "checkpoint" "child" "chunk" "class" "clear" "clone" "close" "cluster" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1509 "column" "column_value" "columns" "comment" "commit" "committed" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1510 "compatibility" "compile" "complete" "composite_limit" "compress" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1511 "compute" "connect" "connect_time" "consider" "consistent" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1512 "constraint" "constraints" "constructor" "contents" "context" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1513 "continue" "controlfile" "corruption" "cost" "cpu_per_call" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1514 "cpu_per_session" "create" "cross" "cube" "current" "currval" "cycle" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1515 "dangling" "data" "database" "datafile" "datafiles" "day" "ddl" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1516 "deallocate" "debug" "default" "deferrable" "deferred" "definer" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1517 "delay" "delete" "demand" "desc" "determines" "deterministic" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1518 "dictionary" "dimension" "directory" "disable" "disassociate" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1519 "disconnect" "distinct" "distinguished" "distributed" "dml" "drop" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1520 "each" "element" "else" "enable" "end" "equals_path" "escape" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1521 "estimate" "except" "exceptions" "exchange" "excluding" "exists" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1522 "expire" "explain" "extent" "external" "externally" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1523 "failed_login_attempts" "fast" "file" "final" "finish" "flush" "for" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1524 "force" "foreign" "freelist" "freelists" "freepools" "fresh" "from" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1525 "full" "function" "functions" "generated" "global" "global_name" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1526 "globally" "grant" "group" "grouping" "groups" "guard" "hash" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1527 "hashkeys" "having" "heap" "hierarchy" "id" "identified" "identifier" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1528 "idle_time" "immediate" "in" "including" "increment" "index" "indexed" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1529 "indexes" "indextype" "indextypes" "indicator" "initial" "initialized" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1530 "initially" "initrans" "inner" "insert" "instance" "instantiable" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1531 "instead" "intersect" "into" "invalidate" "is" "isolation" "java" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1532 "join" "keep" "key" "kill" "language" "left" "less" "level" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1533 "levels" "library" "like" "like2" "like4" "likec" "limit" "link" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1534 "list" "lob" "local" "location" "locator" "lock" "log" "logfile" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1535 "logging" "logical" "logical_reads_per_call" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1536 "logical_reads_per_session" "managed" "management" "manual" "map" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1537 "mapping" "master" "matched" "materialized" "maxdatafiles" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1538 "maxextents" "maximize" "maxinstances" "maxlogfiles" "maxloghistory" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1539 "maxlogmembers" "maxsize" "maxtrans" "maxvalue" "member" "memory" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1540 "merge" "migrate" "minextents" "minimize" "minimum" "minus" "minvalue" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1541 "mode" "modify" "monitoring" "month" "mount" "move" "movement" "name" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1542 "named" "natural" "nested" "never" "new" "next" "nextval" "no" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1543 "noarchivelog" "noaudit" "nocache" "nocompress" "nocopy" "nocycle" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1544 "nodelay" "noforce" "nologging" "nomapping" "nomaxvalue" "nominimize" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1545 "nominvalue" "nomonitoring" "none" "noorder" "noparallel" "norely" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1546 "noresetlogs" "noreverse" "normal" "norowdependencies" "nosort" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1547 "noswitch" "not" "nothing" "notimeout" "novalidate" "nowait" "null" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1548 "nulls" "object" "of" "off" "offline" "oidindex" "old" "on" "online" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1549 "only" "open" "operator" "optimal" "option" "or" "order" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1550 "organization" "out" "outer" "outline" "overflow" "overriding" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1551 "package" "packages" "parallel" "parallel_enable" "parameters" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1552 "parent" "partition" "partitions" "password" "password_grace_time" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1553 "password_life_time" "password_lock_time" "password_reuse_max" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1554 "password_reuse_time" "password_verify_function" "pctfree" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1555 "pctincrease" "pctthreshold" "pctused" "pctversion" "percent" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1556 "performance" "permanent" "pfile" "physical" "pipelined" "plan" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1557 "post_transaction" "pragma" "prebuilt" "preserve" "primary" "private" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1558 "private_sga" "privileges" "procedure" "profile" "protection" "public" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1559 "purge" "query" "quiesce" "quota" "range" "read" "reads" "rebuild" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1560 "records_per_block" "recover" "recovery" "recycle" "reduced" "ref" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1561 "references" "referencing" "refresh" "register" "reject" "relational" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1562 "rely" "rename" "reset" "resetlogs" "resize" "resolve" "resolver" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1563 "resource" "restrict" "restrict_references" "restricted" "result" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1564 "resumable" "resume" "retention" "return" "returning" "reuse" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1565 "reverse" "revoke" "rewrite" "right" "rnds" "rnps" "role" "roles" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1566 "rollback" "rollup" "row" "rowdependencies" "rownum" "rows" "sample" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1567 "savepoint" "scan" "schema" "scn" "scope" "segment" "select" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1568 "selectivity" "self" "sequence" "serializable" "session" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1569 "sessions_per_user" "set" "sets" "settings" "shared" "shared_pool" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1570 "shrink" "shutdown" "siblings" "sid" "single" "size" "skip" "some" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1571 "sort" "source" "space" "specification" "spfile" "split" "standby" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1572 "start" "statement_id" "static" "statistics" "stop" "storage" "store" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1573 "structure" "subpartition" "subpartitions" "substitutable" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1574 "successful" "supplemental" "suspend" "switch" "switchover" "synonym" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1575 "sys" "system" "table" "tables" "tablespace" "tempfile" "template" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1576 "temporary" "test" "than" "then" "thread" "through" "time_zone" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1577 "timeout" "to" "trace" "transaction" "trigger" "triggers" "truncate" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1578 "trust" "type" "types" "unarchived" "under" "under_path" "undo" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1579 "uniform" "union" "unique" "unlimited" "unlock" "unquiesce" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1580 "unrecoverable" "until" "unusable" "unused" "update" "upgrade" "usage" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1581 "use" "using" "validate" "validation" "value" "values" "variable" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1582 "varray" "version" "view" "wait" "when" "whenever" "where" "with" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1583 "without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype" |
108381 | 1584 ) |
1585 ;; Oracle Data Types | |
1586 (sql-font-lock-keywords-builder 'font-lock-type-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1587 "bfile" "blob" "byte" "char" "character" "clob" "date" "dec" "decimal" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1588 "double" "float" "int" "integer" "interval" "long" "national" "nchar" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1589 "nclob" "number" "numeric" "nvarchar2" "precision" "raw" "real" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1590 "rowid" "second" "smallint" "time" "timestamp" "urowid" "varchar" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1591 "varchar2" "varying" "year" "zone" |
108381 | 1592 ) |
1593 | |
1594 ;; Oracle PL/SQL Attributes | |
1595 (sql-font-lock-keywords-builder 'font-lock-builtin-face '("" . "\\b") | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1596 "%bulk_rowcount" "%found" "%isopen" "%notfound" "%rowcount" "%rowtype" |
108381 | 1597 "%type" |
1598 ) | |
1599 | |
1600 ;; Oracle PL/SQL Functions | |
1601 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil | |
1602 "extend" "prior" | |
1603 ) | |
1604 | |
1605 ;; Oracle PL/SQL Keywords | |
1606 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1607 "autonomous_transaction" "bulk" "char_base" "collect" "constant" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1608 "cursor" "declare" "do" "elsif" "exception_init" "execute" "exit" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1609 "extends" "false" "fetch" "forall" "goto" "hour" "if" "interface" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1610 "loop" "minute" "number_base" "ocirowid" "opaque" "others" "rowtype" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1611 "separate" "serially_reusable" "sql" "sqlcode" "sqlerrm" "subtype" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1612 "the" "timezone_abbr" "timezone_hour" "timezone_minute" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1613 "timezone_region" "true" "varrying" "while" |
108381 | 1614 ) |
1615 | |
1616 ;; Oracle PL/SQL Data Types | |
1617 (sql-font-lock-keywords-builder 'font-lock-type-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1618 "binary_integer" "boolean" "naturaln" "pls_integer" "positive" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1619 "positiven" "record" "signtype" "string" |
108381 | 1620 ) |
1621 | |
1622 ;; Oracle PL/SQL Exceptions | |
1623 (sql-font-lock-keywords-builder 'font-lock-warning-face nil | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1624 "access_into_null" "case_not_found" "collection_is_null" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1625 "cursor_already_open" "dup_val_on_index" "invalid_cursor" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1626 "invalid_number" "login_denied" "no_data_found" "not_logged_on" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1627 "program_error" "rowtype_mismatch" "self_is_null" "storage_error" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1628 "subscript_beyond_count" "subscript_outside_limit" "sys_invalid_rowid" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1629 "timeout_on_resource" "too_many_rows" "value_error" "zero_divide" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1630 "exception" "notfound" |
108381 | 1631 ))) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1632 |
24050 | 1633 "Oracle SQL keywords used by font-lock. |
1634 | |
1635 This variable is used by `sql-mode' and `sql-interactive-mode'. The | |
1636 regular expressions are created during compilation by calling the | |
1637 function `regexp-opt'. Therefore, take a look at the source before | |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1638 you define your own `sql-mode-oracle-font-lock-keywords'. You may want |
24050 | 1639 to add functions and PL/SQL keywords.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1640 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1641 (defvar sql-mode-postgres-font-lock-keywords |
108381 | 1642 (eval-when-compile |
1643 (list | |
110309 | 1644 ;; Postgres psql commands |
1645 '("^\\s-*\\\\.*$" . font-lock-doc-face) | |
1646 | |
1647 ;; Postgres unreserved words but may have meaning | |
1648 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil "a" | |
1649 "abs" "absent" "according" "ada" "alias" "allocate" "are" "array_agg" | |
1650 "asensitive" "atomic" "attribute" "attributes" "avg" "base64" | |
1651 "bernoulli" "bit_length" "bitvar" "blob" "blocked" "bom" "breadth" "c" | |
1652 "call" "cardinality" "catalog_name" "ceil" "ceiling" "char_length" | |
1653 "character_length" "character_set_catalog" "character_set_name" | |
1654 "character_set_schema" "characters" "checked" "class_origin" "clob" | |
1655 "cobol" "collation" "collation_catalog" "collation_name" | |
1656 "collation_schema" "collect" "column_name" "columns" | |
1657 "command_function" "command_function_code" "completion" "condition" | |
1658 "condition_number" "connect" "connection_name" "constraint_catalog" | |
1659 "constraint_name" "constraint_schema" "constructor" "contains" | |
1660 "control" "convert" "corr" "corresponding" "count" "covar_pop" | |
1661 "covar_samp" "cube" "cume_dist" "current_default_transform_group" | |
1662 "current_path" "current_transform_group_for_type" "cursor_name" | |
1663 "datalink" "datetime_interval_code" "datetime_interval_precision" "db" | |
1664 "defined" "degree" "dense_rank" "depth" "deref" "derived" "describe" | |
1665 "descriptor" "destroy" "destructor" "deterministic" "diagnostics" | |
1666 "disconnect" "dispatch" "dlnewcopy" "dlpreviouscopy" "dlurlcomplete" | |
1667 "dlurlcompleteonly" "dlurlcompletewrite" "dlurlpath" "dlurlpathonly" | |
1668 "dlurlpathwrite" "dlurlscheme" "dlurlserver" "dlvalue" "dynamic" | |
1669 "dynamic_function" "dynamic_function_code" "element" "empty" | |
1670 "end-exec" "equals" "every" "exception" "exec" "existing" "exp" "file" | |
1671 "filter" "final" "first_value" "flag" "floor" "fortran" "found" "free" | |
1672 "fs" "fusion" "g" "general" "generated" "get" "go" "goto" "grouping" | |
1673 "hex" "hierarchy" "host" "id" "ignore" "implementation" "import" | |
1674 "indent" "indicator" "infix" "initialize" "instance" "instantiable" | |
1675 "integrity" "intersection" "iterate" "k" "key_member" "key_type" "lag" | |
1676 "last_value" "lateral" "lead" "length" "less" "library" "like_regex" | |
1677 "link" "ln" "locator" "lower" "m" "map" "matched" "max" | |
1678 "max_cardinality" "member" "merge" "message_length" | |
1679 "message_octet_length" "message_text" "method" "min" "mod" "modifies" | |
1680 "modify" "module" "more" "multiset" "mumps" "namespace" "nclob" | |
1681 "nesting" "new" "nfc" "nfd" "nfkc" "nfkd" "nil" "normalize" | |
1682 "normalized" "nth_value" "ntile" "nullable" "number" | |
1683 "occurrences_regex" "octet_length" "octets" "old" "open" "operation" | |
1684 "ordering" "ordinality" "others" "output" "overriding" "p" "pad" | |
1685 "parameter" "parameter_mode" "parameter_name" | |
1686 "parameter_ordinal_position" "parameter_specific_catalog" | |
1687 "parameter_specific_name" "parameter_specific_schema" "parameters" | |
1688 "pascal" "passing" "passthrough" "percent_rank" "percentile_cont" | |
1689 "percentile_disc" "permission" "pli" "position_regex" "postfix" | |
1690 "power" "prefix" "preorder" "public" "rank" "reads" "recovery" "ref" | |
1691 "referencing" "regr_avgx" "regr_avgy" "regr_count" "regr_intercept" | |
1692 "regr_r2" "regr_slope" "regr_sxx" "regr_sxy" "regr_syy" "requiring" | |
1693 "respect" "restore" "result" "return" "returned_cardinality" | |
1694 "returned_length" "returned_octet_length" "returned_sqlstate" "rollup" | |
1695 "routine" "routine_catalog" "routine_name" "routine_schema" | |
1696 "row_count" "row_number" "scale" "schema_name" "scope" "scope_catalog" | |
1697 "scope_name" "scope_schema" "section" "selective" "self" "sensitive" | |
1698 "server_name" "sets" "size" "source" "space" "specific" | |
1699 "specific_name" "specifictype" "sql" "sqlcode" "sqlerror" | |
1700 "sqlexception" "sqlstate" "sqlwarning" "sqrt" "state" "static" | |
1701 "stddev_pop" "stddev_samp" "structure" "style" "subclass_origin" | |
1702 "sublist" "submultiset" "substring_regex" "sum" "system_user" "t" | |
1703 "table_name" "tablesample" "terminate" "than" "ties" "timezone_hour" | |
1704 "timezone_minute" "token" "top_level_count" "transaction_active" | |
1705 "transactions_committed" "transactions_rolled_back" "transform" | |
1706 "transforms" "translate" "translate_regex" "translation" | |
1707 "trigger_catalog" "trigger_name" "trigger_schema" "trim_array" | |
1708 "uescape" "under" "unlink" "unnamed" "unnest" "untyped" "upper" "uri" | |
1709 "usage" "user_defined_type_catalog" "user_defined_type_code" | |
1710 "user_defined_type_name" "user_defined_type_schema" "var_pop" | |
1711 "var_samp" "varbinary" "variable" "whenever" "width_bucket" "within" | |
1712 "xmlagg" "xmlbinary" "xmlcast" "xmlcomment" "xmldeclaration" | |
1713 "xmldocument" "xmlexists" "xmliterate" "xmlnamespaces" "xmlquery" | |
1714 "xmlschema" "xmltable" "xmltext" "xmlvalidate" | |
1715 ) | |
1716 | |
1717 ;; Postgres non-reserved words | |
108381 | 1718 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil |
110309 | 1719 "abort" "absolute" "access" "action" "add" "admin" "after" "aggregate" |
1720 "also" "alter" "always" "assertion" "assignment" "at" "backward" | |
1721 "before" "begin" "between" "by" "cache" "called" "cascade" "cascaded" | |
1722 "catalog" "chain" "characteristics" "checkpoint" "class" "close" | |
1723 "cluster" "coalesce" "comment" "comments" "commit" "committed" | |
1724 "configuration" "connection" "constraints" "content" "continue" | |
1725 "conversion" "copy" "cost" "createdb" "createrole" "createuser" "csv" | |
1726 "current" "cursor" "cycle" "data" "database" "day" "deallocate" "dec" | |
1727 "declare" "defaults" "deferred" "definer" "delete" "delimiter" | |
1728 "delimiters" "dictionary" "disable" "discard" "document" "domain" | |
1729 "drop" "each" "enable" "encoding" "encrypted" "enum" "escape" | |
1730 "exclude" "excluding" "exclusive" "execute" "exists" "explain" | |
1731 "external" "extract" "family" "first" "float" "following" "force" | |
1732 "forward" "function" "functions" "global" "granted" "greatest" | |
1733 "handler" "header" "hold" "hour" "identity" "if" "immediate" | |
1734 "immutable" "implicit" "including" "increment" "index" "indexes" | |
1735 "inherit" "inherits" "inline" "inout" "input" "insensitive" "insert" | |
1736 "instead" "invoker" "isolation" "key" "language" "large" "last" | |
1737 "lc_collate" "lc_ctype" "least" "level" "listen" "load" "local" | |
1738 "location" "lock" "login" "mapping" "match" "maxvalue" "minute" | |
1739 "minvalue" "mode" "month" "move" "name" "names" "national" "nchar" | |
1740 "next" "no" "nocreatedb" "nocreaterole" "nocreateuser" "noinherit" | |
1741 "nologin" "none" "nosuperuser" "nothing" "notify" "nowait" "nullif" | |
1742 "nulls" "object" "of" "oids" "operator" "option" "options" "out" | |
1743 "overlay" "owned" "owner" "parser" "partial" "partition" "password" | |
1744 "plans" "position" "preceding" "prepare" "prepared" "preserve" "prior" | |
1745 "privileges" "procedural" "procedure" "quote" "range" "read" | |
1746 "reassign" "recheck" "recursive" "reindex" "relative" "release" | |
1747 "rename" "repeatable" "replace" "replica" "reset" "restart" "restrict" | |
1748 "returns" "revoke" "role" "rollback" "row" "rows" "rule" "savepoint" | |
1749 "schema" "scroll" "search" "second" "security" "sequence" "sequences" | |
1750 "serializable" "server" "session" "set" "setof" "share" "show" | |
1751 "simple" "stable" "standalone" "start" "statement" "statistics" | |
1752 "stdin" "stdout" "storage" "strict" "strip" "substring" "superuser" | |
1753 "sysid" "system" "tables" "tablespace" "temp" "template" "temporary" | |
1754 "transaction" "treat" "trigger" "trim" "truncate" "trusted" "type" | |
1755 "unbounded" "uncommitted" "unencrypted" "unknown" "unlisten" "until" | |
1756 "update" "vacuum" "valid" "validator" "value" "values" "version" | |
1757 "view" "volatile" "whitespace" "work" "wrapper" "write" | |
1758 "xmlattributes" "xmlconcat" "xmlelement" "xmlforest" "xmlparse" | |
1759 "xmlpi" "xmlroot" "xmlserialize" "year" "yes" | |
108381 | 1760 ) |
110309 | 1761 |
108381 | 1762 ;; Postgres Reserved |
1763 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
110309 | 1764 "all" "analyse" "analyze" "and" "any" "array" "asc" "as" "asymmetric" |
1765 "authorization" "binary" "both" "case" "cast" "check" "collate" | |
1766 "column" "concurrently" "constraint" "create" "cross" | |
1767 "current_catalog" "current_date" "current_role" "current_schema" | |
1768 "current_time" "current_timestamp" "current_user" "default" | |
1769 "deferrable" "desc" "distinct" "do" "else" "end" "except" "false" | |
1770 "fetch" "foreign" "for" "freeze" "from" "full" "grant" "group" | |
1771 "having" "ilike" "initially" "inner" "in" "intersect" "into" "isnull" | |
1772 "is" "join" "leading" "left" "like" "limit" "localtime" | |
1773 "localtimestamp" "natural" "notnull" "not" "null" "off" "offset" | |
1774 "only" "on" "order" "or" "outer" "overlaps" "over" "placing" "primary" | |
1775 "references" "returning" "right" "select" "session_user" "similar" | |
1776 "some" "symmetric" "table" "then" "to" "trailing" "true" "union" | |
1777 "unique" "user" "using" "variadic" "verbose" "when" "where" "window" | |
1778 "with" | |
108381 | 1779 ) |
1780 | |
1781 ;; Postgres Data Types | |
1782 (sql-font-lock-keywords-builder 'font-lock-type-face nil | |
110309 | 1783 "bigint" "bigserial" "bit" "bool" "boolean" "box" "bytea" "char" |
1784 "character" "cidr" "circle" "date" "decimal" "double" "float4" | |
1785 "float8" "inet" "int" "int2" "int4" "int8" "integer" "interval" "line" | |
1786 "lseg" "macaddr" "money" "numeric" "path" "point" "polygon" | |
1787 "precision" "real" "serial" "serial4" "serial8" "smallint" "text" | |
1788 "time" "timestamp" "timestamptz" "timetz" "tsquery" "tsvector" | |
1789 "txid_snapshot" "uuid" "varbit" "varchar" "varying" "without" | |
1790 "xml" "zone" | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1791 ))) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1792 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1793 "Postgres SQL keywords used by font-lock. |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1794 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1795 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1796 regular expressions are created during compilation by calling the |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1797 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1798 you define your own `sql-mode-postgres-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1799 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1800 (defvar sql-mode-linter-font-lock-keywords |
108381 | 1801 (eval-when-compile |
1802 (list | |
1803 ;; Linter Keywords | |
1804 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1805 "autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1806 "committed" "count" "countblob" "cross" "current" "data" "database" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1807 "datafile" "datafiles" "datesplit" "dba" "dbname" "default" "deferred" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1808 "denied" "description" "device" "difference" "directory" "error" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1809 "escape" "euc" "exclusive" "external" "extfile" "false" "file" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1810 "filename" "filesize" "filetime" "filter" "findblob" "first" "foreign" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1811 "full" "fuzzy" "global" "granted" "ignore" "immediate" "increment" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1812 "indexes" "indexfile" "indexfiles" "indextime" "initial" "integrity" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1813 "internal" "key" "last_autoinc" "last_rowid" "limit" "linter" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1814 "linter_file_device" "linter_file_size" "linter_name_length" "ln" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1815 "local" "login" "maxisn" "maxrow" "maxrowid" "maxvalue" "message" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1816 "minvalue" "module" "names" "national" "natural" "new" "new_table" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1817 "no" "node" "noneuc" "nulliferror" "numbers" "off" "old" "old_table" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1818 "only" "operation" "optimistic" "option" "page" "partially" "password" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1819 "phrase" "plan" "precision" "primary" "priority" "privileges" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1820 "proc_info_size" "proc_par_name_len" "protocol" "quant" "range" "raw" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1821 "read" "record" "records" "references" "remote" "rename" "replication" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1822 "restart" "rewrite" "root" "row" "rule" "savepoint" "security" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1823 "sensitive" "sequence" "serializable" "server" "since" "size" "some" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1824 "startup" "statement" "station" "success" "sys_guid" "tables" "test" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1825 "timeout" "trace" "transaction" "translation" "trigger" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1826 "trigger_info_size" "true" "trunc" "uncommitted" "unicode" "unknown" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1827 "unlimited" "unlisted" "user" "utf8" "value" "varying" "volumes" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1828 "wait" "windows_code" "workspace" "write" "xml" |
108381 | 1829 ) |
1830 | |
1831 ;; Linter Reserved | |
1832 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1833 "access" "action" "add" "address" "after" "all" "alter" "always" "and" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1834 "any" "append" "as" "asc" "ascic" "async" "at_begin" "at_end" "audit" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1835 "aud_obj_name_len" "backup" "base" "before" "between" "blobfile" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1836 "blobfiles" "blobpct" "brief" "browse" "by" "case" "cast" "check" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1837 "clear" "close" "column" "comment" "commit" "connect" "contains" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1838 "correct" "create" "delete" "desc" "disable" "disconnect" "distinct" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1839 "drop" "each" "ef" "else" "enable" "end" "event" "except" "exclude" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1840 "execute" "exists" "extract" "fetch" "finish" "for" "from" "get" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1841 "grant" "group" "having" "identified" "in" "index" "inner" "insert" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1842 "instead" "intersect" "into" "is" "isolation" "join" "left" "level" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1843 "like" "lock" "mode" "modify" "not" "nowait" "null" "of" "on" "open" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1844 "or" "order" "outer" "owner" "press" "prior" "procedure" "public" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1845 "purge" "rebuild" "resource" "restrict" "revoke" "right" "role" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1846 "rollback" "rownum" "select" "session" "set" "share" "shutdown" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1847 "start" "stop" "sync" "synchronize" "synonym" "sysdate" "table" "then" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1848 "to" "union" "unique" "unlock" "until" "update" "using" "values" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1849 "view" "when" "where" "with" "without" |
108381 | 1850 ) |
1851 | |
1852 ;; Linter Functions | |
1853 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil | |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1854 "abs" "acos" "asin" "atan" "atan2" "avg" "ceil" "cos" "cosh" "divtime" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1855 "exp" "floor" "getbits" "getblob" "getbyte" "getlong" "getraw" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1856 "getstr" "gettext" "getword" "hextoraw" "lenblob" "length" "log" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1857 "lower" "lpad" "ltrim" "max" "min" "mod" "monthname" "nvl" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1858 "octet_length" "power" "rand" "rawtohex" "repeat_string" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1859 "right_substr" "round" "rpad" "rtrim" "sign" "sin" "sinh" "soundex" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1860 "sqrt" "sum" "tan" "tanh" "timeint_to_days" "to_char" "to_date" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1861 "to_gmtime" "to_localtime" "to_number" "trim" "upper" "decode" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1862 "substr" "substring" "chr" "dayname" "days" "greatest" "hex" "initcap" |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
1863 "instr" "least" "multime" "replace" "width" |
108381 | 1864 ) |
1865 | |
1866 ;; Linter Data Types | |
1867 (sql-font-lock-keywords-builder 'font-lock-type-face nil | |
1868 "bigint" "bitmap" "blob" "boolean" "char" "character" "date" | |
1869 "datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar" | |
1870 "number" "numeric" "real" "smallint" "varbyte" "varchar" "byte" | |
1871 "cursor" "long" | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1872 ))) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1873 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1874 "Linter SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1875 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1876 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1877 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1878 function `regexp-opt'.") |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1879 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1880 (defvar sql-mode-ms-font-lock-keywords |
108381 | 1881 (eval-when-compile |
1882 (list | |
1883 ;; MS isql/osql Commands | |
1884 (cons | |
1885 (concat | |
1886 "^\\(?:\\(?:set\\s-+\\(?:" | |
1887 (regexp-opt '( | |
1888 "datefirst" "dateformat" "deadlock_priority" "lock_timeout" | |
1889 "concat_null_yields_null" "cursor_close_on_commit" | |
1890 "disable_def_cnst_chk" "fips_flagger" "identity_insert" "language" | |
1891 "offsets" "quoted_identifier" "arithabort" "arithignore" "fmtonly" | |
1892 "nocount" "noexec" "numeric_roundabort" "parseonly" | |
1893 "query_governor_cost_limit" "rowcount" "textsize" "ansi_defaults" | |
1894 "ansi_null_dflt_off" "ansi_null_dflt_on" "ansi_nulls" "ansi_padding" | |
1895 "ansi_warnings" "forceplan" "showplan_all" "showplan_text" | |
1896 "statistics" "implicit_transactions" "remote_proc_transactions" | |
1897 "transaction" "xact_abort" | |
1898 ) t) | |
1899 "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$") | |
1900 'font-lock-doc-face) | |
1901 | |
1902 ;; MS Reserved | |
1903 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1904 "absolute" "add" "all" "alter" "and" "any" "as" "asc" "authorization" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1905 "avg" "backup" "begin" "between" "break" "browse" "bulk" "by" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1906 "cascade" "case" "check" "checkpoint" "close" "clustered" "coalesce" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1907 "column" "commit" "committed" "compute" "confirm" "constraint" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1908 "contains" "containstable" "continue" "controlrow" "convert" "count" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1909 "create" "cross" "current" "current_date" "current_time" |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1910 "current_timestamp" "current_user" "database" "deallocate" "declare" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1911 "default" "delete" "deny" "desc" "disk" "distinct" "distributed" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1912 "double" "drop" "dummy" "dump" "else" "end" "errlvl" "errorexit" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1913 "escape" "except" "exec" "execute" "exists" "exit" "fetch" "file" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1914 "fillfactor" "first" "floppy" "for" "foreign" "freetext" |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1915 "freetexttable" "from" "full" "goto" "grant" "group" "having" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1916 "holdlock" "identity" "identity_insert" "identitycol" "if" "in" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1917 "index" "inner" "insert" "intersect" "into" "is" "isolation" "join" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1918 "key" "kill" "last" "left" "level" "like" "lineno" "load" "max" "min" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1919 "mirrorexit" "national" "next" "nocheck" "nolock" "nonclustered" "not" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1920 "null" "nullif" "of" "off" "offsets" "on" "once" "only" "open" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1921 "opendatasource" "openquery" "openrowset" "option" "or" "order" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1922 "outer" "output" "over" "paglock" "percent" "perm" "permanent" "pipe" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1923 "plan" "precision" "prepare" "primary" "print" "prior" "privileges" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1924 "proc" "procedure" "processexit" "public" "raiserror" "read" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1925 "readcommitted" "readpast" "readtext" "readuncommitted" "reconfigure" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1926 "references" "relative" "repeatable" "repeatableread" "replication" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1927 "restore" "restrict" "return" "revoke" "right" "rollback" "rowcount" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1928 "rowguidcol" "rowlock" "rule" "save" "schema" "select" "serializable" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1929 "session_user" "set" "shutdown" "some" "statistics" "sum" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1930 "system_user" "table" "tablock" "tablockx" "tape" "temp" "temporary" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1931 "textsize" "then" "to" "top" "tran" "transaction" "trigger" "truncate" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1932 "tsequal" "uncommitted" "union" "unique" "update" "updatetext" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1933 "updlock" "use" "user" "values" "view" "waitfor" "when" "where" |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1934 "while" "with" "work" "writetext" "collate" "function" "openxml" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1935 "returns" |
108381 | 1936 ) |
1937 | |
1938 ;; MS Functions | |
1939 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1940 "@@connections" "@@cpu_busy" "@@cursor_rows" "@@datefirst" "@@dbts" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1941 "@@error" "@@fetch_status" "@@identity" "@@idle" "@@io_busy" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1942 "@@langid" "@@language" "@@lock_timeout" "@@max_connections" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1943 "@@max_precision" "@@nestlevel" "@@options" "@@pack_received" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1944 "@@pack_sent" "@@packet_errors" "@@procid" "@@remserver" "@@rowcount" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1945 "@@servername" "@@servicename" "@@spid" "@@textsize" "@@timeticks" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1946 "@@total_errors" "@@total_read" "@@total_write" "@@trancount" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1947 "@@version" "abs" "acos" "and" "app_name" "ascii" "asin" "atan" "atn2" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1948 "avg" "case" "cast" "ceiling" "char" "charindex" "coalesce" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1949 "col_length" "col_name" "columnproperty" "containstable" "convert" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1950 "cos" "cot" "count" "current_timestamp" "current_user" "cursor_status" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1951 "databaseproperty" "datalength" "dateadd" "datediff" "datename" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1952 "datepart" "day" "db_id" "db_name" "degrees" "difference" "exp" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1953 "file_id" "file_name" "filegroup_id" "filegroup_name" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1954 "filegroupproperty" "fileproperty" "floor" "formatmessage" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1955 "freetexttable" "fulltextcatalogproperty" "fulltextserviceproperty" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1956 "getansinull" "getdate" "grouping" "host_id" "host_name" "ident_incr" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1957 "ident_seed" "identity" "index_col" "indexproperty" "is_member" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1958 "is_srvrolemember" "isdate" "isnull" "isnumeric" "left" "len" "log" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1959 "log10" "lower" "ltrim" "max" "min" "month" "nchar" "newid" "nullif" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1960 "object_id" "object_name" "objectproperty" "openquery" "openrowset" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1961 "parsename" "patindex" "patindex" "permissions" "pi" "power" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1962 "quotename" "radians" "rand" "replace" "replicate" "reverse" "right" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1963 "round" "rtrim" "session_user" "sign" "sin" "soundex" "space" "sqrt" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1964 "square" "stats_date" "stdev" "stdevp" "str" "stuff" "substring" "sum" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1965 "suser_id" "suser_name" "suser_sid" "suser_sname" "system_user" "tan" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1966 "textptr" "textvalid" "typeproperty" "unicode" "upper" "user" |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1967 "user_id" "user_name" "var" "varp" "year" |
108381 | 1968 ) |
1969 | |
1970 ;; MS Variables | |
1971 '("\\b@[a-zA-Z0-9_]*\\b" . font-lock-variable-name-face) | |
1972 | |
1973 ;; MS Types | |
1974 (sql-font-lock-keywords-builder 'font-lock-type-face nil | |
1975 "binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal" | |
1976 "double" "float" "image" "int" "integer" "money" "national" "nchar" | |
1977 "ntext" "numeric" "numeric" "nvarchar" "precision" "real" | |
1978 "smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint" | |
1979 "uniqueidentifier" "varbinary" "varchar" "varying" | |
1980 ))) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1981 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1982 "Microsoft SQLServer SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1983 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1984 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1985 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1986 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1987 you define your own `sql-mode-ms-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1988 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1989 (defvar sql-mode-sybase-font-lock-keywords nil |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1990 "Sybase SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1991 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1992 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1993 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1994 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1995 you define your own `sql-mode-sybase-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1996 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
1997 (defvar sql-mode-informix-font-lock-keywords nil |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1998 "Informix SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
1999 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2000 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2001 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2002 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2003 you define your own `sql-mode-informix-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2004 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2005 (defvar sql-mode-interbase-font-lock-keywords nil |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2006 "Interbase SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2007 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2008 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2009 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2010 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2011 you define your own `sql-mode-interbase-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2012 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2013 (defvar sql-mode-ingres-font-lock-keywords nil |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2014 "Ingres SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2015 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2016 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2017 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2018 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2019 you define your own `sql-mode-interbase-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2020 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2021 (defvar sql-mode-solid-font-lock-keywords nil |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2022 "Solid SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2023 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2024 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2025 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2026 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2027 you define your own `sql-mode-solid-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2028 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2029 (defvar sql-mode-mysql-font-lock-keywords |
108381 | 2030 (eval-when-compile |
2031 (list | |
2032 ;; MySQL Functions | |
2033 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2034 "ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2035 "bdpolyfromwkb" "benchmark" "bin" "bit_and" "bit_length" "bit_or" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2036 "bit_xor" "both" "cast" "char_length" "character_length" "coalesce" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2037 "concat" "concat_ws" "connection_id" "conv" "convert" "count" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2038 "curdate" "current_date" "current_time" "current_timestamp" "curtime" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2039 "elt" "encrypt" "export_set" "field" "find_in_set" "found_rows" "from" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2040 "geomcollfromtext" "geomcollfromwkb" "geometrycollectionfromtext" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2041 "geometrycollectionfromwkb" "geometryfromtext" "geometryfromwkb" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2042 "geomfromtext" "geomfromwkb" "get_lock" "group_concat" "hex" "ifnull" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2043 "instr" "interval" "isnull" "last_insert_id" "lcase" "leading" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2044 "length" "linefromtext" "linefromwkb" "linestringfromtext" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2045 "linestringfromwkb" "load_file" "locate" "lower" "lpad" "ltrim" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2046 "make_set" "master_pos_wait" "max" "mid" "min" "mlinefromtext" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2047 "mlinefromwkb" "mpointfromtext" "mpointfromwkb" "mpolyfromtext" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2048 "mpolyfromwkb" "multilinestringfromtext" "multilinestringfromwkb" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2049 "multipointfromtext" "multipointfromwkb" "multipolygonfromtext" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2050 "multipolygonfromwkb" "now" "nullif" "oct" "octet_length" "ord" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2051 "pointfromtext" "pointfromwkb" "polyfromtext" "polyfromwkb" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2052 "polygonfromtext" "polygonfromwkb" "position" "quote" "rand" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2053 "release_lock" "repeat" "replace" "reverse" "rpad" "rtrim" "soundex" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2054 "space" "std" "stddev" "substring" "substring_index" "sum" "sysdate" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2055 "trailing" "trim" "ucase" "unix_timestamp" "upper" "user" "variance" |
108381 | 2056 ) |
2057 | |
2058 ;; MySQL Keywords | |
2059 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2060 "action" "add" "after" "against" "all" "alter" "and" "as" "asc" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2061 "auto_increment" "avg_row_length" "bdb" "between" "by" "cascade" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2062 "case" "change" "character" "check" "checksum" "close" "collate" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2063 "collation" "column" "columns" "comment" "committed" "concurrent" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2064 "constraint" "create" "cross" "data" "database" "default" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2065 "delay_key_write" "delayed" "delete" "desc" "directory" "disable" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2066 "distinct" "distinctrow" "do" "drop" "dumpfile" "duplicate" "else" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2067 "enable" "enclosed" "end" "escaped" "exists" "fields" "first" "for" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2068 "force" "foreign" "from" "full" "fulltext" "global" "group" "handler" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2069 "having" "heap" "high_priority" "if" "ignore" "in" "index" "infile" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2070 "inner" "insert" "insert_method" "into" "is" "isam" "isolation" "join" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2071 "key" "keys" "last" "left" "level" "like" "limit" "lines" "load" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2072 "local" "lock" "low_priority" "match" "max_rows" "merge" "min_rows" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2073 "mode" "modify" "mrg_myisam" "myisam" "natural" "next" "no" "not" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2074 "null" "offset" "oj" "on" "open" "optionally" "or" "order" "outer" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2075 "outfile" "pack_keys" "partial" "password" "prev" "primary" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2076 "procedure" "quick" "raid0" "raid_type" "read" "references" "rename" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2077 "repeatable" "restrict" "right" "rollback" "rollup" "row_format" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2078 "savepoint" "select" "separator" "serializable" "session" "set" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2079 "share" "show" "sql_big_result" "sql_buffer_result" "sql_cache" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2080 "sql_calc_found_rows" "sql_no_cache" "sql_small_result" "starting" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2081 "straight_join" "striped" "table" "tables" "temporary" "terminated" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2082 "then" "to" "transaction" "truncate" "type" "uncommitted" "union" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2083 "unique" "unlock" "update" "use" "using" "values" "when" "where" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2084 "with" "write" "xor" |
108381 | 2085 ) |
2086 | |
2087 ;; MySQL Data Types | |
2088 (sql-font-lock-keywords-builder 'font-lock-type-face nil | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2089 "bigint" "binary" "bit" "blob" "bool" "boolean" "char" "curve" "date" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2090 "datetime" "dec" "decimal" "double" "enum" "fixed" "float" "geometry" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2091 "geometrycollection" "int" "integer" "line" "linearring" "linestring" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2092 "longblob" "longtext" "mediumblob" "mediumint" "mediumtext" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2093 "multicurve" "multilinestring" "multipoint" "multipolygon" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2094 "multisurface" "national" "numeric" "point" "polygon" "precision" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2095 "real" "smallint" "surface" "text" "time" "timestamp" "tinyblob" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2096 "tinyint" "tinytext" "unsigned" "varchar" "year" "year2" "year4" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2097 "zerofill" |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2098 ))) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2099 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2100 "MySQL SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2101 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2102 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2103 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2104 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2105 you define your own `sql-mode-mysql-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2106 |
109681
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2107 (defvar sql-mode-sqlite-font-lock-keywords |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2108 (eval-when-compile |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2109 (list |
110309 | 2110 ;; SQLite commands |
2111 '("^[.].*$" . font-lock-doc-face) | |
2112 | |
109681
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2113 ;; SQLite Keyword |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2114 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2115 "abort" "action" "add" "after" "all" "alter" "analyze" "and" "as" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2116 "asc" "attach" "autoincrement" "before" "begin" "between" "by" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2117 "cascade" "case" "cast" "check" "collate" "column" "commit" "conflict" |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2118 "constraint" "create" "cross" "database" "default" "deferrable" |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2119 "deferred" "delete" "desc" "detach" "distinct" "drop" "each" "else" |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2120 "end" "escape" "except" "exclusive" "exists" "explain" "fail" "for" |
109681
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2121 "foreign" "from" "full" "glob" "group" "having" "if" "ignore" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2122 "immediate" "in" "index" "indexed" "initially" "inner" "insert" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2123 "instead" "intersect" "into" "is" "isnull" "join" "key" "left" "like" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2124 "limit" "match" "natural" "no" "not" "notnull" "null" "of" "offset" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2125 "on" "or" "order" "outer" "plan" "pragma" "primary" "query" "raise" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2126 "references" "regexp" "reindex" "release" "rename" "replace" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2127 "restrict" "right" "rollback" "row" "savepoint" "select" "set" "table" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2128 "temp" "temporary" "then" "to" "transaction" "trigger" "union" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2129 "unique" "update" "using" "vacuum" "values" "view" "virtual" "when" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2130 "where" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2131 ) |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2132 ;; SQLite Data types |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2133 (sql-font-lock-keywords-builder 'font-lock-type-face nil |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2134 "int" "integer" "tinyint" "smallint" "mediumint" "bigint" "unsigned" |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2135 "big" "int2" "int8" "character" "varchar" "varying" "nchar" "native" |
109681
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2136 "nvarchar" "text" "clob" "blob" "real" "double" "precision" "float" |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2137 "numeric" "number" "decimal" "boolean" "date" "datetime" |
109681
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2138 ) |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2139 ;; SQLite Functions |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2140 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2141 ;; Core functions |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2142 "abs" "changes" "coalesce" "glob" "ifnull" "hex" "last_insert_rowid" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2143 "length" "like" "load_extension" "lower" "ltrim" "max" "min" "nullif" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2144 "quote" "random" "randomblob" "replace" "round" "rtrim" "soundex" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2145 "sqlite_compileoption_get" "sqlite_compileoption_used" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2146 "sqlite_source_id" "sqlite_version" "substr" "total_changes" "trim" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2147 "typeof" "upper" "zeroblob" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2148 ;; Date/time functions |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2149 "time" "julianday" "strftime" |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2150 "current_date" "current_time" "current_timestamp" |
109681
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2151 ;; Aggregate functions |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2152 "avg" "count" "group_concat" "max" "min" "sum" "total" |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2153 ))) |
232ba164887b
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
Michael Mauger <mmaug@yahoo.com>
parents:
109489
diff
changeset
|
2154 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2155 "SQLite SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2156 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2157 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2158 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2159 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2160 you define your own `sql-mode-sqlite-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2161 |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2162 (defvar sql-mode-db2-font-lock-keywords nil |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2163 "DB2 SQL keywords used by font-lock. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2164 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2165 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2166 regular expressions are created during compilation by calling the |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2167 function `regexp-opt'. Therefore, take a look at the source before |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2168 you define your own `sql-mode-db2-font-lock-keywords'.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2169 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2170 (defvar sql-mode-font-lock-keywords nil |
24050 | 2171 "SQL keywords used by font-lock. |
2172 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2173 Setting this variable directly no longer has any affect. Use |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2174 `sql-product' and `sql-add-product-keywords' to control the |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2175 highlighting rules in SQL mode.") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2176 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2177 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2178 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2179 ;;; SQL Product support functions |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2180 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2181 (defun sql-read-product (prompt &optional initial) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2182 "Read a valid SQL product." |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2183 (let ((init (or (and initial (symbol-name initial)) "ansi"))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2184 (intern (completing-read |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2185 prompt |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2186 (mapcar (lambda (info) (symbol-name (car info))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2187 sql-product-alist) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2188 nil 'require-match |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2189 init 'sql-product-history init)))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2190 |
108381 | 2191 (defun sql-add-product (product display &rest plist) |
2192 "Add support for a database product in `sql-mode'. | |
2193 | |
2194 Add PRODUCT to `sql-product-alist' which enables `sql-mode' to | |
2195 properly support syntax highlighting and interactive interaction. | |
2196 DISPLAY is the name of the SQL product that will appear in the | |
2197 menu bar and in messages. PLIST initializes the product | |
2198 configuration." | |
2199 | |
2200 ;; Don't do anything if the product is already supported | |
2201 (if (assoc product sql-product-alist) | |
2202 (message "Product `%s' is already defined" product) | |
2203 | |
2204 ;; Add product to the alist | |
2205 (add-to-list 'sql-product-alist `((,product :name ,display . ,plist))) | |
2206 ;; Add a menu item to the SQL->Product menu | |
2207 (easy-menu-add-item sql-mode-menu '("Product") | |
2208 ;; Each product is represented by a radio | |
2209 ;; button with it's display name. | |
2210 `[,display | |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
2211 (sql-set-product ',product) |
108381 | 2212 :style radio |
2213 :selected (eq sql-product ',product)] | |
2214 ;; Maintain the product list in | |
2215 ;; (case-insensitive) alphabetic order of the | |
2216 ;; display names. Loop thru each keymap item | |
2217 ;; looking for an item whose display name is | |
2218 ;; after this product's name. | |
2219 (let ((next-item) | |
2220 (down-display (downcase display))) | |
2221 (map-keymap (lambda (k b) | |
2222 (when (and (not next-item) | |
2223 (string-lessp down-display | |
2224 (downcase (cadr b)))) | |
2225 (setq next-item k))) | |
2226 (easy-menu-get-map sql-mode-menu '("Product"))) | |
2227 next-item)) | |
2228 product)) | |
2229 | |
2230 (defun sql-del-product (product) | |
2231 "Remove support for PRODUCT in `sql-mode'." | |
2232 | |
2233 ;; Remove the menu item based on the display name | |
2234 (easy-menu-remove-item sql-mode-menu '("Product") (sql-get-product-feature product :name)) | |
2235 ;; Remove the product alist item | |
2236 (setq sql-product-alist (assq-delete-all product sql-product-alist)) | |
2237 nil) | |
2238 | |
2239 (defun sql-set-product-feature (product feature newvalue) | |
2240 "Set FEATURE of database PRODUCT to NEWVALUE. | |
2241 | |
2242 The PRODUCT must be a symbol which identifies the database | |
2243 product. The product must have already exist on the product | |
2244 list. See `sql-add-product' to add new products. The FEATURE | |
2245 argument must be a plist keyword accepted by | |
2246 `sql-product-alist'." | |
2247 | |
2248 (let* ((p (assoc product sql-product-alist)) | |
2249 (v (plist-get (cdr p) feature))) | |
2250 (if p | |
2251 (if (and | |
2252 (member feature sql-indirect-features) | |
2253 (symbolp v)) | |
2254 (set v newvalue) | |
2255 (setcdr p (plist-put (cdr p) feature newvalue))) | |
2256 (message "`%s' is not a known product; use `sql-add-product' to add it first." product)))) | |
2257 | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2258 (defun sql-get-product-feature (product feature &optional fallback not-indirect) |
108381 | 2259 "Lookup FEATURE associated with a SQL PRODUCT. |
2260 | |
2261 If the FEATURE is nil for PRODUCT, and FALLBACK is specified, | |
2262 then the FEATURE associated with the FALLBACK product is | |
2263 returned. | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2264 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2265 If the FEATURE is in the list `sql-indirect-features', and the |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2266 NOT-INDIRECT parameter is not set, then the value of the symbol |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2267 stored in the connect alist is returned. |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2268 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2269 See `sql-product-alist' for a list of products and supported features." |
108381 | 2270 (let* ((p (assoc product sql-product-alist)) |
2271 (v (plist-get (cdr p) feature))) | |
2272 | |
2273 (if p | |
2274 ;; If no value and fallback, lookup feature for fallback | |
2275 (if (and (not v) | |
2276 fallback | |
2277 (not (eq product fallback))) | |
2278 (sql-get-product-feature fallback feature) | |
2279 | |
2280 (if (and | |
2281 (member feature sql-indirect-features) | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2282 (not not-indirect) |
108381 | 2283 (symbolp v)) |
2284 (symbol-value v) | |
2285 v)) | |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
2286 (message "`%s' is not a known product; use `sql-add-product' to add it first." product) |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
2287 nil))) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2288 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2289 (defun sql-product-font-lock (keywords-only imenu) |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2290 "Configure font-lock and imenu with product-specific settings. |
108381 | 2291 |
2292 The KEYWORDS-ONLY flag is passed to font-lock to specify whether | |
2293 only keywords should be hilighted and syntactic hilighting | |
2294 skipped. The IMENU flag indicates whether `imenu-mode' should | |
2295 also be configured." | |
2296 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2297 (let |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2298 ;; Get the product-specific syntax-alist. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2299 ((syntax-alist |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2300 (append |
108381 | 2301 (sql-get-product-feature sql-product :syntax-alist) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2302 '((?_ . "w") (?. . "w"))))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2303 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2304 ;; Get the product-specific keywords. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2305 (setq sql-mode-font-lock-keywords |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2306 (append |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2307 (unless (eq sql-product 'ansi) |
108381 | 2308 (sql-get-product-feature sql-product :font-lock)) |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2309 ;; Always highlight ANSI keywords |
108381 | 2310 (sql-get-product-feature 'ansi :font-lock) |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2311 ;; Fontify object names in CREATE, DROP and ALTER DDL |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2312 ;; statements |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2313 (list sql-mode-font-lock-object-name))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2314 |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2315 ;; Setup font-lock. Force re-parsing of `font-lock-defaults'. |
108381 | 2316 (kill-local-variable 'font-lock-set-defaults) |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2317 (setq font-lock-defaults (list 'sql-mode-font-lock-keywords |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2318 keywords-only t syntax-alist)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2319 |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2320 ;; Force font lock to reinitialize if it is already on |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2321 ;; Otherwise, we can wait until it can be started. |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2322 (when (and (fboundp 'font-lock-mode) |
108381 | 2323 (boundp 'font-lock-mode) |
55370
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2324 font-lock-mode) |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2325 (font-lock-mode-internal nil) |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2326 (font-lock-mode-internal t)) |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2327 |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2328 (add-hook 'font-lock-mode-hook |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2329 (lambda () |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2330 ;; Provide defaults for new font-lock faces. |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2331 (defvar font-lock-builtin-face |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2332 (if (boundp 'font-lock-preprocessor-face) |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2333 font-lock-preprocessor-face |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2334 font-lock-keyword-face)) |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2335 (defvar font-lock-doc-face font-lock-string-face)) |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2336 nil t) |
f714f103b48a
(sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55241
diff
changeset
|
2337 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2338 ;; Setup imenu; it needs the same syntax-alist. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2339 (when imenu |
108381 | 2340 (setq imenu-syntax-alist syntax-alist)))) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2341 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2342 ;;;###autoload |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2343 (defun sql-add-product-keywords (product keywords &optional append) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2344 "Add highlighting KEYWORDS for SQL PRODUCT. |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2345 |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2346 PRODUCT should be a symbol, the name of a SQL product, such as |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2347 `oracle'. KEYWORDS should be a list; see the variable |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2348 `font-lock-keywords'. By default they are added at the beginning |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2349 of the current highlighting list. If optional argument APPEND is |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2350 `set', they are used to replace the current highlighting list. |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2351 If APPEND is any other non-nil value, they are added at the end |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2352 of the current highlighting list. |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2353 |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2354 For example: |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2355 |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2356 (sql-add-product-keywords 'ms |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2357 '((\"\\\\b\\\\w+_t\\\\b\" . font-lock-type-face))) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2358 |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2359 adds a fontification pattern to fontify identifiers ending in |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2360 `_t' as data types." |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2361 |
108381 | 2362 (let* ((sql-indirect-features nil) |
2363 (font-lock-var (sql-get-product-feature product :font-lock)) | |
2364 (old-val)) | |
2365 | |
2366 (setq old-val (symbol-value font-lock-var)) | |
2367 (set font-lock-var | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2368 (if (eq append 'set) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2369 keywords |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2370 (if append |
108381 | 2371 (append old-val keywords) |
2372 (append keywords old-val)))))) | |
24050 | 2373 |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2374 (defun sql-for-each-login (login-params body) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2375 "Iterates through login parameters and returns a list of results." |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2376 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2377 (delq nil |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2378 (mapcar |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2379 (lambda (param) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2380 (let ((token (or (and (listp param) (car param)) param)) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2381 (plist (or (and (listp param) (cdr param)) nil))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2382 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2383 (funcall body token plist))) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2384 login-params))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2385 |
24050 | 2386 |
30905
2069c10bf952
(sql-magic-go): Use comint-bol.
Gerd Moellmann <gerd@gnu.org>
parents:
30838
diff
changeset
|
2387 |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2388 ;;; Functions to switch highlighting |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2389 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2390 (defun sql-highlight-product () |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2391 "Turn on the font highlighting for the SQL product selected." |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
2392 (when (derived-mode-p 'sql-mode) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2393 ;; Setup font-lock |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2394 (sql-product-font-lock nil t) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2395 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2396 ;; Set the mode name to include the product. |
108381 | 2397 (setq mode-name (concat "SQL[" (or (sql-get-product-feature sql-product :name) |
2398 (symbol-name sql-product)) "]")))) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2399 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2400 (defun sql-set-product (product) |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2401 "Set `sql-product' to PRODUCT and enable appropriate highlighting." |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
2402 (interactive |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2403 (list (sql-read-product "SQL product: "))) |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
2404 (if (stringp product) (setq product (intern product))) |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
2405 (when (not (assoc product sql-product-alist)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2406 (error "SQL product %s is not supported; treated as ANSI" product) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2407 (setq product 'ansi)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2408 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2409 ;; Save product setting and fontify. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2410 (setq sql-product product) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
2411 (sql-highlight-product)) |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2412 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2413 |
30838
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2414 ;;; Compatibility functions |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2415 |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2416 (if (not (fboundp 'comint-line-beginning-position)) |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2417 ;; comint-line-beginning-position is defined in Emacs 21 |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2418 (defun comint-line-beginning-position () |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2419 "Return the buffer position of the beginning of the line, after any prompt. |
30838
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2420 The prompt is assumed to be any text at the beginning of the line matching |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2421 the regular expression `comint-prompt-regexp', a buffer local variable." |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2422 (save-excursion (comint-bol nil) (point)))) |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2423 |
c9f793802722
Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents:
30642
diff
changeset
|
2424 |
24050 | 2425 |
2426 ;;; Small functions | |
2427 | |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2428 (defun sql-magic-go (arg) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2429 "Insert \"o\" and call `comint-send-input'. |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2430 `sql-electric-stuff' must be the symbol `go'." |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2431 (interactive "P") |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2432 (self-insert-command (prefix-numeric-value arg)) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2433 (if (and (equal sql-electric-stuff 'go) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2434 (save-excursion |
30642
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2435 (comint-bol nil) |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2436 (looking-at "go\\b"))) |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2437 (comint-send-input))) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2438 |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2439 (defun sql-magic-semicolon (arg) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2440 "Insert semicolon and call `comint-send-input'. |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2441 `sql-electric-stuff' must be the symbol `semicolon'." |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2442 (interactive "P") |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2443 (self-insert-command (prefix-numeric-value arg)) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2444 (if (equal sql-electric-stuff 'semicolon) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2445 (comint-send-input))) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2446 |
24050 | 2447 (defun sql-accumulate-and-indent () |
2448 "Continue SQL statement on the next line." | |
2449 (interactive) | |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
2450 (if (fboundp 'comint-accumulate) |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2451 (comint-accumulate) |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
2452 (newline)) |
24050 | 2453 (indent-according-to-mode)) |
2454 | |
108381 | 2455 (defun sql-help-list-products (indent freep) |
2456 "Generate listing of products available for use under SQLi. | |
2457 | |
2458 List products with :free-softare attribute set to FREEP. Indent | |
2459 each line with INDENT." | |
2460 | |
2461 (let (sqli-func doc) | |
2462 (setq doc "") | |
2463 (dolist (p sql-product-alist) | |
2464 (setq sqli-func (intern (concat "sql-" (symbol-name (car p))))) | |
2465 | |
2466 (if (and (fboundp sqli-func) | |
2467 (eq (sql-get-product-feature (car p) :free-software) freep)) | |
2468 (setq doc | |
2469 (concat doc | |
2470 indent | |
2471 (or (sql-get-product-feature (car p) :name) | |
2472 (symbol-name (car p))) | |
2473 ":\t" | |
2474 "\\[" | |
2475 (symbol-name sqli-func) | |
2476 "]\n")))) | |
2477 doc)) | |
2478 | |
24050 | 2479 ;;;###autoload |
2480 (defun sql-help () | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
2481 "Show short help for the SQL modes. |
24050 | 2482 |
2483 Use an entry function to open an interactive SQL buffer. This buffer is | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2484 usually named `*SQL*'. The name of the major mode is SQLi. |
24050 | 2485 |
2486 Use the following commands to start a specific SQL interpreter: | |
2487 | |
108381 | 2488 \\\\FREE |
24268 | 2489 |
2490 Other non-free SQL implementations are also supported: | |
2491 | |
108381 | 2492 \\\\NONFREE |
24268 | 2493 |
2494 But we urge you to choose a free implementation instead of these. | |
24050 | 2495 |
108381 | 2496 You can also use \\[sql-product-interactive] to invoke the |
2497 interpreter for the current `sql-product'. | |
2498 | |
24050 | 2499 Once you have the SQLi buffer, you can enter SQL statements in the |
2500 buffer. The output generated is appended to the buffer and a new prompt | |
2501 is generated. See the In/Out menu in the SQLi buffer for some functions | |
2502 that help you navigate through the buffer, the input history, etc. | |
2503 | |
2504 If you have a really complex SQL statement or if you are writing a | |
2505 procedure, you can do this in a separate buffer. Put the new buffer in | |
2506 `sql-mode' by calling \\[sql-mode]. The name of this buffer can be | |
2507 anything. The name of the major mode is SQL. | |
2508 | |
2509 In this SQL buffer (SQL mode), you can send the region or the entire | |
2510 buffer to the interactive SQL buffer (SQLi mode). The results are | |
2511 appended to the SQLi buffer without disturbing your SQL buffer." | |
2512 (interactive) | |
108381 | 2513 |
2514 ;; Insert references to loaded products into the help buffer string | |
2515 (let ((doc (documentation 'sql-help t)) | |
2516 changedp) | |
2517 (setq changedp nil) | |
2518 | |
2519 ;; Insert FREE software list | |
2520 (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*\n" doc 0) | |
2521 (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t) | |
2522 t t doc 0) | |
2523 changedp t)) | |
2524 | |
2525 ;; Insert non-FREE software list | |
2526 (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*\n" doc 0) | |
2527 (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil) | |
2528 t t doc 0) | |
2529 changedp t)) | |
2530 | |
2531 ;; If we changed the help text, save the change so that the help | |
2532 ;; sub-system will see it | |
2533 (when changedp | |
2534 (put 'sql-help 'function-documentation doc))) | |
2535 | |
2536 ;; Call help on this function | |
24050 | 2537 (describe-function 'sql-help)) |
2538 | |
2539 (defun sql-read-passwd (prompt &optional default) | |
64837
f80fef683ab5
(sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
64699
diff
changeset
|
2540 "Read a password using PROMPT. Optional DEFAULT is password to start with." |
f80fef683ab5
(sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents:
64699
diff
changeset
|
2541 (read-passwd prompt nil default)) |
24050 | 2542 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2543 (defun sql-get-login-ext (prompt last-value history-var plist) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2544 "Prompt user with extended login parameters. |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2545 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2546 If PLIST is nil, then the user is simply prompted for a string |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2547 value. |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2548 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2549 The property `:default' specifies the default value. If the |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2550 `:number' property is non-nil then ask for a number. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2551 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2552 The `:file' property prompts for a file name that must match the |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2553 regexp pattern specified in its value. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2554 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2555 The `:completion' property prompts for a string specified by its |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2556 value. (The property value is used as the PREDICATE argument to |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2557 `completing-read'.)" |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2558 (let* ((default (plist-get plist :default)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2559 (prompt-def |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2560 (if default |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2561 (if (string-match "\\(\\):[ \t]*\\'" prompt) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2562 (replace-match (format " (default \"%s\")" default) t t prompt 1) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2563 (replace-regexp-in-string "[ \t]*\\'" |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2564 (format " (default \"%s\") " default) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2565 prompt t t)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2566 prompt)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2567 (use-dialog-box nil)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2568 (cond |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2569 ((plist-member plist :file) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2570 (expand-file-name |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2571 (read-file-name prompt |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2572 (file-name-directory last-value) default t |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2573 (file-name-nondirectory last-value) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2574 (when (plist-get plist :file) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2575 `(lambda (f) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2576 (string-match |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2577 (concat "\\<" ,(plist-get plist :file) "\\>") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2578 (file-name-nondirectory f))))))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2579 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2580 ((plist-member plist :completion) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2581 (completing-read prompt-def (plist-get plist :completion) nil t |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2582 last-value history-var default)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2583 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2584 ((plist-get plist :number) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2585 (read-number prompt (or default last-value 0))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2586 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2587 (t |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2588 (let ((r (read-from-minibuffer prompt-def last-value nil nil history-var nil))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2589 (if (string= "" r) (or default "") r)))))) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2590 |
24050 | 2591 (defun sql-get-login (&rest what) |
2592 "Get username, password and database from the user. | |
2593 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2594 The variables `sql-user', `sql-password', `sql-server', and |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
2595 `sql-database' can be customized. They are used as the default values. |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2596 Usernames, servers and databases are stored in `sql-user-history', |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2597 `sql-server-history' and `database-history'. Passwords are not stored |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2598 in a history. |
24050 | 2599 |
108381 | 2600 Parameter WHAT is a list of tokens passed as arguments in the |
2601 function call. The function asks for the username if WHAT | |
2602 contains the symbol `user', for the password if it contains the | |
2603 symbol `password', for the server if it contains the symbol | |
2604 `server', and for the database if it contains the symbol | |
2605 `database'. The members of WHAT are processed in the order in | |
2606 which they are provided. | |
24050 | 2607 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2608 Each token may also be a list with the token in the car and a |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2609 plist of options as the cdr. The following properties are |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2610 supported: |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2611 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2612 :file <filename-regexp> |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2613 :completion <list-of-strings-or-function> |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2614 :default <default-value> |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2615 :number t |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2616 |
24050 | 2617 In order to ask the user for username, password and database, call the |
2618 function like this: (sql-get-login 'user 'password 'database)." | |
2619 (interactive) | |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2620 (mapcar |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2621 (lambda (w) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2622 (let ((token (or (and (consp w) (car w)) w)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2623 (plist (or (and (consp w) (cdr w)) nil))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2624 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2625 (cond |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2626 ((eq token 'user) ; user |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2627 (setq sql-user |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2628 (sql-get-login-ext "User: " sql-user |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2629 'sql-user-history plist))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2630 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2631 ((eq token 'password) ; password |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2632 (setq sql-password |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2633 (sql-read-passwd "Password: " sql-password))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2634 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2635 ((eq token 'server) ; server |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2636 (setq sql-server |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2637 (sql-get-login-ext "Server: " sql-server |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2638 'sql-server-history plist))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2639 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2640 ((eq token 'database) ; database |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2641 (setq sql-database |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2642 (sql-get-login-ext "Database: " sql-database |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2643 'sql-database-history plist))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2644 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2645 ((eq token 'port) ; port |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2646 (setq sql-port |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2647 (sql-get-login-ext "Port: " sql-port |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2648 nil (append '(:number t) plist))))))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2649 what)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2650 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2651 (defun sql-find-sqli-buffer (&optional product) |
110309 | 2652 "Returns the name of the current default SQLi buffer or nil. |
2653 In order to qualify, the SQLi buffer must be alive, be in | |
2654 `sql-interactive-mode' and have a process." | |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2655 (let ((buf sql-buffer) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2656 (prod (or product sql-product))) |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2657 (or |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2658 ;; Current sql-buffer, if there is one. |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2659 (and (sql-buffer-live-p buf prod) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2660 buf) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2661 ;; Global sql-buffer |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2662 (and (setq buf (default-value 'sql-buffer)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2663 (sql-buffer-live-p buf prod) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2664 buf) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2665 ;; Look thru each buffer |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2666 (car (apply 'append |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2667 (mapcar (lambda (b) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2668 (and (sql-buffer-live-p b prod) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2669 (list (buffer-name b)))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2670 (buffer-list))))))) |
26576
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2671 |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2672 (defun sql-set-sqli-buffer-generally () |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
2673 "Set SQLi buffer for all SQL buffers that have none. |
26576
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2674 This function checks all SQL buffers for their SQLi buffer. If their |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2675 SQLi buffer is nonexistent or has no process, it is set to the current |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2676 default SQLi buffer. The current default SQLi buffer is determined |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2677 using `sql-find-sqli-buffer'. If `sql-buffer' is set, |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2678 `sql-set-sqli-hook' is run." |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2679 (interactive) |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2680 (save-excursion |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2681 (let ((buflist (buffer-list)) |
110309 | 2682 (default-buffer (sql-find-sqli-buffer))) |
2683 (setq-default sql-buffer default-buffer) | |
26576
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2684 (while (not (null buflist)) |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2685 (let ((candidate (car buflist))) |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2686 (set-buffer candidate) |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
2687 (if (and (derived-mode-p 'sql-mode) |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2688 (not (sql-buffer-live-p sql-buffer))) |
26576
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2689 (progn |
110309 | 2690 (setq sql-buffer default-buffer) |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2691 (when default-buffer |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2692 (run-hooks 'sql-set-sqli-hook))))) |
26576
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2693 (setq buflist (cdr buflist)))))) |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2694 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2695 (defun sql-set-sqli-buffer () |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2696 "Set the SQLi buffer SQL strings are sent to. |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2697 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2698 Call this function in a SQL buffer in order to set the SQLi buffer SQL |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2699 strings are sent to. Calling this function sets `sql-buffer' and runs |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2700 `sql-set-sqli-hook'. |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2701 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2702 If you call it from a SQL buffer, this sets the local copy of |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
2703 `sql-buffer'. |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2704 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2705 If you call it from anywhere else, it sets the global copy of |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2706 `sql-buffer'." |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2707 (interactive) |
26576
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2708 (let ((default-buffer (sql-find-sqli-buffer))) |
0894b3c8dfd6
(sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
25826
diff
changeset
|
2709 (if (null default-buffer) |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2710 (error "There is no suitable SQLi buffer") |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2711 (let ((new-buffer (read-buffer "New SQLi buffer: " default-buffer t))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2712 (if (null (sql-buffer-live-p new-buffer)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2713 (error "Buffer %s is not a working SQLi buffer" new-buffer) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2714 (when new-buffer |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2715 (setq sql-buffer new-buffer) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2716 (run-hooks 'sql-set-sqli-hook))))))) |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2717 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2718 (defun sql-show-sqli-buffer () |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2719 "Show the name of current SQLi buffer. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2720 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2721 This is the buffer SQL strings are sent to. It is stored in the |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2722 variable `sql-buffer'. See `sql-help' on how to create such a buffer." |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2723 (interactive) |
110309 | 2724 (if (null (buffer-live-p (get-buffer sql-buffer))) |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2725 (message "%s has no SQLi buffer set." (buffer-name (current-buffer))) |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2726 (if (null (get-buffer-process sql-buffer)) |
110309 | 2727 (message "Buffer %s has no process." sql-buffer) |
2728 (message "Current SQLi buffer is %s." sql-buffer)))) | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
2729 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2730 (defun sql-make-alternate-buffer-name () |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2731 "Return a string that can be used to rename a SQLi buffer. |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2732 |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2733 This is used to set `sql-alternate-buffer-name' within |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2734 `sql-interactive-mode'. |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2735 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2736 If the session was started with `sql-connect' then the alternate |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2737 name would be the name of the connection. |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2738 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2739 Otherwise, it uses the parameters identified by the :sqlilogin |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2740 parameter. |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2741 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2742 If all else fails, the alternate name would be the user and |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2743 server/database name." |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
2744 |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
2745 (let ((name "")) |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
2746 |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2747 ;; Build a name using the :sqli-login setting |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2748 (setq name |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2749 (apply 'concat |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2750 (cdr |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2751 (apply 'append nil |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2752 (sql-for-each-login |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2753 (sql-get-product-feature sql-product :sqli-login) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2754 (lambda (token plist) |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2755 (cond |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2756 ((eq token 'user) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2757 (unless (string= "" sql-user) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2758 (list "/" sql-user))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2759 ((eq token 'port) |
110309 | 2760 (unless (or (not (numberp sql-port)) |
2761 (= 0 sql-port)) | |
2762 (list ":" (number-to-string sql-port)))) | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2763 ((eq token 'server) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2764 (unless (string= "" sql-server) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2765 (list "." |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2766 (if (plist-member plist :file) |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2767 (file-name-nondirectory sql-server) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2768 sql-server)))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2769 ((eq token 'database) |
110309 | 2770 (unless (string= "" sql-database) |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2771 (list "@" |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
2772 (if (plist-member plist :file) |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2773 (file-name-nondirectory sql-database) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2774 sql-database)))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2775 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2776 ((eq token 'password) nil) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2777 (t nil)))))))) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2778 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2779 ;; If there's a connection, use it and the name thus far |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
2780 (if sql-connection |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
2781 (format "<%s>%s" sql-connection (or name "")) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2782 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2783 ;; If there is no name, try to create something meaningful |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2784 (if (string= "" (or name "")) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2785 (concat |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2786 (if (string= "" sql-user) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2787 (if (string= "" (user-login-name)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2788 () |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2789 (concat (user-login-name) "/")) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2790 (concat sql-user "/")) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2791 (if (string= "" sql-database) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2792 (if (string= "" sql-server) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2793 (system-name) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2794 sql-server) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2795 sql-database)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
2796 |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2797 ;; Use the name we've got |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2798 name)))) |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2799 |
110309 | 2800 (defun sql-rename-buffer (&optional new-name) |
2801 "Rename a SQL interactive buffer. | |
2802 | |
2803 Prompts for the new name if command is preceeded by | |
2804 \\[universal-argument]. If no buffer name is provided, then the | |
2805 `sql-alternate-buffer-name' is used. | |
2806 | |
2807 The actual buffer name set will be \"*SQL: NEW-NAME*\". If | |
2808 NEW-NAME is empty, then the buffer name will be \"*SQL*\"." | |
2809 (interactive "P") | |
2810 | |
2811 (if (not (derived-mode-p 'sql-interactive-mode)) | |
2812 (message "Current buffer is not a SQL interactive buffer") | |
2813 | |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2814 (setq sql-alternate-buffer-name |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2815 (cond |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2816 ((stringp new-name) new-name) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2817 ((consp new-name) |
110309 | 2818 (read-string "Buffer name (\"*SQL: XXX*\"; enter `XXX'): " |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2819 sql-alternate-buffer-name)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
2820 (t sql-alternate-buffer-name))) |
110309 | 2821 |
2822 (rename-buffer (if (string= "" sql-alternate-buffer-name) | |
2823 "*SQL*" | |
2824 (format "*SQL: %s*" sql-alternate-buffer-name)) | |
2825 t))) | |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
2826 |
24050 | 2827 (defun sql-copy-column () |
2828 "Copy current column to the end of buffer. | |
2829 Inserts SELECT or commas if appropriate." | |
2830 (interactive) | |
2831 (let ((column)) | |
2832 (save-excursion | |
108381 | 2833 (setq column (buffer-substring-no-properties |
24050 | 2834 (progn (forward-char 1) (backward-sexp 1) (point)) |
2835 (progn (forward-sexp 1) (point)))) | |
2836 (goto-char (point-max)) | |
30642
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2837 (let ((bol (comint-line-beginning-position))) |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2838 (cond |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2839 ;; if empty command line, insert SELECT |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2840 ((= bol (point)) |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2841 (insert "SELECT ")) |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2842 ;; else if appending to INTO .* (, SELECT or ORDER BY, insert a comma |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2843 ((save-excursion |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2844 (re-search-backward "\\b\\(\\(into\\s-+\\S-+\\s-+(\\)\\|select\\|order by\\) .+" |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2845 bol t)) |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2846 (insert ", ")) |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2847 ;; else insert a space |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2848 (t |
64052
68f51d595f7f
(SQL): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents:
63410
diff
changeset
|
2849 (if (eq (preceding-char) ?\s) |
30642
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2850 nil |
ae938744b6b1
(sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents:
30513
diff
changeset
|
2851 (insert " "))))) |
24050 | 2852 ;; in any case, insert the column |
2853 (insert column) | |
2854 (message "%s" column)))) | |
2855 | |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2856 ;; On Windows, SQL*Plus for Oracle turns on full buffering for stdout |
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
2857 ;; if it is not attached to a character device; therefore placeholder |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
2858 ;; replacement by SQL*Plus is fully buffered. The workaround lets |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
2859 ;; Emacs query for the placeholders. |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
2860 |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
2861 (defvar sql-placeholder-history nil |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
2862 "History of placeholder values used.") |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
2863 |
108381 | 2864 (defun sql-placeholders-filter (string) |
2865 "Replace placeholders in STRING. | |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2866 Placeholders are words starting with an ampersand like &this." |
108381 | 2867 |
2868 (when sql-oracle-scan-on | |
2869 (while (string-match "&\\(\\sw+\\)" string) | |
2870 (setq string (replace-match | |
2871 (read-from-minibuffer | |
2872 (format "Enter value for %s: " (match-string 1 string)) | |
2873 nil nil nil 'sql-placeholder-history) | |
2874 t t string)))) | |
2875 string) | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
2876 |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2877 ;; Using DB2 interactively, newlines must be escaped with " \". |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2878 ;; The space before the backslash is relevant. |
108381 | 2879 (defun sql-escape-newlines-filter (string) |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2880 "Escape newlines in STRING. |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2881 Every newline in STRING will be preceded with a space and a backslash." |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2882 (let ((result "") (start 0) mb me) |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2883 (while (string-match "\n" string start) |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2884 (setq mb (match-beginning 0) |
108381 | 2885 me (match-end 0) |
2886 result (concat result | |
2887 (substring string start mb) | |
2888 (if (and (> mb 1) | |
2889 (string-equal " \\" (substring string (- mb 2) mb))) | |
2890 "" " \\\n")) | |
2891 start me)) | |
2892 (concat result (substring string start)))) | |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
2893 |
24050 | 2894 |
2895 | |
108381 | 2896 ;;; Input sender for SQLi buffers |
2897 | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2898 (defvar sql-output-newline-count 0 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2899 "Number of newlines in the input string. |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2900 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2901 Allows the suppression of continuation prompts.") |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2902 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2903 (defvar sql-output-by-send nil |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2904 "Non-nil if the command in the input was generated by `sql-send-string'.") |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2905 |
108381 | 2906 (defun sql-input-sender (proc string) |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
2907 "Send STRING to PROC after applying filters." |
108381 | 2908 |
2909 (let* ((product (with-current-buffer (process-buffer proc) sql-product)) | |
2910 (filter (sql-get-product-feature product :input-filter))) | |
2911 | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2912 ;; Apply filter(s) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2913 (cond |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2914 ((not filter) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2915 nil) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2916 ((functionp filter) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2917 (setq string (funcall filter string))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2918 ((listp filter) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2919 (mapc (lambda (f) (setq string (funcall f string))) filter)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2920 (t nil)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2921 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2922 ;; Count how many newlines in the string |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2923 (setq sql-output-newline-count 0) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2924 (mapc (lambda (ch) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2925 (when (eq ch ?\n) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2926 (setq sql-output-newline-count (1+ sql-output-newline-count)))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2927 string) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2928 |
108381 | 2929 ;; Send the string |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2930 (comint-simple-send proc string))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2931 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2932 ;;; Strip out continuation prompts |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2933 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2934 (defun sql-interactive-remove-continuation-prompt (oline) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2935 "Strip out continuation prompts out of the OLINE. |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2936 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2937 Added to the `comint-preoutput-filter-functions' hook in a SQL |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2938 interactive buffer. If `sql-outut-newline-count' is greater than |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2939 zero, then an output line matching the continuation prompt is filtered |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2940 out. If the count is one, then the prompt is replaced with a newline |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2941 to force the output from the query to appear on a new line." |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2942 (if (and sql-prompt-cont-regexp |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2943 sql-output-newline-count |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2944 (numberp sql-output-newline-count) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2945 (>= sql-output-newline-count 1)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2946 (progn |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2947 (while (and oline |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2948 sql-output-newline-count |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2949 (> sql-output-newline-count 0) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2950 (string-match sql-prompt-cont-regexp oline)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2951 |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2952 (setq oline |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2953 (replace-match (if (and |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2954 (= 1 sql-output-newline-count) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2955 sql-output-by-send) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2956 "\n" "") |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2957 nil nil oline) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2958 sql-output-newline-count |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2959 (1- sql-output-newline-count))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2960 (if (= sql-output-newline-count 0) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2961 (setq sql-output-newline-count nil)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2962 (setq sql-output-by-send nil)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2963 (setq sql-output-newline-count nil)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2964 oline) |
108381 | 2965 |
24050 | 2966 ;;; Sending the region to the SQLi buffer. |
2967 | |
108381 | 2968 (defun sql-send-string (str) |
2969 "Send the string STR to the SQL process." | |
2970 (interactive "sSQL Text: ") | |
2971 | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2972 (let ((comint-input-sender-no-newline nil) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2973 (s (replace-regexp-in-string "[[:space:]\n\r]+\\'" "" str))) |
110309 | 2974 (if (sql-buffer-live-p sql-buffer) |
108381 | 2975 (progn |
2976 ;; Ignore the hoping around... | |
2977 (save-excursion | |
2978 ;; Set product context | |
2979 (with-current-buffer sql-buffer | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2980 ;; Send the string (trim the trailing whitespace) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2981 (sql-input-sender (get-buffer-process sql-buffer) s) |
108381 | 2982 |
2983 ;; Send a command terminator if we must | |
2984 (if sql-send-terminator | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
2985 (sql-send-magic-terminator sql-buffer s sql-send-terminator)) |
108381 | 2986 |
110309 | 2987 (message "Sent string to buffer %s." sql-buffer))) |
108381 | 2988 |
2989 ;; Display the sql buffer | |
2990 (if sql-pop-to-buffer-after-send-region | |
2991 (pop-to-buffer sql-buffer) | |
2992 (display-buffer sql-buffer))) | |
2993 | |
2994 ;; We don't have no stinkin' sql | |
2995 (message "No SQL process started.")))) | |
2996 | |
24050 | 2997 (defun sql-send-region (start end) |
2998 "Send a region to the SQL process." | |
2999 (interactive "r") | |
108381 | 3000 (sql-send-string (buffer-substring-no-properties start end))) |
24050 | 3001 |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3002 (defun sql-send-paragraph () |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3003 "Send the current paragraph to the SQL process." |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3004 (interactive) |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3005 (let ((start (save-excursion |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3006 (backward-paragraph) |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3007 (point))) |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3008 (end (save-excursion |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3009 (forward-paragraph) |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3010 (point)))) |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3011 (sql-send-region start end))) |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3012 |
24050 | 3013 (defun sql-send-buffer () |
3014 "Send the buffer contents to the SQL process." | |
3015 (interactive) | |
3016 (sql-send-region (point-min) (point-max))) | |
3017 | |
108381 | 3018 (defun sql-send-magic-terminator (buf str terminator) |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
3019 "Send TERMINATOR to buffer BUF if its not present in STR." |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3020 (let (comint-input-sender-no-newline pat term) |
108381 | 3021 ;; If flag is merely on(t), get product-specific terminator |
3022 (if (eq terminator t) | |
3023 (setq terminator (sql-get-product-feature sql-product :terminator))) | |
3024 | |
3025 ;; If there is no terminator specified, use default ";" | |
3026 (unless terminator | |
3027 (setq terminator ";")) | |
3028 | |
3029 ;; Parse the setting into the pattern and the terminator string | |
3030 (cond ((stringp terminator) | |
3031 (setq pat (regexp-quote terminator) | |
3032 term terminator)) | |
3033 ((consp terminator) | |
3034 (setq pat (car terminator) | |
3035 term (cdr terminator))) | |
3036 (t | |
3037 nil)) | |
3038 | |
3039 ;; Check to see if the pattern is present in the str already sent | |
3040 (unless (and pat term | |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3041 (string-match (concat pat "\\'") str)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3042 (comint-simple-send (get-buffer-process buf) term) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3043 (setq sql-output-newline-count |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3044 (if sql-output-newline-count |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3045 (1+ sql-output-newline-count) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3046 1))) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3047 (setq sql-output-by-send t))) |
108381 | 3048 |
3049 (defun sql-remove-tabs-filter (str) | |
3050 "Replace tab characters with spaces." | |
3051 (replace-regexp-in-string "\t" " " str nil t)) | |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
3052 |
24050 | 3053 (defun sql-toggle-pop-to-buffer-after-send-region (&optional value) |
3054 "Toggle `sql-pop-to-buffer-after-send-region'. | |
3055 | |
3056 If given the optional parameter VALUE, sets | |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3057 `sql-toggle-pop-to-buffer-after-send-region' to VALUE." |
24050 | 3058 (interactive "P") |
3059 (if value | |
3060 (setq sql-pop-to-buffer-after-send-region value) | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3061 (setq sql-pop-to-buffer-after-send-region |
108381 | 3062 (null sql-pop-to-buffer-after-send-region)))) |
24050 | 3063 |
3064 | |
3065 | |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3066 ;;; Redirect output functions |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3067 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3068 (defun sql-redirect (command combuf &optional outbuf save-prior) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3069 "Execute the SQL command and send output to OUTBUF. |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3070 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3071 COMBUF must be an active SQL interactive buffer. OUTBUF may be |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3072 an existing buffer, or the name of a non-existing buffer. If |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3073 omitted the output is sent to a temporary buffer which will be |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3074 killed after the command completes. COMMAND should be a string |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3075 of commands accepted by the SQLi program." |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3076 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3077 (with-current-buffer combuf |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3078 (let ((buf (get-buffer-create (or outbuf " *SQL-Redirect*"))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3079 (proc (get-buffer-process (current-buffer))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3080 (comint-prompt-regexp (sql-get-product-feature sql-product |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3081 :prompt-regexp)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3082 (start nil)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3083 (with-current-buffer buf |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3084 (toggle-read-only -1) |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3085 (unless save-prior |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3086 (erase-buffer)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3087 (goto-char (point-max)) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3088 (unless (zerop (buffer-size)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3089 (insert "\n")) |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3090 (setq start (point))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3091 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3092 ;; Run the command |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3093 (message "Executing SQL command...") |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3094 (comint-redirect-send-command-to-process command buf proc nil t) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3095 (while (null comint-redirect-completed) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3096 (accept-process-output nil 1)) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3097 (message "Executing SQL command...done") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3098 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3099 ;; Clean up the output results |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3100 (with-current-buffer buf |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3101 ;; Remove trailing whitespace |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3102 (goto-char (point-max)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3103 (when (looking-back "[ \t\f\n\r]*" start) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3104 (delete-region (match-beginning 0) (match-end 0))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3105 ;; Remove echo if there was one |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3106 (goto-char start) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3107 (when (looking-at (concat "^" (regexp-quote command) "[\\n]")) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3108 (delete-region (match-beginning 0) (match-end 0))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3109 (goto-char start))))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3110 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3111 (defun sql-redirect-value (command combuf regexp &optional regexp-groups) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3112 "Execute the SQL command and return part of result. |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3113 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3114 COMBUF must be an active SQL interactive buffer. COMMAND should |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3115 be a string of commands accepted by the SQLi program. From the |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3116 output, the REGEXP is repeatedly matched and the list of |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3117 REGEXP-GROUPS submatches is returned. This behaves much like |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3118 \\[comint-redirect-results-list-from-process] but instead of |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3119 returning a single submatch it returns a list of each submatch |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3120 for each match." |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3121 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3122 (let ((outbuf " *SQL-Redirect-values*") |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3123 (results nil)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3124 (sql-redirect command combuf outbuf nil) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3125 (with-current-buffer outbuf |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3126 (while (re-search-forward regexp nil t) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3127 (push |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3128 (cond |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3129 ;; no groups-return all of them |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3130 ((null regexp-groups) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3131 (let ((i 1) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3132 (r nil)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3133 (while (match-beginning i) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3134 (push (match-string i) r)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3135 (nreverse r))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3136 ;; one group specified |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3137 ((numberp regexp-groups) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3138 (match-string regexp-groups)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3139 ;; list of numbers; return the specified matches only |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3140 ((consp regexp-groups) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3141 (mapcar (lambda (c) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3142 (cond |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3143 ((numberp c) (match-string c)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3144 ((stringp c) (match-substitute-replacement c)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3145 (t (error "sql-redirect-value: unknown REGEXP-GROUPS value - %s" c)))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3146 regexp-groups)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3147 ;; String is specified; return replacement string |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3148 ((stringp regexp-groups) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3149 (match-substitute-replacement regexp-groups)) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3150 (t |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3151 (error "sql-redirect-value: unknown REGEXP-GROUPS value - %s" |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3152 regexp-groups))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3153 results))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3154 (nreverse results))) |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3155 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3156 (defun sql-execute (sqlbuf outbuf command arg) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3157 "Executes a command in a SQL interacive buffer and captures the output. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3158 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3159 The commands are run in SQLBUF and the output saved in OUTBUF. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3160 COMMAND must be a string, a function or a list of such elements. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3161 Functions are called with SQLBUF, OUTBUF and ARG as parameters; |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3162 strings are formatted with ARG and executed. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3163 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3164 If the results are empty the OUTBUF is deleted, otherwise the |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3165 buffer is popped into a view window. " |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3166 (mapc |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3167 (lambda (c) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3168 (cond |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3169 ((stringp c) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3170 (sql-redirect (if arg (format c arg) c) sqlbuf outbuf) t) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3171 ((functionp c) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3172 (apply c sqlbuf outbuf arg)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3173 (t (error "Unknown sql-execute item %s" c)))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3174 (if (consp command) command (cons command nil))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3175 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3176 (setq outbuf (get-buffer outbuf)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3177 (if (zerop (buffer-size outbuf)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3178 (kill-buffer outbuf) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3179 (let ((one-win (eq (selected-window) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3180 (get-lru-window)))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3181 (with-current-buffer outbuf |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3182 (set-buffer-modified-p nil) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3183 (toggle-read-only 1)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3184 (view-buffer-other-window outbuf) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3185 (when one-win |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3186 (shrink-window-if-larger-than-buffer))))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3187 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3188 (defun sql-execute-feature (sqlbuf outbuf feature enhanced arg) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3189 "List objects or details in a separate display buffer." |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3190 (let (command) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3191 (with-current-buffer sqlbuf |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3192 (setq command (sql-get-product-feature sql-product feature))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3193 (unless command |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3194 (error "%s does not support %s" sql-product feature)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3195 (when (consp command) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3196 (setq command (if enhanced |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3197 (cdr command) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3198 (car command)))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3199 (sql-execute sqlbuf outbuf command arg))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3200 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3201 (defun sql-read-table-name (prompt) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3202 "Read the name of a database table." |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3203 ;; TODO: Fetch table/view names from database and provide completion. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3204 ;; Also implement thing-at-point if the buffer has valid names in it |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3205 ;; (i.e. sql-mode, sql-interactive-mode, or sql-list-all buffers) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3206 (read-from-minibuffer prompt)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3207 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3208 (defun sql-list-all (&optional enhanced) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3209 "List all database objects." |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3210 (interactive "P") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3211 (let ((sqlbuf (sql-find-sqli-buffer))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3212 (unless sqlbuf |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3213 (error "No SQL interactive buffer found")) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3214 (sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3215 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3216 (defun sql-list-table (name &optional enhanced) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3217 "List the details of a database table. " |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3218 (interactive |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3219 (list (sql-read-table-name "Table name: ") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3220 current-prefix-arg)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3221 (let ((sqlbuf (sql-find-sqli-buffer))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3222 (unless sqlbuf |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3223 (error "No SQL interactive buffer found")) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3224 (unless name |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3225 (error "No table name specified")) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3226 (sql-execute-feature sqlbuf (format "*List %s*" name) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3227 :list-table enhanced name))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3228 |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3229 |
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3230 |
24050 | 3231 ;;; SQL mode -- uses SQL interactive mode |
3232 | |
3233 ;;;###autoload | |
3234 (defun sql-mode () | |
3235 "Major mode to edit SQL. | |
3236 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3237 You can send SQL statements to the SQLi buffer using |
24050 | 3238 \\[sql-send-region]. Such a buffer must exist before you can do this. |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3239 See `sql-help' on how to create SQLi buffers. |
24050 | 3240 |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3241 \\{sql-mode-map} |
24050 | 3242 Customization: Entry to this mode runs the `sql-mode-hook'. |
3243 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3244 When you put a buffer in SQL mode, the buffer stores the last SQLi |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3245 buffer created as its destination in the variable `sql-buffer'. This |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3246 will be the buffer \\[sql-send-region] sends the region to. If this |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3247 SQLi buffer is killed, \\[sql-send-region] is no longer able to |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3248 determine where the strings should be sent to. You can set the |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3249 value of `sql-buffer' using \\[sql-set-sqli-buffer]. |
24050 | 3250 |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3251 For information on how to create multiple SQLi buffers, see |
40971
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3252 `sql-interactive-mode'. |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3253 |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3254 Note that SQL doesn't have an escape character unless you specify |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3255 one. If you specify backslash as escape character in SQL, |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3256 you must tell Emacs. Here's how to do that in your `~/.emacs' file: |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3257 |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3258 \(add-hook 'sql-mode-hook |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3259 (lambda () |
fa679d186a7d
(sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents:
40432
diff
changeset
|
3260 (modify-syntax-entry ?\\\\ \".\" sql-mode-syntax-table)))" |
24050 | 3261 (interactive) |
3262 (kill-all-local-variables) | |
3263 (setq major-mode 'sql-mode) | |
3264 (setq mode-name "SQL") | |
3265 (use-local-map sql-mode-map) | |
31392
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
3266 (if sql-mode-menu |
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
3267 (easy-menu-add sql-mode-menu)); XEmacs |
24050 | 3268 (set-syntax-table sql-mode-syntax-table) |
3269 (make-local-variable 'font-lock-defaults) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3270 (make-local-variable 'sql-mode-font-lock-keywords) |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3271 (make-local-variable 'comment-start) |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3272 (setq comment-start "--") |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3273 ;; Make each buffer in sql-mode remember the "current" SQLi buffer. |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3274 (make-local-variable 'sql-buffer) |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3275 ;; Add imenu support for sql-mode. Note that imenu-generic-expression |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3276 ;; is buffer-local, so we don't need a local-variable for it. SQL is |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3277 ;; case-insensitive, that's why we have to set imenu-case-fold-search. |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3278 (setq imenu-generic-expression sql-imenu-generic-expression |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3279 imenu-case-fold-search t) |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3280 ;; Make `sql-send-paragraph' work on paragraphs that contain indented |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3281 ;; lines. |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3282 (make-local-variable 'paragraph-separate) |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3283 (make-local-variable 'paragraph-start) |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3284 (setq paragraph-separate "[\f]*$" |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3285 paragraph-start "[\n\f]") |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3286 ;; Abbrevs |
24050 | 3287 (setq local-abbrev-table sql-mode-abbrev-table) |
3288 (setq abbrev-all-caps 1) | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3289 ;; Run hook |
62772
f2892faa87d4
* progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents:
59996
diff
changeset
|
3290 (run-mode-hooks 'sql-mode-hook) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3291 ;; Catch changes to sql-product and highlight accordingly |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3292 (sql-highlight-product) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3293 (add-hook 'hack-local-variables-hook 'sql-highlight-product t t)) |
24050 | 3294 |
3295 | |
3296 | |
3297 ;;; SQL interactive mode | |
3298 | |
3299 (put 'sql-interactive-mode 'mode-class 'special) | |
3300 | |
3301 (defun sql-interactive-mode () | |
3302 "Major mode to use a SQL interpreter interactively. | |
3303 | |
3304 Do not call this function by yourself. The environment must be | |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3305 initialized by an entry function specific for the SQL interpreter. |
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3306 See `sql-help' for a list of available entry functions. |
24050 | 3307 |
3308 \\[comint-send-input] after the end of the process' output sends the | |
3309 text from the end of process to the end of the current line. | |
3310 \\[comint-send-input] before end of process output copies the current | |
3311 line minus the prompt to the end of the buffer and sends it. | |
3312 \\[comint-copy-old-input] just copies the current line. | |
3313 Use \\[sql-accumulate-and-indent] to enter multi-line statements. | |
3314 | |
3315 If you want to make multiple SQL buffers, rename the `*SQL*' buffer | |
3316 using \\[rename-buffer] or \\[rename-uniquely] and start a new process. | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3317 See `sql-help' for a list of available entry functions. The last buffer |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3318 created by such an entry function is the current SQLi buffer. SQL |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3319 buffers will send strings to the SQLi buffer current at the time of |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3320 their creation. See `sql-mode' for details. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3321 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3322 Sample session using two connections: |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3323 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3324 1. Create first SQLi buffer by calling an entry function. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3325 2. Rename buffer \"*SQL*\" to \"*Connection 1*\". |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3326 3. Create a SQL buffer \"test1.sql\". |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3327 4. Create second SQLi buffer by calling an entry function. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3328 5. Rename buffer \"*SQL*\" to \"*Connection 2*\". |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3329 6. Create a SQL buffer \"test2.sql\". |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3330 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3331 Now \\[sql-send-region] in buffer \"test1.sql\" will send the region to |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3332 buffer \"*Connection 1*\", \\[sql-send-region] in buffer \"test2.sql\" |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3333 will send the region to buffer \"*Connection 2*\". |
24050 | 3334 |
3335 If you accidentally suspend your process, use \\[comint-continue-subjob] | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3336 to continue it. On some operating systems, this will not work because |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3337 the signals are not supported. |
24050 | 3338 |
3339 \\{sql-interactive-mode-map} | |
3340 Customization: Entry to this mode runs the hooks on `comint-mode-hook' | |
3341 and `sql-interactive-mode-hook' (in that order). Before each input, the | |
3342 hooks on `comint-input-filter-functions' are run. After each SQL | |
3343 interpreter output, the hooks on `comint-output-filter-functions' are | |
3344 run. | |
3345 | |
65198
7fbb366ab47a
(sql-interactive-mode): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64837
diff
changeset
|
3346 Variable `sql-input-ring-file-name' controls the initialization of the |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3347 input ring history. |
24050 | 3348 |
3349 Variables `comint-output-filter-functions', a hook, and | |
3350 `comint-scroll-to-bottom-on-input' and | |
3351 `comint-scroll-to-bottom-on-output' control whether input and output | |
3352 cause the window to scroll to the end of the buffer. | |
3353 | |
3354 If you want to make SQL buffers limited in length, add the function | |
3355 `comint-truncate-buffer' to `comint-output-filter-functions'. | |
3356 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3357 Here is an example for your .emacs file. It keeps the SQLi buffer a |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3358 certain length. |
24050 | 3359 |
3360 \(add-hook 'sql-interactive-mode-hook | |
3361 \(function (lambda () | |
3362 \(setq comint-output-filter-functions 'comint-truncate-buffer)))) | |
3363 | |
3364 Here is another example. It will always put point back to the statement | |
3365 you entered, right above the output it created. | |
3366 | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3367 \(setq comint-output-filter-functions |
24050 | 3368 \(function (lambda (STR) (comint-show-output))))" |
63410
37dd5dc2f5ae
(sql-interactive-mode): Use delay-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents:
62772
diff
changeset
|
3369 (delay-mode-hooks (comint-mode)) |
108381 | 3370 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3371 ;; Get the `sql-product' for this interactive session. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3372 (set (make-local-variable 'sql-product) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3373 (or sql-interactive-product |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3374 sql-product)) |
108381 | 3375 |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3376 ;; Setup the mode. |
24050 | 3377 (setq major-mode 'sql-interactive-mode) |
108381 | 3378 (setq mode-name (concat "SQLi[" (or (sql-get-product-feature sql-product :name) |
3379 (symbol-name sql-product)) "]")) | |
24050 | 3380 (use-local-map sql-interactive-mode-map) |
31392
1f97a090ba6d
(sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents:
30905
diff
changeset
|
3381 (if sql-interactive-mode-menu |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3382 (easy-menu-add sql-interactive-mode-menu)) ; XEmacs |
24050 | 3383 (set-syntax-table sql-mode-syntax-table) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3384 (make-local-variable 'sql-mode-font-lock-keywords) |
24050 | 3385 (make-local-variable 'font-lock-defaults) |
108381 | 3386 |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3387 ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3388 ;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column |
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
3389 ;; will have just one quote. Therefore syntactic hilighting is |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3390 ;; disabled for interactive buffers. No imenu support. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3391 (sql-product-font-lock t nil) |
108381 | 3392 |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3393 ;; Enable commenting and uncommenting of the region. |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3394 (make-local-variable 'comment-start) |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3395 (setq comment-start "--") |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3396 ;; Abbreviation table init and case-insensitive. It is not activated |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3397 ;; by default. |
24050 | 3398 (setq local-abbrev-table sql-mode-abbrev-table) |
3399 (setq abbrev-all-caps 1) | |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3400 ;; Exiting the process will call sql-stop. |
110309 | 3401 (set-process-sentinel (get-buffer-process (current-buffer)) 'sql-stop) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3402 ;; Save the connection name |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3403 (make-local-variable 'sql-connection) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3404 ;; Create a usefull name for renaming this buffer later. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3405 (make-local-variable 'sql-alternate-buffer-name) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3406 (setq sql-alternate-buffer-name (sql-make-alternate-buffer-name)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3407 ;; User stuff. Initialize before the hook. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3408 (set (make-local-variable 'sql-prompt-regexp) |
108381 | 3409 (sql-get-product-feature sql-product :prompt-regexp)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3410 (set (make-local-variable 'sql-prompt-length) |
108381 | 3411 (sql-get-product-feature sql-product :prompt-length)) |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3412 (set (make-local-variable 'sql-prompt-cont-regexp) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3413 (sql-get-product-feature sql-product :prompt-cont-regexp)) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3414 (make-local-variable 'sql-output-newline-count) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3415 (make-local-variable 'sql-output-by-send) |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3416 (add-hook 'comint-preoutput-filter-functions |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3417 'sql-interactive-remove-continuation-prompt nil t) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3418 (make-local-variable 'sql-input-ring-separator) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3419 (make-local-variable 'sql-input-ring-file-name) |
108381 | 3420 ;; Run the mode hook (along with comint's hooks). |
62772
f2892faa87d4
* progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents:
59996
diff
changeset
|
3421 (run-mode-hooks 'sql-interactive-mode-hook) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3422 ;; Set comint based on user overrides. |
109742
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3423 (setq comint-prompt-regexp |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3424 (if sql-prompt-cont-regexp |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3425 (concat "\\(" sql-prompt-regexp |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3426 "\\|" sql-prompt-cont-regexp "\\)") |
581430ee307c
Suppress continuation prompts in SQL interactive mode
Michael Mauger <mmaug@yahoo.com>
parents:
109681
diff
changeset
|
3427 sql-prompt-regexp)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3428 (setq left-margin sql-prompt-length) |
108381 | 3429 ;; Install input sender |
3430 (set (make-local-variable 'comint-input-sender) 'sql-input-sender) | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3431 ;; People wanting a different history file for each |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3432 ;; buffer/process/client/whatever can change separator and file-name |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3433 ;; on the sql-interactive-mode-hook. |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3434 (setq comint-input-ring-separator sql-input-ring-separator |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3435 comint-input-ring-file-name sql-input-ring-file-name) |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3436 ;; Calling the hook before calling comint-read-input-ring allows users |
24050 | 3437 ;; to set comint-input-ring-file-name in sql-interactive-mode-hook. |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3438 (comint-read-input-ring t)) |
24050 | 3439 |
3440 (defun sql-stop (process event) | |
3441 "Called when the SQL process is stopped. | |
3442 | |
24353
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3443 Writes the input history to a history file using |
1ae2a12a85ee
(sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents:
24310
diff
changeset
|
3444 `comint-write-input-ring' and inserts a short message in the SQL buffer. |
24050 | 3445 |
3446 This function is a sentinel watching the SQL interpreter process. | |
3447 Sentinels will always get the two parameters PROCESS and EVENT." | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3448 (comint-write-input-ring) |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3449 (if (and (eq (current-buffer) sql-buffer) |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3450 (not buffer-read-only)) |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3451 (insert (format "\nProcess %s %s\n" process event)) |
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3452 (message "Process %s %s" process event))) |
24050 | 3453 |
3454 | |
3455 | |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3456 ;;; Connection handling |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3457 |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3458 (defun sql-read-connection (prompt &optional initial default) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3459 "Read a connection name." |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3460 (let ((completion-ignore-case t)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3461 (completing-read prompt |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3462 (mapcar (lambda (c) (car c)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3463 sql-connection-alist) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3464 nil t initial 'sql-connection-history default))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3465 |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3466 ;;;###autoload |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3467 (defun sql-connect (connection) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3468 "Connect to an interactive session using CONNECTION settings. |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3469 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3470 See `sql-connection-alist' to see how to define connections and |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3471 their settings. |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3472 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3473 The user will not be prompted for any login parameters if a value |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3474 is specified in the connection settings." |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3475 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3476 ;; Prompt for the connection from those defined in the alist |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3477 (interactive |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3478 (if sql-connection-alist |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3479 (list (sql-read-connection "Connection: " nil '(nil))) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3480 nil)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3481 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3482 ;; Are there connections defined |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3483 (if sql-connection-alist |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3484 ;; Was one selected |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3485 (when connection |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3486 ;; Get connection settings |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3487 (let ((connect-set (assoc connection sql-connection-alist))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3488 ;; Settings are defined |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3489 (if connect-set |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3490 ;; Set the desired parameters |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3491 (eval `(let* |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3492 (,@(cdr connect-set) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3493 ;; :sqli-login params variable |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3494 (param-var (sql-get-product-feature sql-product |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3495 :sqli-login nil t)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3496 ;; :sqli-login params value |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3497 (login-params (sql-get-product-feature sql-product |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3498 :sqli-login)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3499 ;; which params are in the connection |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3500 (set-params (mapcar |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3501 (lambda (v) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3502 (cond |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3503 ((eq (car v) 'sql-user) 'user) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3504 ((eq (car v) 'sql-password) 'password) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3505 ((eq (car v) 'sql-server) 'server) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3506 ((eq (car v) 'sql-database) 'database) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3507 ((eq (car v) 'sql-port) 'port) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3508 (t (car v)))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3509 (cdr connect-set))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3510 ;; the remaining params (w/o the connection params) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3511 (rem-params (sql-for-each-login |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3512 login-params |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3513 (lambda (token plist) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3514 (unless (member token set-params) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3515 (if plist |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3516 (cons token plist) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3517 token))))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3518 ;; Remember the connection |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3519 (sql-connection connection)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3520 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3521 ;; Set the remaining parameters and start the |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3522 ;; interactive session |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3523 (eval `(let ((,param-var ',rem-params)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3524 (sql-product-interactive sql-product))))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3525 (message "SQL Connection <%s> does not exist" connection) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3526 nil))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3527 (message "No SQL Connections defined") |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3528 nil)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3529 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3530 (defun sql-save-connection (name) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3531 "Captures the connection information of the current SQLi session. |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3532 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3533 The information is appended to `sql-connection-alist' and |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3534 optionally is saved to the user's init file." |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3535 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3536 (interactive "sNew connection name: ") |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3537 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3538 (if sql-connection |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3539 (message "This session was started by a connection; it's already been saved.") |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3540 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3541 (let ((login (sql-get-product-feature sql-product :sqli-login)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3542 (alist sql-connection-alist) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3543 connect) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3544 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3545 ;; Remove the existing connection if the user says so |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3546 (when (and (assoc name alist) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3547 (yes-or-no-p (format "Replace connection definition <%s>? " name))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3548 (setq alist (assq-delete-all name alist))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3549 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3550 ;; Add the new connection if it doesn't exist |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3551 (if (assoc name alist) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3552 (message "Connection <%s> already exists" name) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3553 (setq connect |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3554 (append (list name) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3555 (sql-for-each-login |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3556 `(product ,@login) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3557 (lambda (token plist) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3558 (cond |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3559 ((eq token 'product) `(sql-product ',sql-product)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3560 ((eq token 'user) `(sql-user ,sql-user)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3561 ((eq token 'database) `(sql-database ,sql-database)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3562 ((eq token 'server) `(sql-server ,sql-server)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3563 ((eq token 'port) `(sql-port ,sql-port))))))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3564 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3565 (setq alist (append alist (list connect))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3566 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3567 ;; confirm whether we want to save the connections |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3568 (if (yes-or-no-p "Save the connections for future sessions? ") |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3569 (customize-save-variable 'sql-connection-alist alist) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3570 (customize-set-variable 'sql-connection-alist alist)))))) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3571 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3572 (defun sql-connection-menu-filter (tail) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3573 "Generates menu entries for using each connection." |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3574 (append |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3575 (mapcar |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3576 (lambda (conn) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3577 (vector |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3578 (format "Connection <%s>" (car conn)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3579 (list 'sql-connect (car conn)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3580 t)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3581 sql-connection-alist) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3582 tail)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3583 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3584 |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3585 |
24050 | 3586 ;;; Entry functions for different SQL interpreters. |
3587 | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3588 ;;;###autoload |
110309 | 3589 (defun sql-product-interactive (&optional product new-name) |
108381 | 3590 "Run PRODUCT interpreter as an inferior process. |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3591 |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3592 If buffer `*SQL*' exists but no process is running, make a new process. |
104304
35fbb27750a7
(sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102020
diff
changeset
|
3593 If buffer exists and a process is running, just switch to buffer `*SQL*'. |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3594 |
110309 | 3595 To specify the SQL product, prefix the call with |
3596 \\[universal-argument]. To set the buffer name as well, prefix | |
3597 the call to \\[sql-product-interactive] with | |
3598 \\[universal-argument] \\[universal-argument]. | |
3599 | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3600 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
108381 | 3601 (interactive "P") |
3602 | |
110309 | 3603 ;; Handle universal arguments if specified |
3604 (when (not (or executing-kbd-macro noninteractive)) | |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3605 (when (and (consp product) |
110309 | 3606 (not (cdr product)) |
3607 (numberp (car product))) | |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3608 (when (>= (prefix-numeric-value product) 16) |
110309 | 3609 (when (not new-name) |
3610 (setq new-name '(4))) | |
3611 (setq product '(4))))) | |
3612 | |
3613 ;; Get the value of product that we need | |
108381 | 3614 (setq product |
3615 (cond | |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
3616 ((and product ; Product specified |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
3617 (symbolp product)) product) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3618 ((= (prefix-numeric-value product) 4) ; C-u, prompt for product |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3619 (sql-read-product "SQL product: " sql-product)) |
108381 | 3620 (t sql-product))) ; Default to sql-product |
3621 | |
110309 | 3622 ;; If we have a product and it has a interactive mode |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
3623 (if product |
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
3624 (when (sql-get-product-feature product :sqli-comint-func) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3625 ;; If no new name specified, try to pop to an active SQL |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3626 ;; interactive for the same product |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3627 (let ((buf (sql-find-sqli-buffer product))) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3628 (if (and (not new-name) buf) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3629 (pop-to-buffer buf) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3630 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3631 ;; We have a new name or sql-buffer doesn't exist or match |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3632 ;; Start by remembering where we start |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3633 (let ((start-buffer (current-buffer)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3634 new-sqli-buffer) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3635 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3636 ;; Get credentials. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3637 (apply 'sql-get-login (sql-get-product-feature product :sqli-login)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3638 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3639 ;; Connect to database. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3640 (message "Login...") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3641 (funcall (sql-get-product-feature product :sqli-comint-func) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3642 product |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3643 (sql-get-product-feature product :sqli-options)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3644 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3645 ;; Set SQLi mode. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3646 (setq new-sqli-buffer (current-buffer)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3647 (let ((sql-interactive-product product)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3648 (sql-interactive-mode)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3649 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3650 ;; Set the new buffer name |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3651 (when new-name |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3652 (sql-rename-buffer new-name)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3653 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3654 ;; Set `sql-buffer' in the new buffer and the start buffer |
110326
ba7558616802
SQL Mode 2.7: Code cleanup and primatives for SQL redirection
Michael Mauger <mmaug@yahoo.com>
parents:
110309
diff
changeset
|
3655 (setq sql-buffer (buffer-name new-sqli-buffer)) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3656 (with-current-buffer start-buffer |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3657 (setq sql-buffer (buffer-name new-sqli-buffer)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3658 (run-hooks 'sql-set-sqli-hook)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3659 |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3660 ;; All done. |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3661 (message "Login...done") |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3662 (pop-to-buffer sql-buffer))))) |
109482
c9df47f7bbf3
SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents:
109460
diff
changeset
|
3663 (message "No default SQL product defined. Set `sql-product'."))) |
108381 | 3664 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3665 (defun sql-comint (product params) |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3666 "Set up a comint buffer to run the SQL processor. |
108381 | 3667 |
3668 PRODUCT is the SQL product. PARAMS is a list of strings which are | |
3669 passed as command line arguments." | |
110309 | 3670 (let ((program (sql-get-product-feature product :sqli-program)) |
3671 (buf-name "SQL")) | |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3672 ;; make sure we can find the program |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3673 (unless (executable-find program) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3674 (error "Unable to locate SQL program \'%s\'" program)) |
110309 | 3675 ;; Make sure buffer name is unique |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3676 (when (sql-buffer-live-p (format "*%s*" buf-name)) |
110309 | 3677 (setq buf-name (format "SQL-%s" product)) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3678 (when (sql-buffer-live-p (format "*%s*" buf-name)) |
110309 | 3679 (let ((i 1)) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3680 (while (sql-buffer-live-p |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3681 (format "*%s*" |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
3682 (setq buf-name (format "SQL-%s%d" product i)))) |
110309 | 3683 (setq i (1+ i)))))) |
108381 | 3684 (set-buffer |
110309 | 3685 (apply 'make-comint buf-name program nil params)))) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3686 |
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3687 ;;;###autoload |
110309 | 3688 (defun sql-oracle (&optional buffer) |
24050 | 3689 "Run sqlplus by Oracle as an inferior process. |
3690 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3691 If buffer `*SQL*' exists but no process is running, make a new process. |
24050 | 3692 If buffer exists and a process is running, just switch to buffer |
3693 `*SQL*'. | |
3694 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3695 Interpreter used comes from variable `sql-oracle-program'. Login uses |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3696 the variables `sql-user', `sql-password', and `sql-database' as |
29937
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
3697 defaults, if set. Additional command line parameters can be stored in |
693c2c631d72
(sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents:
26576
diff
changeset
|
3698 the list `sql-oracle-options'. |
24050 | 3699 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3700 The buffer is put in SQL interactive mode, giving commands for sending |
24050 | 3701 input. See `sql-interactive-mode'. |
3702 | |
110309 | 3703 To set the buffer name directly, use \\[universal-argument] |
3704 before \\[sql-oracle]. Once session has started, | |
3705 \\[sql-rename-buffer] can be called separately to rename the | |
3706 buffer. | |
3707 | |
24050 | 3708 To specify a coding system for converting non-ASCII characters |
3709 in the input and output to the process, use \\[universal-coding-system-argument] | |
3710 before \\[sql-oracle]. You can also specify this with \\[set-buffer-process-coding-system] | |
3711 in the SQL buffer, after you start the process. | |
3712 The default comes from `process-coding-system-alist' and | |
3713 `default-process-coding-system'. | |
3714 | |
3715 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | |
110309 | 3716 (interactive "P") |
3717 (sql-product-interactive 'oracle buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3718 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3719 (defun sql-comint-oracle (product options) |
108381 | 3720 "Create comint buffer and connect to Oracle." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3721 ;; Produce user/password@database construct. Password without user |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3722 ;; is meaningless; database without user/password is meaningless, |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3723 ;; because "@param" will ask sqlplus to interpret the script |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3724 ;; "param". |
108381 | 3725 (let ((parameter nil)) |
3726 (if (not (string= "" sql-user)) | |
3727 (if (not (string= "" sql-password)) | |
3728 (setq parameter (concat sql-user "/" sql-password)) | |
3729 (setq parameter sql-user))) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3730 (if (and parameter (not (string= "" sql-database))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3731 (setq parameter (concat parameter "@" sql-database))) |
108381 | 3732 (if parameter |
3733 (setq parameter (nconc (list parameter) options)) | |
3734 (setq parameter options)) | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3735 (sql-comint product parameter))) |
24050 | 3736 |
3737 | |
3738 | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3739 ;;;###autoload |
110309 | 3740 (defun sql-sybase (&optional buffer) |
108569
6e7ebe021a2c
* progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
108381
diff
changeset
|
3741 "Run isql by Sybase as an inferior process. |
24050 | 3742 |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3743 If buffer `*SQL*' exists but no process is running, make a new process. |
24050 | 3744 If buffer exists and a process is running, just switch to buffer |
3745 `*SQL*'. | |
3746 | |
3747 Interpreter used comes from variable `sql-sybase-program'. Login uses | |
32621
50c28d51e0f2
(sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
32169
diff
changeset
|
3748 the variables `sql-server', `sql-user', `sql-password', and |
36523
e72a04113eac
(sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents:
34704
diff
changeset
|
3749 `sql-database' as defaults, if set. Additional command line parameters |
e72a04113eac
(sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents:
34704
diff
changeset
|
3750 can be stored in the list `sql-sybase-options'. |
24050 | 3751 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3752 The buffer is put in SQL interactive mode, giving commands for sending |
24050 | 3753 input. See `sql-interactive-mode'. |
3754 | |
110309 | 3755 To set the buffer name directly, use \\[universal-argument] |
3756 before \\[sql-sybase]. Once session has started, | |
3757 \\[sql-rename-buffer] can be called separately to rename the | |
3758 buffer. | |
3759 | |
24050 | 3760 To specify a coding system for converting non-ASCII characters |
3761 in the input and output to the process, use \\[universal-coding-system-argument] | |
3762 before \\[sql-sybase]. You can also specify this with \\[set-buffer-process-coding-system] | |
3763 in the SQL buffer, after you start the process. | |
3764 The default comes from `process-coding-system-alist' and | |
3765 `default-process-coding-system'. | |
3766 | |
3767 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | |
110309 | 3768 (interactive "P") |
3769 (sql-product-interactive 'sybase buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3770 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3771 (defun sql-comint-sybase (product options) |
108381 | 3772 "Create comint buffer and connect to Sybase." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3773 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3774 ;; make-comint. |
108381 | 3775 (let ((params options)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3776 (if (not (string= "" sql-server)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3777 (setq params (append (list "-S" sql-server) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3778 (if (not (string= "" sql-database)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3779 (setq params (append (list "-D" sql-database) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3780 (if (not (string= "" sql-password)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3781 (setq params (append (list "-P" sql-password) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3782 (if (not (string= "" sql-user)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3783 (setq params (append (list "-U" sql-user) params))) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3784 (sql-comint product params))) |
24050 | 3785 |
3786 | |
3787 | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3788 ;;;###autoload |
110309 | 3789 (defun sql-informix (&optional buffer) |
24050 | 3790 "Run dbaccess by Informix as an inferior process. |
3791 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3792 If buffer `*SQL*' exists but no process is running, make a new process. |
24050 | 3793 If buffer exists and a process is running, just switch to buffer |
3794 `*SQL*'. | |
3795 | |
3796 Interpreter used comes from variable `sql-informix-program'. Login uses | |
3797 the variable `sql-database' as default, if set. | |
3798 | |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3799 The buffer is put in SQL interactive mode, giving commands for sending |
24050 | 3800 input. See `sql-interactive-mode'. |
3801 | |
110309 | 3802 To set the buffer name directly, use \\[universal-argument] |
3803 before \\[sql-informix]. Once session has started, | |
3804 \\[sql-rename-buffer] can be called separately to rename the | |
3805 buffer. | |
3806 | |
24050 | 3807 To specify a coding system for converting non-ASCII characters |
3808 in the input and output to the process, use \\[universal-coding-system-argument] | |
3809 before \\[sql-informix]. You can also specify this with \\[set-buffer-process-coding-system] | |
3810 in the SQL buffer, after you start the process. | |
3811 The default comes from `process-coding-system-alist' and | |
3812 `default-process-coding-system'. | |
3813 | |
3814 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | |
110309 | 3815 (interactive "P") |
3816 (sql-product-interactive 'informix buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3817 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3818 (defun sql-comint-informix (product options) |
108381 | 3819 "Create comint buffer and connect to Informix." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3820 ;; username and password are ignored. |
108381 | 3821 (let ((db (if (string= "" sql-database) |
3822 "-" | |
3823 (if (string= "" sql-server) | |
3824 sql-database | |
3825 (concat sql-database "@" sql-server))))) | |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3826 (sql-comint product (append `(,db "-") options)))) |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3827 |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3828 |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3829 |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3830 ;;;###autoload |
110309 | 3831 (defun sql-sqlite (&optional buffer) |
51607
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3832 "Run sqlite as an inferior process. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3833 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3834 SQLite is free software. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3835 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3836 If buffer `*SQL*' exists but no process is running, make a new process. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3837 If buffer exists and a process is running, just switch to buffer |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3838 `*SQL*'. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3839 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3840 Interpreter used comes from variable `sql-sqlite-program'. Login uses |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3841 the variables `sql-user', `sql-password', `sql-database', and |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3842 `sql-server' as defaults, if set. Additional command line parameters |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3843 can be stored in the list `sql-sqlite-options'. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3844 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3845 The buffer is put in SQL interactive mode, giving commands for sending |
51607
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3846 input. See `sql-interactive-mode'. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3847 |
110309 | 3848 To set the buffer name directly, use \\[universal-argument] |
3849 before \\[sql-sqlite]. Once session has started, | |
3850 \\[sql-rename-buffer] can be called separately to rename the | |
3851 buffer. | |
3852 | |
51607
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3853 To specify a coding system for converting non-ASCII characters |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3854 in the input and output to the process, use \\[universal-coding-system-argument] |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3855 before \\[sql-sqlite]. You can also specify this with \\[set-buffer-process-coding-system] |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3856 in the SQL buffer, after you start the process. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3857 The default comes from `process-coding-system-alist' and |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3858 `default-process-coding-system'. |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3859 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3860 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
110309 | 3861 (interactive "P") |
3862 (sql-product-interactive 'sqlite buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3863 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3864 (defun sql-comint-sqlite (product options) |
108381 | 3865 "Create comint buffer and connect to SQLite." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3866 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3867 ;; make-comint. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3868 (let ((params)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3869 (if (not (string= "" sql-database)) |
109489
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3870 (setq params (append (list (expand-file-name sql-database)) |
b4b02bfd4d95
SQL Mode Version2.4 - Improved login prompting
Michael Mauger <mmaug@yahoo.com>
parents:
109482
diff
changeset
|
3871 params))) |
108381 | 3872 (setq params (append options params)) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3873 (sql-comint product params))) |
51607
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3874 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3875 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3876 |
ead411a37669
Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents:
48486
diff
changeset
|
3877 ;;;###autoload |
110309 | 3878 (defun sql-mysql (&optional buffer) |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3879 "Run mysql by TcX as an inferior process. |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3880 |
40432
225bd38b0ce7
(sql-mysql): Doc change by RMS.
Gerd Moellmann <gerd@gnu.org>
parents:
38872
diff
changeset
|
3881 Mysql versions 3.23 and up are free software. |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3882 |
24268 | 3883 If buffer `*SQL*' exists but no process is running, make a new process. |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3884 If buffer exists and a process is running, just switch to buffer |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3885 `*SQL*'. |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3886 |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3887 Interpreter used comes from variable `sql-mysql-program'. Login uses |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3888 the variables `sql-user', `sql-password', `sql-database', and |
36523
e72a04113eac
(sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents:
34704
diff
changeset
|
3889 `sql-server' as defaults, if set. Additional command line parameters |
e72a04113eac
(sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents:
34704
diff
changeset
|
3890 can be stored in the list `sql-mysql-options'. |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3891 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3892 The buffer is put in SQL interactive mode, giving commands for sending |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3893 input. See `sql-interactive-mode'. |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3894 |
110309 | 3895 To set the buffer name directly, use \\[universal-argument] |
3896 before \\[sql-mysql]. Once session has started, | |
3897 \\[sql-rename-buffer] can be called separately to rename the | |
3898 buffer. | |
3899 | |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3900 To specify a coding system for converting non-ASCII characters |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3901 in the input and output to the process, use \\[universal-coding-system-argument] |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3902 before \\[sql-mysql]. You can also specify this with \\[set-buffer-process-coding-system] |
24267
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3903 in the SQL buffer, after you start the process. |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3904 The default comes from `process-coding-system-alist' and |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3905 `default-process-coding-system'. |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3906 |
f40837b25999
Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents:
24058
diff
changeset
|
3907 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
110309 | 3908 (interactive "P") |
3909 (sql-product-interactive 'mysql buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3910 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3911 (defun sql-comint-mysql (product options) |
108381 | 3912 "Create comint buffer and connect to MySQL." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3913 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3914 ;; make-comint. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3915 (let ((params)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3916 (if (not (string= "" sql-database)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3917 (setq params (append (list sql-database) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3918 (if (not (string= "" sql-server)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3919 (setq params (append (list (concat "--host=" sql-server)) params))) |
110309 | 3920 (if (not (= 0 sql-port)) |
108381 | 3921 (setq params (append (list (concat "--port=" (number-to-string sql-port))) params))) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3922 (if (not (string= "" sql-password)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3923 (setq params (append (list (concat "--password=" sql-password)) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3924 (if (not (string= "" sql-user)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3925 (setq params (append (list (concat "--user=" sql-user)) params))) |
108381 | 3926 (setq params (append options params)) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3927 (sql-comint product params))) |
24050 | 3928 |
3929 | |
3930 | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3931 ;;;###autoload |
110309 | 3932 (defun sql-solid (&optional buffer) |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3933 "Run solsql by Solid as an inferior process. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3934 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3935 If buffer `*SQL*' exists but no process is running, make a new process. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3936 If buffer exists and a process is running, just switch to buffer |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3937 `*SQL*'. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3938 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3939 Interpreter used comes from variable `sql-solid-program'. Login uses |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3940 the variables `sql-user', `sql-password', and `sql-server' as |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3941 defaults, if set. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3942 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3943 The buffer is put in SQL interactive mode, giving commands for sending |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3944 input. See `sql-interactive-mode'. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3945 |
110309 | 3946 To set the buffer name directly, use \\[universal-argument] |
3947 before \\[sql-solid]. Once session has started, | |
3948 \\[sql-rename-buffer] can be called separately to rename the | |
3949 buffer. | |
3950 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3951 To specify a coding system for converting non-ASCII characters |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3952 in the input and output to the process, use \\[universal-coding-system-argument] |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3953 before \\[sql-solid]. You can also specify this with \\[set-buffer-process-coding-system] |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3954 in the SQL buffer, after you start the process. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3955 The default comes from `process-coding-system-alist' and |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3956 `default-process-coding-system'. |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3957 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3958 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
110309 | 3959 (interactive "P") |
3960 (sql-product-interactive 'solid buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3961 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3962 (defun sql-comint-solid (product options) |
108381 | 3963 "Create comint buffer and connect to Solid." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3964 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3965 ;; make-comint. |
108381 | 3966 (let ((params options)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3967 ;; It only makes sense if both username and password are there. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3968 (if (not (or (string= "" sql-user) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3969 (string= "" sql-password))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3970 (setq params (append (list sql-user sql-password) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3971 (if (not (string= "" sql-server)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
3972 (setq params (append (list sql-server) params))) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
3973 (sql-comint product params))) |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3974 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3975 |
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3976 |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
3977 ;;;###autoload |
110309 | 3978 (defun sql-ingres (&optional buffer) |
24050 | 3979 "Run sql by Ingres as an inferior process. |
3980 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
3981 If buffer `*SQL*' exists but no process is running, make a new process. |
24050 | 3982 If buffer exists and a process is running, just switch to buffer |
3983 `*SQL*'. | |
3984 | |
3985 Interpreter used comes from variable `sql-ingres-program'. Login uses | |
3986 the variable `sql-database' as default, if set. | |
3987 | |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
3988 The buffer is put in SQL interactive mode, giving commands for sending |
24050 | 3989 input. See `sql-interactive-mode'. |
3990 | |
110309 | 3991 To set the buffer name directly, use \\[universal-argument] |
3992 before \\[sql-ingres]. Once session has started, | |
3993 \\[sql-rename-buffer] can be called separately to rename the | |
3994 buffer. | |
3995 | |
24050 | 3996 To specify a coding system for converting non-ASCII characters |
3997 in the input and output to the process, use \\[universal-coding-system-argument] | |
3998 before \\[sql-ingres]. You can also specify this with \\[set-buffer-process-coding-system] | |
3999 in the SQL buffer, after you start the process. | |
4000 The default comes from `process-coding-system-alist' and | |
4001 `default-process-coding-system'. | |
4002 | |
4003 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | |
110309 | 4004 (interactive "P") |
4005 (sql-product-interactive 'ingres buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4006 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4007 (defun sql-comint-ingres (product options) |
108381 | 4008 "Create comint buffer and connect to Ingres." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4009 ;; username and password are ignored. |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4010 (sql-comint product |
108381 | 4011 (append (if (string= "" sql-database) |
4012 nil | |
4013 (list sql-database)) | |
4014 options))) | |
24050 | 4015 |
4016 | |
4017 | |
30513
12162d90d9e4
(sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
29937
diff
changeset
|
4018 ;;;###autoload |
110309 | 4019 (defun sql-ms (&optional buffer) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4020 "Run osql by Microsoft as an inferior process. |
24050 | 4021 |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
4022 If buffer `*SQL*' exists but no process is running, make a new process. |
24050 | 4023 If buffer exists and a process is running, just switch to buffer |
4024 `*SQL*'. | |
4025 | |
4026 Interpreter used comes from variable `sql-ms-program'. Login uses the | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
4027 variables `sql-user', `sql-password', `sql-database', and `sql-server' |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4028 as defaults, if set. Additional command line parameters can be stored |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4029 in the list `sql-ms-options'. |
24050 | 4030 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
4031 The buffer is put in SQL interactive mode, giving commands for sending |
24050 | 4032 input. See `sql-interactive-mode'. |
4033 | |
110309 | 4034 To set the buffer name directly, use \\[universal-argument] |
4035 before \\[sql-ms]. Once session has started, | |
4036 \\[sql-rename-buffer] can be called separately to rename the | |
4037 buffer. | |
4038 | |
24050 | 4039 To specify a coding system for converting non-ASCII characters |
4040 in the input and output to the process, use \\[universal-coding-system-argument] | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
4041 before \\[sql-ms]. You can also specify this with \\[set-buffer-process-coding-system] |
24050 | 4042 in the SQL buffer, after you start the process. |
4043 The default comes from `process-coding-system-alist' and | |
4044 `default-process-coding-system'. | |
4045 | |
4046 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | |
110309 | 4047 (interactive "P") |
4048 (sql-product-interactive 'ms buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4049 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4050 (defun sql-comint-ms (product options) |
108381 | 4051 "Create comint buffer and connect to Microsoft SQL Server." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4052 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4053 ;; make-comint. |
108381 | 4054 (let ((params options)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4055 (if (not (string= "" sql-server)) |
24050 | 4056 (setq params (append (list "-S" sql-server) params))) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4057 (if (not (string= "" sql-database)) |
24050 | 4058 (setq params (append (list "-d" sql-database) params))) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4059 (if (not (string= "" sql-user)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4060 (setq params (append (list "-U" sql-user) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4061 (if (not (string= "" sql-password)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4062 (setq params (append (list "-P" sql-password) params)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4063 (if (string= "" sql-user) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4064 ;; if neither user nor password is provided, use system |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4065 ;; credentials. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4066 (setq params (append (list "-E") params)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4067 ;; If -P is passed to ISQL as the last argument without a |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4068 ;; password, it's considered null. |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4069 (setq params (append params (list "-P"))))) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4070 (sql-comint product params))) |
24050 | 4071 |
4072 | |
4073 | |
4074 ;;;###autoload | |
110309 | 4075 (defun sql-postgres (&optional buffer) |
24050 | 4076 "Run psql by Postgres as an inferior process. |
4077 | |
24310
e76bade08723
Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents:
24268
diff
changeset
|
4078 If buffer `*SQL*' exists but no process is running, make a new process. |
24050 | 4079 If buffer exists and a process is running, just switch to buffer |
4080 `*SQL*'. | |
4081 | |
4082 Interpreter used comes from variable `sql-postgres-program'. Login uses | |
24354
6a438ef0b573
Set version to 1.4.1. Changed mail address to
Richard M. Stallman <rms@gnu.org>
parents:
24353
diff
changeset
|
4083 the variables `sql-database' and `sql-server' as default, if set. |
36523
e72a04113eac
(sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents:
34704
diff
changeset
|
4084 Additional command line parameters can be stored in the list |
e72a04113eac
(sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents:
34704
diff
changeset
|
4085 `sql-postgres-options'. |
24050 | 4086 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
4087 The buffer is put in SQL interactive mode, giving commands for sending |
24050 | 4088 input. See `sql-interactive-mode'. |
4089 | |
110309 | 4090 To set the buffer name directly, use \\[universal-argument] |
4091 before \\[sql-postgres]. Once session has started, | |
4092 \\[sql-rename-buffer] can be called separately to rename the | |
4093 buffer. | |
4094 | |
24050 | 4095 To specify a coding system for converting non-ASCII characters |
4096 in the input and output to the process, use \\[universal-coding-system-argument] | |
4097 before \\[sql-postgres]. You can also specify this with \\[set-buffer-process-coding-system] | |
4098 in the SQL buffer, after you start the process. | |
4099 The default comes from `process-coding-system-alist' and | |
25826
e55139b50cb6
(sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents:
25381
diff
changeset
|
4100 `default-process-coding-system'. If your output lines end with ^M, |
24050 | 4101 your might try undecided-dos as a coding system. If this doesn't help, |
4102 Try to set `comint-output-filter-functions' like this: | |
4103 | |
4104 \(setq comint-output-filter-functions (append comint-output-filter-functions | |
4105 '(comint-strip-ctrl-m))) | |
4106 | |
4107 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | |
110309 | 4108 (interactive "P") |
4109 (sql-product-interactive 'postgres buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4110 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4111 (defun sql-comint-postgres (product options) |
108381 | 4112 "Create comint buffer and connect to Postgres." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4113 ;; username and password are ignored. Mark Stosberg suggest to add |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4114 ;; the database at the end. Jason Beegan suggest using --pset and |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4115 ;; pager=off instead of \\o|cat. The later was the solution by |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4116 ;; Gregor Zych. Jason's suggestion is the default value for |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4117 ;; sql-postgres-options. |
108381 | 4118 (let ((params options)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4119 (if (not (string= "" sql-database)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4120 (setq params (append params (list sql-database)))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4121 (if (not (string= "" sql-server)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4122 (setq params (append (list "-h" sql-server) params))) |
55241
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
4123 (if (not (string= "" sql-user)) |
cebca4e25fae
(sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52482
diff
changeset
|
4124 (setq params (append (list "-U" sql-user) params))) |
110424
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
4125 (if (not (= 0 sql-port)) |
03a492f2d1ce
SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
Michael Mauger <mmaug@yahoo.com>
parents:
110326
diff
changeset
|
4126 (setq params (append (list "-p" sql-port) params))) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4127 (sql-comint product params))) |
24050 | 4128 |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4129 |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4130 |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4131 ;;;###autoload |
110309 | 4132 (defun sql-interbase (&optional buffer) |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4133 "Run isql by Interbase as an inferior process. |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4134 |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4135 If buffer `*SQL*' exists but no process is running, make a new process. |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4136 If buffer exists and a process is running, just switch to buffer |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4137 `*SQL*'. |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4138 |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4139 Interpreter used comes from variable `sql-interbase-program'. Login |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4140 uses the variables `sql-user', `sql-password', and `sql-database' as |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4141 defaults, if set. |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4142 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
4143 The buffer is put in SQL interactive mode, giving commands for sending |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4144 input. See `sql-interactive-mode'. |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4145 |
110309 | 4146 To set the buffer name directly, use \\[universal-argument] |
4147 before \\[sql-interbase]. Once session has started, | |
4148 \\[sql-rename-buffer] can be called separately to rename the | |
4149 buffer. | |
4150 | |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4151 To specify a coding system for converting non-ASCII characters |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4152 in the input and output to the process, use \\[universal-coding-system-argument] |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4153 before \\[sql-interbase]. You can also specify this with \\[set-buffer-process-coding-system] |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4154 in the SQL buffer, after you start the process. |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4155 The default comes from `process-coding-system-alist' and |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4156 `default-process-coding-system'. |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4157 |
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4158 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
110309 | 4159 (interactive "P") |
4160 (sql-product-interactive 'interbase buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4161 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4162 (defun sql-comint-interbase (product options) |
108381 | 4163 "Create comint buffer and connect to Interbase." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4164 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4165 ;; make-comint. |
108381 | 4166 (let ((params options)) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4167 (if (not (string= "" sql-user)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4168 (setq params (append (list "-u" sql-user) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4169 (if (not (string= "" sql-password)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4170 (setq params (append (list "-p" sql-password) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4171 (if (not (string= "" sql-database)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4172 (setq params (cons sql-database params))) ; add to the front! |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4173 (sql-comint product params))) |
36571
54a8a84a22f6
(sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36523
diff
changeset
|
4174 |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4175 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4176 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4177 ;;;###autoload |
110309 | 4178 (defun sql-db2 (&optional buffer) |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4179 "Run db2 by IBM as an inferior process. |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4180 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4181 If buffer `*SQL*' exists but no process is running, make a new process. |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4182 If buffer exists and a process is running, just switch to buffer |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4183 `*SQL*'. |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4184 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4185 Interpreter used comes from variable `sql-db2-program'. There is not |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4186 automatic login. |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4187 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
4188 The buffer is put in SQL interactive mode, giving commands for sending |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4189 input. See `sql-interactive-mode'. |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4190 |
38872 | 4191 If you use \\[sql-accumulate-and-indent] to send multiline commands to |
4192 db2, newlines will be escaped if necessary. If you don't want that, set | |
4193 `comint-input-sender' back to `comint-simple-send' by writing an after | |
4194 advice. See the elisp manual for more information. | |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4195 |
110309 | 4196 To set the buffer name directly, use \\[universal-argument] |
4197 before \\[sql-db2]. Once session has started, | |
4198 \\[sql-rename-buffer] can be called separately to rename the | |
4199 buffer. | |
4200 | |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4201 To specify a coding system for converting non-ASCII characters |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4202 in the input and output to the process, use \\[universal-coding-system-argument] |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4203 before \\[sql-db2]. You can also specify this with \\[set-buffer-process-coding-system] |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4204 in the SQL buffer, after you start the process. |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4205 The default comes from `process-coding-system-alist' and |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4206 `default-process-coding-system'. |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4207 |
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4208 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
110309 | 4209 (interactive "P") |
4210 (sql-product-interactive 'db2 buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4211 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4212 (defun sql-comint-db2 (product options) |
108381 | 4213 "Create comint buffer and connect to DB2." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4214 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4215 ;; make-comint. |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4216 (sql-comint product options) |
108381 | 4217 ) |
37409
9781f3a3c955
(sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
36571
diff
changeset
|
4218 |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4219 ;;;###autoload |
110309 | 4220 (defun sql-linter (&optional buffer) |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4221 "Run inl by RELEX as an inferior process. |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4222 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4223 If buffer `*SQL*' exists but no process is running, make a new process. |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4224 If buffer exists and a process is running, just switch to buffer |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4225 `*SQL*'. |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4226 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4227 Interpreter used comes from variable `sql-linter-program' - usually `inl'. |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4228 Login uses the variables `sql-user', `sql-password', `sql-database' and |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4229 `sql-server' as defaults, if set. Additional command line parameters |
108381 | 4230 can be stored in the list `sql-linter-options'. Run inl -h to get help on |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4231 parameters. |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4232 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4233 `sql-database' is used to set the LINTER_MBX environment variable for |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4234 local connections, `sql-server' refers to the server name from the |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4235 `nodetab' file for the network connection (dbc_tcp or friends must run |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4236 for this to work). If `sql-password' is an empty string, inl will use |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4237 an empty password. |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4238 |
108352
cf2043af9228
* progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
4239 The buffer is put in SQL interactive mode, giving commands for sending |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4240 input. See `sql-interactive-mode'. |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4241 |
110309 | 4242 To set the buffer name directly, use \\[universal-argument] |
4243 before \\[sql-linter]. Once session has started, | |
4244 \\[sql-rename-buffer] can be called separately to rename the | |
4245 buffer. | |
4246 | |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4247 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
110309 | 4248 (interactive "P") |
4249 (sql-product-interactive 'linter buffer)) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4250 |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4251 (defun sql-comint-linter (product options) |
108381 | 4252 "Create comint buffer and connect to Linter." |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4253 ;; Put all parameters to the program (if defined) in a list and call |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4254 ;; make-comint. |
108381 | 4255 (let ((params options) |
4256 (login nil) | |
4257 (old-mbx (getenv "LINTER_MBX"))) | |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4258 (if (not (string= "" sql-user)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4259 (setq login (concat sql-user "/" sql-password))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4260 (setq params (append (list "-u" login) params)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4261 (if (not (string= "" sql-server)) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4262 (setq params (append (list "-n" sql-server) params))) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4263 (if (string= "" sql-database) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4264 (setenv "LINTER_MBX" nil) |
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4265 (setenv "LINTER_MBX" sql-database)) |
109460
597339bd6bef
SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents:
108991
diff
changeset
|
4266 (sql-comint product params) |
52242
f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents:
51929
diff
changeset
|
4267 (setenv "LINTER_MBX" old-mbx))) |
48486
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4268 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4269 |
893d44670df9
Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents:
42799
diff
changeset
|
4270 |
24050 | 4271 (provide 'sql) |
4272 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
4273 ;; arch-tag: 7e1fa1c4-9ca2-402e-87d2-83a5eccb7ac3 |
24050 | 4274 ;;; sql.el ends here |
108381 | 4275 |