annotate lisp/progmodes/sql.el @ 109482:c9df47f7bbf3

SQL Mode V2.3 - cleanup connection handling
author Michael Mauger <mmaug@yahoo.com>
date Tue, 20 Jul 2010 21:56:55 -0400
parents 597339bd6bef
children b4b02bfd4d95
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; sql.el --- specialized comint.el for SQL interpreters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
100908
a9dc0e7c3f2b Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 96376
diff changeset
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 104304
diff changeset
4 ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
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
702be51912a8 Change maintainer.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
7 ;; Maintainer: Michael Mauger <mmaug@yahoo.com>
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
8 ;; Version: 2.3
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
38872
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
11 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
94673
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
15 ;; GNU Emacs is free software: you can redistribute it and/or modify
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; 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
17 ;; 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
18 ;; (at your option) any later version.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; GNU Emacs is distributed in the hope that it will be useful,
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; GNU General Public License for more details.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;; 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
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29
24354
6a438ef0b573 Set version to 1.4.1. Changed mail address to
Richard M. Stallman <rms@gnu.org>
parents: 24353
diff changeset
30 ;; 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
31 ;; 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
32 ;; list, see the web page at
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
33 ;; 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
34 ;; 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
35 ;; 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
36 ;; to forward them along (Thanks, Alex).
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
37
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
38 ;; 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
39 ;; 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
40 ;; 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
41 ;; 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
42 ;; 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
43 ;; 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
44 ;; 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
45
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
46 ;; 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
47 ;; 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
48 ;; 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
49 ;; 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
50 ;; 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
51 ;; 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
52 ;; On some assignments, I have used two or more of these concurrently.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; If anybody feels like extending this sql mode, take a look at the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;; above mentioned modes and write a sqlx-mode on top of this one. If
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; 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
57 ;; 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
58 ;; products and product-specific configuration.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; 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
61 ;; 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
62 ;; 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
63 ;; 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
64 ;; itself.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;; 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
67 ;; entry function used to create the SQLi buffers is shown with
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; `sql-help' (M-x sql-help).
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; Since sql-interactive-mode is built on top of the general
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 ;; command-interpreter-in-a-buffer mode (comint mode), it shares a
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 ;; common base functionality, and a common set of bindings, with all
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;; modes derived from comint mode. This makes these modes easier to
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ;; use.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
76 ;; 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
77 ;; statements can be sent to the SQL process in the SQLi buffer.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ;; 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
80 ;; the hooks available for customizing it, see the file `comint.el'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
82 ;; 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
83 ;; `imenu-add-menubar-index'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 ;;; Requirements for Emacs 19.34:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 ;; If you are using Emacs 19.34, you will have to get and install
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ;; the file regexp-opt.el
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ;; <URL:ftp://ftp.ifi.uio.no/pub/emacs/emacs-20.3/lisp/emacs-lisp/regexp-opt.el>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 ;; and the custom package
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 ;; <URL:http://www.dina.kvl.dk/~abraham/custom/>.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 ;;; Bugs:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
95 ;; 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
96 ;; 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
97 ;; 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
98 ;; 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
99 ;; awkward.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
100
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
101 ;; 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
102 ;; 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
103 ;; identifiers; ms (Microsoft SQLServer) also supports identifiers
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
104 ;; enclosed within brackets [].
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
106 ;;; Product Support:
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
107
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
108 ;; 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
109 ;; 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
110 ;; below):
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
111
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
112 ;; 1) Add the product to the list of known products.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
113
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
114 ;; (sql-add-product 'xyz "XyzDB"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
115 ;; '(:free-software t))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
116
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
117 ;; 2) Define font lock settings. All ANSI keywords will be
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
118 ;; highlighted automatically, so only product specific keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
119 ;; need to be defined here.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
120
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
121 ;; (defvar my-sql-mode-xyz-font-lock-keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
122 ;; '(("\\b\\(red\\|orange\\|yellow\\)\\b"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
123 ;; . font-lock-keyword-face))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
124 ;; "XyzDB SQL keywords used by font-lock.")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
125
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
126 ;; (sql-set-product-feature 'xyz
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
127 ;; :font-lock
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
128 ;; 'my-sql-mode-xyz-font-lock-keywords)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
129
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
130 ;; 3) Define any special syntax characters including comments and
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
131 ;; identifier characters.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
132
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
133 ;; (sql-set-product-feature 'xyz
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
134 ;; :syntax-alist ((?# . "w")))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
135
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
136 ;; 4) Define the interactive command interpreter for the database
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
137 ;; product.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
138
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
139 ;; (defcustom my-sql-xyz-program "ixyz"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
140 ;; "Command to start ixyz by XyzDB."
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
141 ;; :type 'file
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
142 ;; :group 'SQL)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
143 ;;
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
144 ;; (sql-set-product-feature 'xyz
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
145 ;; :sqli-program 'my-sql-xyz-program)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
146 ;; (sql-set-product-feature 'xyz
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
147 ;; :prompt-regexp "^xyzdb> ")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
148 ;; (sql-set-product-feature 'xyz
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
149 ;; :prompt-length 7)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
150
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
151 ;; 5) Define login parameters and command line formatting.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
152
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
153 ;; (defcustom my-sql-xyz-login-params '(user password server database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
154 ;; "Login parameters to needed to connect to XyzDB."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
155 ;; :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
156 ;; (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
157 ;; (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
158 ;; (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
159 ;; (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
160 ;; (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
161 ;; :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
162 ;;
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
163 ;; (sql-set-product-feature 'xyz
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
164 ;; :sqli-login 'my-sql-xyz-login-params)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
165
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
166 ;; (defcustom my-sql-xyz-options '("-X" "-Y" "-Z")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
167 ;; "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
168 ;; :type '(repeat string)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
169 ;; :group 'SQL)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
170 ;;
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
171 ;; (sql-set-product-feature 'xyz
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
172 ;; :sqli-options 'my-sql-xyz-options))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
173
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
174 ;; (defun my-sql-comint-xyz (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
175 ;; "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
176 ;;
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
177 ;; ;; Do something with `sql-user', `sql-password',
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
178 ;; ;; `sql-database', and `sql-server'.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
179 ;; (let ((params options))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
180 ;; (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
181 ;; (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
182 ;; (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
183 ;; (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
184 ;; (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
185 ;; (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
186 ;; (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
187 ;; (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
188 ;; (sql-comint product params)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
189 ;;
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
190 ;; (sql-set-product-feature 'xyz
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
191 ;; :sqli-comint-func 'my-sql-comint-xyz)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
192
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
193 ;; 6) Define a convienence function to invoke the SQL interpreter.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
194
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
195 ;; (defun my-sql-xyz ()
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
196 ;; "Run ixyz by XyzDB as an inferior process."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
197 ;; (interactive)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
198 ;; (sql-product-interactive 'xyz))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
199
51929
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
200 ;;; To Do:
51893
1a294cfb1636 Version 1.8.0 of sql-mode.
Juanma Barranquero <lekktu@gmail.com>
parents: 51607
diff changeset
201
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
202 ;; Improve keyword highlighting for individual products. I have tried
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
203 ;; to update those database that I use. Feel free to send me updates,
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
204 ;; or direct me to the reference manuals for your favorite database.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
205
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
206 ;; When there are no keywords defined, the ANSI keywords are
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
207 ;; highlighted. ANSI keywords are highlighted even if the keyword is
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
208 ;; not used for your current product. This should help identify
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
209 ;; portability concerns.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
210
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
211 ;; Add different highlighting levels.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
212
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
213 ;; Add support for listing available tables or the columns in a table.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 ;;; Thanks to all the people who helped me out:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
217 ;; Alex Schroeder <alex@gnu.org> -- the original author
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 ;; Kai Blauberg <kai.blauberg@metla.fi>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 ;; <ibalaban@dalet.com>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 ;; Yair Friedman <yfriedma@JohnBryce.Co.Il>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 ;; 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
222 ;; nino <nino@inform.dk>
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
223 ;; 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
224 ;; 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
225 ;; 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
226 ;; 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
227 ;; Harald Maier <maierh@myself.com> -- sql-send-string
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
228 ;; 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
229
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 ;;; Code:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 (require 'comint)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 ;; 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
236 (eval-when-compile
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
237 (require 'regexp-opt))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 (require 'custom)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
239 (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
240 (setq max-specpdl-size (max max-specpdl-size 2000)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241
65240
e3995ff46137 (font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents: 65198
diff changeset
242 (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
243 (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
244 (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
245
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 ;;; Allow customization
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 (defgroup SQL nil
64052
68f51d595f7f (SQL): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 63410
diff changeset
249 "Running a SQL interpreter from within Emacs buffers."
24556
cfdf441b1331 Add defgroup :version.
Dave Love <fx@gnu.org>
parents: 24354
diff changeset
250 :version "20.4"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
251 :group 'languages
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 :group 'processes)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
254 ;; These four variables will be used as defaults, if set.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 (defcustom sql-user ""
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
257 "Default username."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 :type 'string
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
259 :group 'SQL
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
260 :safe 'stringp)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 (defcustom sql-password ""
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
263 "Default password.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 Storing your password in a textfile such as ~/.emacs could be dangerous.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 Customizing your password will store it in your ~/.emacs file."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
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 :risky t)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (defcustom sql-database ""
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
272 "Default database."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
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)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 (defcustom sql-server ""
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
278 "Default server or host."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 :type 'string
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
280 :group 'SQL
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
281 :safe 'stringp)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
282
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
283 (defcustom sql-port nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
284 "Default server or host."
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
285 :version "24.1"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
286 :type 'number
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
287 :group 'SQL
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
288 :safe 'numberp)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
290 ;; SQL Product support
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
291
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
292 (defvar sql-interactive-product nil
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
293 "Product under `sql-interactive-mode'.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
294
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
295 (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
296 "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
297
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
298 (defvar sql-product-alist
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
299 '((ansi
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
300 :name "ANSI"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
301 :font-lock sql-mode-ansi-font-lock-keywords)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
302
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
303 (db2
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
304 :name "DB2"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
305 :font-lock sql-mode-db2-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
306 :sqli-program sql-db2-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
307 :sqli-options sql-db2-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
308 :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
309 :sqli-comint-func sql-comint-db2
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
310 :prompt-regexp "^db2 => "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
311 :prompt-length 7
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
312 :input-filter sql-escape-newlines-filter)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
313
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
314 (informix
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
315 :name "Informix"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
316 :font-lock sql-mode-informix-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
317 :sqli-program sql-informix-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
318 :sqli-options sql-informix-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
319 :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
320 :sqli-comint-func sql-comint-informix
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
321 :prompt-regexp "^> "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
322 :prompt-length 2
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
323 :syntax-alist ((?{ . "<") (?} . ">")))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
324
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
325 (ingres
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
326 :name "Ingres"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
327 :font-lock sql-mode-ingres-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
328 :sqli-program sql-ingres-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
329 :sqli-options sql-ingres-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
330 :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
331 :sqli-comint-func sql-comint-ingres
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
332 :prompt-regexp "^\* "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
333 :prompt-length 2)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
334
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
335 (interbase
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
336 :name "Interbase"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
337 :font-lock sql-mode-interbase-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
338 :sqli-program sql-interbase-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
339 :sqli-options sql-interbase-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
340 :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
341 :sqli-comint-func sql-comint-interbase
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
342 :prompt-regexp "^SQL> "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
343 :prompt-length 5)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
344
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
345 (linter
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
346 :name "Linter"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
347 :font-lock sql-mode-linter-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
348 :sqli-program sql-linter-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
349 :sqli-options sql-linter-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
350 :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
351 :sqli-comint-func sql-comint-linter
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
352 :prompt-regexp "^SQL>"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
353 :prompt-length 4)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
354
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
355 (ms
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
356 :name "Microsoft"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
357 :font-lock sql-mode-ms-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
358 :sqli-program sql-ms-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
359 :sqli-options sql-ms-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
360 :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
361 :sqli-comint-func sql-comint-ms
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
362 :prompt-regexp "^[0-9]*>"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
363 :prompt-length 5
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
364 :syntax-alist ((?@ . "w"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
365 :terminator ("^go" . "go"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
366
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
367 (mysql
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
368 :name "MySQL"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
369 :free-software t
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
370 :font-lock sql-mode-mysql-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
371 :sqli-program sql-mysql-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
372 :sqli-options sql-mysql-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
373 :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
374 :sqli-comint-func sql-comint-mysql
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
375 :prompt-regexp "^mysql> "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
376 :prompt-length 6
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
377 :input-filter sql-remove-tabs-filter)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
378
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
379 (oracle
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
380 :name "Oracle"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
381 :font-lock sql-mode-oracle-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
382 :sqli-program sql-oracle-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
383 :sqli-options sql-oracle-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
384 :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
385 :sqli-comint-func sql-comint-oracle
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
386 :prompt-regexp "^SQL> "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
387 :prompt-length 5
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
388 :syntax-alist ((?$ . "w") (?# . "w"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
389 :terminator ("\\(^/\\|;\\)" . "/")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
390 :input-filter sql-placeholders-filter)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
391
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
392 (postgres
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
393 :name "Postgres"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
394 :free-software t
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
395 :font-lock sql-mode-postgres-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
396 :sqli-program sql-postgres-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
397 :sqli-options sql-postgres-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
398 :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
399 :sqli-comint-func sql-comint-postgres
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
400 :prompt-regexp "^.*[#>] *"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
401 :prompt-length 5
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
402 :input-filter sql-remove-tabs-filter
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
403 :terminator ("\\(^[\\]g\\|;\\)" . ";"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
404
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
405 (solid
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
406 :name "Solid"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
407 :font-lock sql-mode-solid-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
408 :sqli-program sql-solid-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
409 :sqli-options sql-solid-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
410 :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
411 :sqli-comint-func sql-comint-solid
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
412 :prompt-regexp "^"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
413 :prompt-length 0)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
414
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
415 (sqlite
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
416 :name "SQLite"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
417 :free-software t
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
418 :font-lock sql-mode-sqlite-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
419 :sqli-program sql-sqlite-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
420 :sqli-options sql-sqlite-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
421 :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
422 :sqli-comint-func sql-comint-sqlite
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
423 :prompt-regexp "^sqlite> "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
424 :prompt-length 8)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
425
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
426 (sybase
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
427 :name "Sybase"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
428 :font-lock sql-mode-sybase-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
429 :sqli-program sql-sybase-program
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
430 :sqli-options sql-sybase-options
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
431 :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
432 :sqli-comint-func sql-comint-sybase
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
433 :prompt-regexp "^SQL> "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
434 :prompt-length 5
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
435 :syntax-alist ((?@ . "w"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
436 :terminator ("^go" . "go"))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
437 )
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
438 "An alist of product specific configuration settings.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
439
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
440 Without an entry in this list a product will not be properly
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
441 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
442
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
443 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
444
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
445 \(PRODUCT FEATURE VALUE ...)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
446
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
447 where PRODUCT is the appropriate value of `sql-product'. The
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
448 product name is then followed by FEATURE-VALUE pairs. If a
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
449 FEATURE is not specified, its VALUE is treated as nil. FEATURE
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
450 may be any one of the following:
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
451
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
452 :name string containing the displayable name of
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
453 the product.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
454
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
455 :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
456
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
457 :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
458 specific font lock highlighting patterns.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
459
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
460 :sqli-program name of the variable containing the product
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
461 specific interactive program name.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
462
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
463 :sqli-options name of the variable containing the list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
464 of product specific options.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
465
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
466 :sqli-login name of the variable containing the list of
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
467 login parameters (i.e., user, password,
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
468 database and server) needed to connect to
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
469 the database.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
470
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
471 :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
472 parameters that will use the values of
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
473 `sql-user', `sql-password',
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
474 `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
475 comint buffer and connect to the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
476 database. Do product specific
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
477 configuration of comint in this function.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
478
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
479 :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
480 the prompt issued by the product
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
481 interpreter.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
482
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
483 :prompt-length length of the prompt on the line.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
484
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
485 :input-filter function which can filter strings sent to
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
486 the command interpreter. It is also used
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
487 by the `sql-send-string',
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
488 `sql-send-region', `sql-send-paragraph'
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
489 and `sql-send-buffer' functions. The
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
490 function is passed the string sent to the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
491 command interpreter and must return the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
492 filtered string.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
493
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
494 :terminator the terminator to be sent after a
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
495 `sql-send-string', `sql-send-region',
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
496 `sql-send-paragraph' and
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
497 `sql-send-buffer' command. May be the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
498 literal string or a cons of a regexp to
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
499 match an existing terminator in the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
500 string and the terminator to be used if
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
501 its absent. By default \";\".
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
502
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
503 :syntax-alist alist of syntax table entries to enable
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
504 special character treatment by font-lock
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
505 and imenu.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
506
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
507 Other features can be stored but they will be ignored. However,
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
508 you can develop new functionality which is product independent by
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
509 using `sql-get-product-feature' to lookup the product specific
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
510 settings.")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
511
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
512 (defvar sql-indirect-features
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
513 '(:font-lock :sqli-program :sqli-options :sqli-login))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
514
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
515 ;;;###autoload
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
516 (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
517 "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
518 product.
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
519
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
520 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
521
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
522 \(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
523
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
524 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
525 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
526 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
527
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
528 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
529 are:
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
530
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
531 `sql-product'
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
532 `sql-user'
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
533 `sql-password'
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
534 `sql-port'
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
535 `sql-server'
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
536 `sql-database'
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
537
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
538 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
539 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
540
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
541 :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
542 :value-type
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
543 (set
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
544 (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
545 (choice
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
546 ,@(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
547 `(const :tag
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
548 ,(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
549 (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
550 (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
551 sql-product-alist)))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
552 (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
553 (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
554 (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
555 (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
556 (group (const :tag "Port" sql-port) integer)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
557 (repeat :inline t
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
558 (list :tab "Other"
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
559 (symbol :tag " Variable Symbol")
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
560 (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
561 :version "24.1"
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
562 :group 'SQL)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
563
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
564 ;;;###autoload
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
565 (defcustom sql-product 'ansi
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
566 "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
567 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
568 :type `(choice
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
569 ,@(mapcar (lambda (prod-info)
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
570 `(const :tag
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
571 ,(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
572 (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
573 ,(car prod-info)))
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
574 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
575 :group 'SQL
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
576 :safe 'symbolp)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
577
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
578 ;; 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
579
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
580 (defcustom sql-electric-stuff nil
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
581 "Treat some input as electric.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
582 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
583 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
584 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
585 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
586 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
587 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
588 :type '(choice (const :tag "Nothing" nil)
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
589 (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
590 (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
591 :version "20.8"
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
592 :group 'SQL)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
593
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
594 (defcustom sql-send-terminator nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
595 "When non-nil, add a terminator to text sent to the SQL interpreter.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
596
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
597 When text is sent to the SQL interpreter (via `sql-send-string',
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
598 `sql-send-region', `sql-send-paragraph' or `sql-send-buffer'), a
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
599 command terminator can be automatically sent as well. The
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
600 terminator is not sent, if the string sent already ends with the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
601 terminator.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
602
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
603 If this value is t, then the default command terminator for the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
604 SQL interpreter is sent. If this value is a string, then the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
605 string is sent.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
606
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
607 If the value is a cons cell of the form (PAT . TERM), then PAT is
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
608 a regexp used to match the terminator in the string and TERM is
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
609 the terminator to be sent. This form is useful if the SQL
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
610 interpreter has more than one way of submitting a SQL command.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
611 The PAT regexp can match any of them, and TERM is the way we do
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
612 it automatically."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
613
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
614 :type '(choice (const :tag "No Terminator" nil)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
615 (const :tag "Default Terminator" t)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
616 (string :tag "Terminator String")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
617 (cons :tag "Terminator Pattern and String"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
618 (string :tag "Terminator Pattern")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
619 (string :tag "Terminator String")))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
620 :version "22.2"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
621 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
622
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
623 (defcustom sql-pop-to-buffer-after-send-region nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
624 "When non-nil, pop to the buffer SQL statements are sent to.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
625
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
626 After a call to `sql-sent-string', `sql-send-region',
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
627 `sql-send-paragraph' or `sql-send-buffer', the window is split
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
628 and the SQLi buffer is shown. If this variable is not nil, that
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
629 buffer's window will be selected by calling `pop-to-buffer'. If
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
630 this variable is nil, that buffer is shown using
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
631 `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
632 :type 'boolean
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
633 :group 'SQL)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
634
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
635 ;; imenu support for sql-mode.
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
636
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
637 (defvar sql-imenu-generic-expression
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
638 ;; 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
639 '(("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
640 ("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
641 ("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
642 ("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
643 ("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
644 ("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
645 ("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
646 ("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
647 ("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
648 "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
649
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
650 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
651 entered. Subsequent changes to `sql-imenu-generic-expression' will
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
652 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
653 a local variable.")
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
654
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
655 ;; history file
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
656
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
657 (defcustom sql-input-ring-file-name nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
658 "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
659
24861
0d593aa15c0f (sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 24591
diff changeset
660 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
661 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
662 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
663 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
664 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
665
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
666 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
667
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
668 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
669 `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
670 :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
671 (file))
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
672 :group 'SQL)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
673
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
674 (defcustom sql-input-ring-separator "\n--\n"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
675 "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
676
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
677 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
678 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
679 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
680
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
681 This variable used to initialize `comint-input-ring-separator'.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
682 `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
683 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
684 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
685 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
686 `sql-input-ring-separator' to \"\\n\"."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 :type 'string
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
688 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690 ;; The usual hooks
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 (defcustom sql-interactive-mode-hook '()
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
693 "Hook for customizing `sql-interactive-mode'."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
694 :type 'hook
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
696
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 (defcustom sql-mode-hook '()
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
698 "Hook for customizing `sql-mode'."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 :type 'hook
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
700 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
702 (defcustom sql-set-sqli-hook '()
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
703 "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
704
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
705 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
706 is changed."
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
707 :type 'hook
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
708 :group 'SQL)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
709
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
710 ;; Customization for Oracle
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712 (defcustom sql-oracle-program "sqlplus"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
713 "Command to start sqlplus by Oracle.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715 Starts `sql-interactive-mode' after doing some setup.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
717 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
718 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
719 You will find the file in your Orant\\bin directory."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
720 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
723 (defcustom sql-oracle-options nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
724 "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
725 :type '(repeat string)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
726 :version "20.8"
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
727 :group 'SQL)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
728
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
729 (defcustom sql-oracle-login-params '(user password database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
730 "List of login parameters needed to connect to Oracle."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
731 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
732 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
733 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
734 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
735 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
736 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
737 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
738 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
739
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
740 (defcustom sql-oracle-scan-on t
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
741 "Non-nil if placeholders should be replaced in Oracle SQLi.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
742
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
743 When non-nil, Emacs will scan text sent to sqlplus and prompt
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
744 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
745 is needed on Windows where sqlplus output is buffered and the
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
746 prompts are not shown until after the text is entered.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
747
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
748 You will probably want to issue the following command in sqlplus
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
749 to be safe:
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
750
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
751 SET SCAN OFF"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
752 :type 'boolean
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
753 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
754
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
755 ;; Customization for SQLite
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
756
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
757 (defcustom sql-sqlite-program "sqlite"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
758 "Command to start SQLite.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
759
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
760 Starts `sql-interactive-mode' after doing some setup."
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
761 :type 'file
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
762 :group 'SQL)
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
763
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
764 (defcustom sql-sqlite-options nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
765 "List of additional options for `sql-sqlite-program'."
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
766 :type '(repeat string)
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
767 :version "20.8"
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
768 :group 'SQL)
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
769
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
770 (defcustom sql-sqlite-login-params '(database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
771 "List of login parameters needed to connect to SQLite."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
772 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
773 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
774 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
775 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
776 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
777 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
778 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
779 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
780
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
781 ;; Customization for MySql
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
782
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
783 (defcustom sql-mysql-program "mysql"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
784 "Command to start mysql by TcX.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
785
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
786 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
787 :type 'file
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
788 :group 'SQL)
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
789
32169
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
790 (defcustom sql-mysql-options nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
791 "List of additional options for `sql-mysql-program'.
34704
7cb3b80e66b8 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32621
diff changeset
792 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
793 on Windows: \"-C\" \"-t\" \"-f\" \"-n\"."
32169
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
794 :type '(repeat string)
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
795 :version "20.8"
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
796 :group 'SQL)
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
797
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
798 (defcustom sql-mysql-login-params '(user password database server)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
799 "List of login parameters needed to connect to MySql."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
800 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
801 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
802 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
803 (const server)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
804 (const database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
805 (const port)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
806 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
807 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
808
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
809 ;; Customization for Solid
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
810
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
811 (defcustom sql-solid-program "solsql"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
812 "Command to start SOLID SQL Editor.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
813
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
814 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
815 :type 'file
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
816 :group 'SQL)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
817
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
818 (defcustom sql-solid-login-params '(user password server)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
819 "List of login parameters needed to connect to Solid."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
820 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
821 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
822 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
823 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
824 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
825 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
826 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
827 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
828
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
829 ;; Customization for Sybase
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
830
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831 (defcustom sql-sybase-program "isql"
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
832 "Command to start isql by Sybase.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
833
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
834 Starts `sql-interactive-mode' after doing some setup."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
835 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
836 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837
32621
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
838 (defcustom sql-sybase-options nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
839 "List of additional options for `sql-sybase-program'.
32621
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
840 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
841 :type '(repeat string)
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
842 :version "20.8"
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
843 :group 'SQL)
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
844
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
845 (defcustom sql-sybase-login-params '(server user password database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
846 "List of login parameters needed to connect to Sybase."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
847 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
848 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
849 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
850 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
851 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
852 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
853 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
854 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
855
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
856 ;; Customization for Informix
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858 (defcustom sql-informix-program "dbaccess"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
859 "Command to start dbaccess by Informix.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
860
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
861 Starts `sql-interactive-mode' after doing some setup."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
862 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
863 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
864
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
865 (defcustom sql-informix-login-params '(database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
866 "List of login parameters needed to connect to Informix."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
867 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
868 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
869 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
870 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
871 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
872 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
873 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
874 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
875
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
876 ;; Customization for Ingres
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
877
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
878 (defcustom sql-ingres-program "sql"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
879 "Command to start sql by Ingres.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
880
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
881 Starts `sql-interactive-mode' after doing some setup."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
882 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
883 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
884
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
885 (defcustom sql-ingres-login-params '(database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
886 "List of login parameters needed to connect to Ingres."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
887 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
888 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
889 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
890 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
891 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
892 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
893 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
894 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
895
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
896 ;; Customization for Microsoft
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
897
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
898 (defcustom sql-ms-program "osql"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
899 "Command to start osql by Microsoft.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
900
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
901 Starts `sql-interactive-mode' after doing some setup."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
904
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
905 (defcustom sql-ms-options '("-w" "300" "-n")
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
906 ;; -w is the linesize
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
907 "List of additional options for `sql-ms-program'."
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
908 :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
909 :version "22.1"
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
910 :group 'SQL)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
911
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
912 (defcustom sql-ms-login-params '(user password server database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
913 "List of login parameters needed to connect to Microsoft."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
914 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
915 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
916 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
917 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
918 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
919 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
920 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
921 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
922
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
923 ;; Customization for Postgres
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
924
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
925 (defcustom sql-postgres-program "psql"
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
926 "Command to start psql by Postgres.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
927
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
928 Starts `sql-interactive-mode' after doing some setup."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
929 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
930 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
931
34704
7cb3b80e66b8 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32621
diff changeset
932 (defcustom sql-postgres-options '("-P" "pager=off")
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
933 "List of additional options for `sql-postgres-program'.
38872
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
934 The default setting includes the -P option which breaks older versions
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
935 of the psql client (such as version 6.5.3). The -P option is equivalent
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
936 to the --pset option. If you want the psql to prompt you for a user
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
937 name, add the string \"-u\" to the list of options. If you want to
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
938 provide a user name on the command line (newer versions such as 7.1),
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
939 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
940 :type '(repeat string)
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
941 :version "20.8"
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
942 :group 'SQL)
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
943
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
944 (defcustom sql-postgres-login-params '(user database server)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
945 "List of login parameters needed to connect to Postgres."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
946 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
947 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
948 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
949 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
950 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
951 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
952 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
953 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
954
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
955 ;; Customization for Interbase
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
956
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
957 (defcustom sql-interbase-program "isql"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
958 "Command to start isql by Interbase.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
959
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
960 Starts `sql-interactive-mode' after doing some setup."
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
961 :type 'file
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
962 :group 'SQL)
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
963
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
964 (defcustom sql-interbase-options nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
965 "List of additional options for `sql-interbase-program'."
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
966 :type '(repeat string)
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
967 :version "20.8"
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
968 :group 'SQL)
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
969
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
970 (defcustom sql-interbase-login-params '(user password database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
971 "List of login parameters needed to connect to Interbase."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
972 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
973 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
974 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
975 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
976 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
977 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
978 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
979 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
980
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
981 ;; Customization for DB2
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
982
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
983 (defcustom sql-db2-program "db2"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
984 "Command to start db2 by IBM.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
985
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
986 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
987 :type 'file
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
988 :group 'SQL)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
989
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
990 (defcustom sql-db2-options nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
991 "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
992 :type '(repeat string)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
993 :version "20.8"
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
994 :group 'SQL)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
995
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
996 (defcustom sql-db2-login-params nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
997 "List of login parameters needed to connect to DB2."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
998 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
999 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1000 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1001 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
1002 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
1003 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1004 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1005 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1006
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1007 ;; Customization for Linter
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1008
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1009 (defcustom sql-linter-program "inl"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1010 "Command to start inl by RELEX.
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1011
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1012 Starts `sql-interactive-mode' after doing some setup."
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1013 :type 'file
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1014 :group 'SQL)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1015
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1016 (defcustom sql-linter-options nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1017 "List of additional options for `sql-linter-program'."
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1018 :type '(repeat string)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1019 :version "21.3"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1020 :group 'SQL)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1021
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1022 (defcustom sql-linter-login-params '(user password database server)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1023 "Login parameters to needed to connect to Linter."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1024 :type '(repeat (choice
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1025 (const user)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1026 (const password)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1027 (const server)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
1028 (const database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
1029 (const port)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1030 :version "24.1"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1031 :group 'SQL)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1032
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1033
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1034
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1035 ;;; Variables which do not need customization
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1037 (defvar sql-user-history nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1038 "History of usernames used.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1040 (defvar sql-database-history nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041 "History of databases used.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1043 (defvar sql-server-history nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1044 "History of servers used.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1045
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1046 (defvar sql-port-history nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1047 "History of ports used.")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1048
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049 ;; Passwords are not kept in a history.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1051 (defvar sql-buffer nil
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1052 "Current SQLi buffer.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1053
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
1054 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
1055 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
1056 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
1057 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
1058 the local value of `sql-buffer' using \\[sql-set-sqli-buffer].")
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1059
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1060 (defvar sql-prompt-regexp nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1061 "Prompt used to initialize `comint-prompt-regexp'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1062
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1063 You can change `sql-prompt-regexp' on `sql-interactive-mode-hook'.")
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1064
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
1065 (defvar sql-prompt-length 0
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
1066 "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
1067
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1068 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
1069
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
1070 (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
1071 "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
1072
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
1073 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
1074
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1075 ;; Keymap for sql-interactive-mode.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1076
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1077 (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
1078 (let ((map (make-sparse-keymap)))
64837
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
1079 (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
1080 (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
1081 (if (fboundp 'set-keymap-parents)
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
1082 (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
1083 (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
1084 (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
1085 (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
1086 (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
1087 (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
1088 (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
1089 (define-key map (kbd ";") 'sql-magic-semicolon)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1090 map)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1091 "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
1092 Based on `comint-mode-map'.")
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1093
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1094 ;; Keymap for sql-mode.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1095
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1096 (defvar sql-mode-map
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1097 (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
1098 (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
1099 (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
1100 (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
1101 (define-key map (kbd "C-c C-b") 'sql-send-buffer)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1102 (define-key map (kbd "C-c C-i") 'sql-product-interactive)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1103 map)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1104 "Mode map used for `sql-mode'.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1105
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1106 ;; easy menu for sql-mode.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1107
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1108 (easy-menu-define
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1109 sql-mode-menu sql-mode-map
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1110 "Menu for `sql-mode'."
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1111 `("SQL"
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1112 ["Send Paragraph" sql-send-paragraph (and (buffer-live-p sql-buffer)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1113 (get-buffer-process sql-buffer))]
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1114 ["Send Region" sql-send-region (and mark-active
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1115 (buffer-live-p sql-buffer)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1116 (get-buffer-process sql-buffer))]
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1117 ["Send Buffer" sql-send-buffer (and (buffer-live-p sql-buffer)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1118 (get-buffer-process sql-buffer))]
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1119 ["Send String" sql-send-string (and (buffer-live-p sql-buffer)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1120 (get-buffer-process sql-buffer))]
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1121 "--"
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1122 ["Start SQLi session" sql-product-interactive
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1123 :visible (not sql-connection-alist)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1124 :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
1125 ("Start..."
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1126 :visible sql-connection-alist
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1127 :filter sql-connection-menu-filter
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1128 "--"
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1129 ["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
1130 ["--"
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1131 :visible sql-connection-alist]
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1132 ["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
1133 ["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
1134 ["Pop to SQLi buffer after send"
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1135 sql-toggle-pop-to-buffer-after-send-region
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1136 :style toggle
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1137 :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
1138 ["--" nil nil]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1139 ("Product"
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1140 ,@(mapcar (lambda (prod-info)
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1141 (let* ((prod (pop prod-info))
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1142 (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
1143 (capitalize (symbol-name prod))))
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1144 (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
1145 (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
1146 (interactive)
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1147 (sql-set-product ',prod)))
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1148 (vector name cmd
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1149 :style 'radio
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1150 :selected `(eq sql-product ',prod))))
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
1151 sql-product-alist))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1152
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
1153 ;; 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
1154
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1155 (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
1156 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
1157 "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
1158 '("SQL"
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1159 ["Rename Buffer" sql-rename-buffer t]
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
1160 ["Save Connection" sql-save-connection (not sql-connection)]))
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
1161
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1162 ;; Abbreviations -- if you want more of them, define them in your
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1163 ;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1164
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1165 (defvar sql-mode-abbrev-table nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1166 "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
1167 (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
1168 (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
1169
84922
1b6b77d0f75a (top): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
1170 (mapc
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1171 ;; 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
1172 '(lambda (abbrev)
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
1173 (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
1174 (expansion (cdr abbrev)))
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
1175 (condition-case nil
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
1176 (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
1177 (error
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
1178 (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
1179 '(("ins" . "insert")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1180 ("upd" . "update")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1181 ("del" . "delete")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1182 ("sel" . "select")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1183 ("proc" . "procedure")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1184 ("func" . "function")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1185 ("cr" . "create")))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1186
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1187 ;; Syntax Table
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1188
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1189 (defvar sql-mode-syntax-table
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1190 (let ((table (make-syntax-table)))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1191 ;; C-style comments /**/ (see elisp manual "Syntax Flags"))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1192 (modify-syntax-entry ?/ ". 14" table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1193 (modify-syntax-entry ?* ". 23" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1194 ;; 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
1195 (modify-syntax-entry ?- ". 12b" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1196 ;; newline and formfeed end comments
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1197 (modify-syntax-entry ?\n "> b" table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1198 (modify-syntax-entry ?\f "> b" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1199 ;; single quotes (') delimit strings
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
1200 (modify-syntax-entry ?' "\"" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1201 ;; double quotes (") don't delimit strings
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1202 (modify-syntax-entry ?\" "." table)
40971
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
1203 ;; backslash is no escape character
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
1204 (modify-syntax-entry ?\\ "." table)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1205 table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1206 "Syntax table used in `sql-mode' and `sql-interactive-mode'.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1207
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1208 ;; Font lock support
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1209
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1210 (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
1211 (eval-when-compile
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1212 (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
1213 "\\(?:\\w+\\s-+\\)*" ;; optional intervening keywords
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1214 "\\(?: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
1215 "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+"
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1216 "\\(\\w+\\)")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
1217 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
1218
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1219 "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
1220
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1221 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
1222 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
1223 `font-lock-keywords' entry.")
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1224
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1225 ;; While there are international and American standards for SQL, they
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1226 ;; are not followed closely, and most vendors offer significant
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1227 ;; capabilities beyond those defined in the standard specifications.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1228
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1229 ;; SQL mode provides support for hilighting based on the product. In
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1230 ;; addition to hilighting the product keywords, any ANSI keywords not
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1231 ;; used by the product are also hilighted. This will help identify
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1232 ;; keywords that could be restricted in future versions of the product
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1233 ;; or might be a problem if ported to another product.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1234
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1235 ;; To reduce the complexity and size of the regular expressions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1236 ;; generated to match keywords, ANSI keywords are filtered out of
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1237 ;; product keywords if they are equivalent. To do this, we define a
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1238 ;; function `sql-font-lock-keywords-builder' that removes any keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1239 ;; that are matched by the ANSI patterns and results in the same face
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1240 ;; being applied. For this to work properly, we must play some games
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1241 ;; with the execution and compile time behavior. This code is a
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1242 ;; little tricky but works properly.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1243
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1244 ;; When defining the keywords for individual products you should
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1245 ;; include all of the keywords that you want matched. The filtering
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1246 ;; against the ANSI keywords will be automatic if you use the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1247 ;; `sql-font-lock-keywords-builder' function and follow the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1248 ;; implementation pattern used for the other products in this file.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1249
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1250 (eval-when-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1251 (defvar sql-mode-ansi-font-lock-keywords)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1252 (setq sql-mode-ansi-font-lock-keywords nil))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1253
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1254 (eval-and-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1255 (defun sql-font-lock-keywords-builder (face boundaries &rest keywords)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1256 "Generation of regexp matching any one of KEYWORDS."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1257
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1258 (let ((bdy (or boundaries '("\\b" . "\\b")))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1259 kwd)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1260
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1261 ;; Remove keywords that are defined in ANSI
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1262 (setq kwd keywords)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1263 (dolist (k keywords)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1264 (catch 'next
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1265 (dolist (a sql-mode-ansi-font-lock-keywords)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1266 (when (and (eq face (cdr a))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1267 (eq (string-match (car a) k 0) 0)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1268 (eq (match-end 0) (length k)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1269 (setq kwd (delq k kwd))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1270 (throw 'next nil)))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1271
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1272 ;; Create a properly formed font-lock-keywords item
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1273 (cons (concat (car bdy)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1274 (regexp-opt kwd t)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1275 (cdr bdy))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1276 face))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1277
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1278 (eval-when-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1279 (setq sql-mode-ansi-font-lock-keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1280 (list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1281 ;; ANSI Non Reserved keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1282 (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
1283 "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
1284 "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
1285 "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
1286 "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
1287 "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
1288 "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
1289 "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
1290 "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
1291 "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
1292 "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
1293 "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
1294 "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
1295 "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
1296 "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
1297 "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
1298 "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
1299 "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
1300 "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
1301 "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
1302 "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
1303 "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
1304 "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
1305 "transaction_active" "transactions_committed"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1306 "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
1307 "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
1308 "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
1309 "user_defined_type_schema"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1310 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1311 ;; ANSI Reserved keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1312 (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
1313 "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
1314 "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
1315 "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
1316 "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
1317 "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
1318 "connection" "constraint" "constraints" "constructor" "continue"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1319 "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
1320 "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
1321 "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
1322 "destructor" "deterministic" "diagnostics" "dictionary" "disconnect"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1323 "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
1324 "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
1325 "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
1326 "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
1327 "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
1328 "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
1329 "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
1330 "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
1331 "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
1332 "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
1333 "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
1334 "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
1335 "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
1336 "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
1337 "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
1338 "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
1339 "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
1340 "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
1341 "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
1342 "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
1343 "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
1344 "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
1345 "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
1346 "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
1347 "where" "with" "without" "work" "write" "year"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1348 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1349
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1350 ;; ANSI Functions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1351 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1352 "abs" "avg" "bit_length" "cardinality" "cast" "char_length"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1353 "character_length" "coalesce" "convert" "count" "current_date"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1354 "current_path" "current_role" "current_time" "current_timestamp"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1355 "current_user" "extract" "localtime" "localtimestamp" "lower" "max"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1356 "min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1357 "substring" "sum" "system_user" "translate" "treat" "trim" "upper"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1358 "user"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1359 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1360 ;; ANSI Data Types
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1361 (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
1362 "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
1363 "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
1364 "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
1365 "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
1366 "varying" "zone"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1367 ))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1368
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1369 (defvar sql-mode-ansi-font-lock-keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1370 (eval-when-compile sql-mode-ansi-font-lock-keywords)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1371 "ANSI SQL keywords used by font-lock.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1372
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1373 This variable is used by `sql-mode' and `sql-interactive-mode'. The
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1374 regular expressions are created during compilation by calling the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1375 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
1376 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
1377 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
1378
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1379 (defvar sql-mode-oracle-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1380 (eval-when-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1381 (list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1382 ;; Oracle SQL*Plus Commands
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1383 (cons
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1384 (concat
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1385 "^\\(?:\\(?:" (regexp-opt '(
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1386 "@" "@@" "accept" "append" "archive" "attribute" "break"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1387 "btitle" "change" "clear" "column" "connect" "copy" "define"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1388 "del" "describe" "disconnect" "edit" "execute" "exit" "get" "help"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1389 "host" "input" "list" "password" "pause" "print" "prompt" "recover"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1390 "remark" "repfooter" "repheader" "run" "save" "show" "shutdown"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1391 "spool" "start" "startup" "store" "timing" "ttitle" "undefine"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1392 "variable" "whenever"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1393 ) t)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1394
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1395 "\\)\\|"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1396 "\\(?:compute\\s-+\\(?:avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1397 "\\(?:set\\s-+\\("
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1398
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1399 (regexp-opt
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1400 '("appi" "appinfo" "array" "arraysize" "auto" "autocommit"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1401 "autop" "autoprint" "autorecovery" "autot" "autotrace" "blo"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1402 "blockterminator" "buffer" "closecursor" "cmds" "cmdsep"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1403 "colsep" "com" "compatibility" "con" "concat" "constraint"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1404 "constraints" "copyc" "copycommit" "copytypecheck" "database"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1405 "def" "define" "document" "echo" "editf" "editfile" "emb"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1406 "embedded" "esc" "escape" "feed" "feedback" "flagger" "flu"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1407 "flush" "hea" "heading" "heads" "headsep" "instance" "lin"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1408 "linesize" "lobof" "loboffset" "logsource" "long" "longc"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1409 "longchunksize" "maxdata" "newp" "newpage" "null" "num"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1410 "numf" "numformat" "numwidth" "pages" "pagesize" "pau"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1411 "pause" "recsep" "recsepchar" "role" "scan" "serveroutput"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1412 "shift" "shiftinout" "show" "showmode" "space" "sqlbl"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1413 "sqlblanklines" "sqlc" "sqlcase" "sqlco" "sqlcontinue" "sqln"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1414 "sqlnumber" "sqlp" "sqlpluscompat" "sqlpluscompatibility"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1415 "sqlpre" "sqlprefix" "sqlprompt" "sqlt" "sqlterminator"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1416 "statement_id" "suf" "suffix" "tab" "term" "termout" "ti"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1417 "time" "timi" "timing" "transaction" "trim" "trimout" "trims"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1418 "trimspool" "truncate" "und" "underline" "ver" "verify" "wra"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1419 "wrap")) "\\)\\)"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1420
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1421 "\\)\\b.*"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1422 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1423 'font-lock-doc-face)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1424 '("^[ \t]*rem\\(?:ark\\)?.*" . font-lock-comment-face)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1425
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1426 ;; Oracle Functions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1427 (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
1428 "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
1429 "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
1430 "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
1431 "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
1432 "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
1433 "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
1434 "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
1435 "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
1436 "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
1437 "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
1438 "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
1439 "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
1440 "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
1441 "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
1442 "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
1443 "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
1444 "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
1445 "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
1446 "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
1447 "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
1448 "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
1449 "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
1450 "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
1451 "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
1452 "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
1453 "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
1454 "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
1455 "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
1456 "xmlagg" "xmlattribute" "xmlcolattval" "xmlconcat" "xmlelement"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1457 "xmlforest" "xmlsequence" "xmltransform"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1458 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1459 ;; Oracle Keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1460 (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
1461 "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
1462 "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
1463 "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
1464 "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
1465 "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
1466 "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
1467 "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
1468 "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
1469 "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
1470 "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
1471 "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
1472 "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
1473 "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
1474 "constraint" "constraints" "constructor" "contents" "context"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1475 "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
1476 "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
1477 "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
1478 "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
1479 "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
1480 "dictionary" "dimension" "directory" "disable" "disassociate"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1481 "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
1482 "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
1483 "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
1484 "expire" "explain" "extent" "external" "externally"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1485 "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
1486 "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
1487 "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
1488 "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
1489 "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
1490 "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
1491 "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
1492 "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
1493 "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
1494 "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
1495 "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
1496 "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
1497 "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
1498 "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
1499 "mapping" "master" "matched" "materialized" "maxdatafiles"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1500 "maxextents" "maximize" "maxinstances" "maxlogfiles" "maxloghistory"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1501 "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
1502 "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
1503 "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
1504 "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
1505 "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
1506 "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
1507 "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
1508 "noresetlogs" "noreverse" "normal" "norowdependencies" "nosort"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1509 "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
1510 "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
1511 "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
1512 "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
1513 "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
1514 "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
1515 "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
1516 "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
1517 "pctincrease" "pctthreshold" "pctused" "pctversion" "percent"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1518 "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
1519 "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
1520 "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
1521 "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
1522 "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
1523 "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
1524 "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
1525 "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
1526 "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
1527 "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
1528 "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
1529 "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
1530 "selectivity" "self" "sequence" "serializable" "session"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1531 "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
1532 "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
1533 "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
1534 "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
1535 "structure" "subpartition" "subpartitions" "substitutable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1536 "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
1537 "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
1538 "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
1539 "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
1540 "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
1541 "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
1542 "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
1543 "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
1544 "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
1545 "without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1546 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1547 ;; Oracle Data Types
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1548 (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
1549 "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
1550 "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
1551 "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
1552 "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
1553 "varchar2" "varying" "year" "zone"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1554 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1555
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1556 ;; Oracle PL/SQL Attributes
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1557 (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
1558 "%bulk_rowcount" "%found" "%isopen" "%notfound" "%rowcount" "%rowtype"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1559 "%type"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1560 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1561
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1562 ;; Oracle PL/SQL Functions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1563 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1564 "extend" "prior"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1565 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1566
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1567 ;; Oracle PL/SQL Keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1568 (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
1569 "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
1570 "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
1571 "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
1572 "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
1573 "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
1574 "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
1575 "timezone_region" "true" "varrying" "while"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1576 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1577
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1578 ;; Oracle PL/SQL Data Types
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1579 (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
1580 "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
1581 "positiven" "record" "signtype" "string"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1582 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1583
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1584 ;; Oracle PL/SQL Exceptions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1585 (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
1586 "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
1587 "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
1588 "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
1589 "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
1590 "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
1591 "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
1592 "exception" "notfound"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1593 )))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1594
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1595 "Oracle SQL keywords used by font-lock.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1596
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1597 This variable is used by `sql-mode' and `sql-interactive-mode'. The
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1598 regular expressions are created during compilation by calling the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1599 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
1600 you define your own `sql-mode-oracle-font-lock-keywords'. You may want
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1601 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
1602
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1603 (defvar sql-mode-postgres-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1604 (eval-when-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1605 (list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1606 ;; Postgres Functions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1607 (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
1608 "abbrev" "abs" "acos" "age" "area" "ascii" "asin" "atab2" "atan"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1609 "atan2" "avg" "bit_length" "both" "broadcast" "btrim" "cbrt" "ceil"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1610 "center" "char_length" "chr" "coalesce" "col_description" "convert"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1611 "cos" "cot" "count" "current_database" "current_date" "current_schema"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1612 "current_schemas" "current_setting" "current_time" "current_timestamp"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1613 "current_user" "currval" "date_part" "date_trunc" "decode" "degrees"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1614 "diameter" "encode" "exp" "extract" "floor" "get_bit" "get_byte"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1615 "has_database_privilege" "has_function_privilege"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1616 "has_language_privilege" "has_schema_privilege" "has_table_privilege"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1617 "height" "host" "initcap" "isclosed" "isfinite" "isopen" "leading"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1618 "length" "ln" "localtime" "localtimestamp" "log" "lower" "lpad"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1619 "ltrim" "masklen" "max" "min" "mod" "netmask" "network" "nextval"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1620 "now" "npoints" "nullif" "obj_description" "octet_length" "overlay"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1621 "pclose" "pg_client_encoding" "pg_function_is_visible"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1622 "pg_get_constraintdef" "pg_get_indexdef" "pg_get_ruledef"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1623 "pg_get_userbyid" "pg_get_viewdef" "pg_opclass_is_visible"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1624 "pg_operator_is_visible" "pg_table_is_visible" "pg_type_is_visible"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1625 "pi" "popen" "position" "pow" "quote_ident" "quote_literal" "radians"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1626 "radius" "random" "repeat" "replace" "round" "rpad" "rtrim"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1627 "session_user" "set_bit" "set_byte" "set_config" "set_masklen"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1628 "setval" "sign" "sin" "split_part" "sqrt" "stddev" "strpos" "substr"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1629 "substring" "sum" "tan" "timeofday" "to_ascii" "to_char" "to_date"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1630 "to_hex" "to_number" "to_timestamp" "trailing" "translate" "trim"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1631 "trunc" "upper" "variance" "version" "width"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1632 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1633 ;; Postgres Reserved
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1634 (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
1635 "abort" "access" "add" "after" "aggregate" "alignment" "all" "alter"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1636 "analyze" "and" "any" "as" "asc" "assignment" "authorization"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1637 "backward" "basetype" "before" "begin" "between" "binary" "by" "cache"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1638 "called" "cascade" "case" "cast" "characteristics" "check"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1639 "checkpoint" "class" "close" "cluster" "column" "comment" "commit"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1640 "committed" "commutator" "constraint" "constraints" "conversion"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1641 "copy" "create" "createdb" "createuser" "cursor" "cycle" "database"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1642 "deallocate" "declare" "default" "deferrable" "deferred" "definer"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1643 "delete" "delimiter" "desc" "distinct" "do" "domain" "drop" "each"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1644 "element" "else" "encoding" "encrypted" "end" "escape" "except"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1645 "exclusive" "execute" "exists" "explain" "extended" "external" "false"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1646 "fetch" "finalfunc" "for" "force" "foreign" "forward" "freeze" "from"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1647 "full" "function" "grant" "group" "gtcmp" "handler" "hashes" "having"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1648 "immediate" "immutable" "implicit" "in" "increment" "index" "inherits"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1649 "initcond" "initially" "input" "insensitive" "insert" "instead"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1650 "internallength" "intersect" "into" "invoker" "is" "isnull"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1651 "isolation" "join" "key" "language" "leftarg" "level" "like" "limit"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1652 "listen" "load" "local" "location" "lock" "ltcmp" "main" "match"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1653 "maxvalue" "merges" "minvalue" "mode" "move" "natural" "negator"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1654 "next" "nocreatedb" "nocreateuser" "none" "not" "nothing" "notify"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1655 "notnull" "null" "of" "offset" "oids" "on" "only" "operator" "or"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1656 "order" "output" "owner" "partial" "passedbyvalue" "password" "plain"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1657 "prepare" "primary" "prior" "privileges" "procedural" "procedure"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1658 "public" "read" "recheck" "references" "reindex" "relative" "rename"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1659 "reset" "restrict" "returns" "revoke" "rightarg" "rollback" "row"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1660 "rule" "schema" "scroll" "security" "select" "sequence" "serializable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1661 "session" "set" "sfunc" "share" "show" "similar" "some" "sort1"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1662 "sort2" "stable" "start" "statement" "statistics" "storage" "strict"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1663 "stype" "sysid" "table" "temp" "template" "temporary" "then" "to"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1664 "transaction" "trigger" "true" "truncate" "trusted" "type"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1665 "unencrypted" "union" "unique" "unknown" "unlisten" "until" "update"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1666 "usage" "user" "using" "vacuum" "valid" "validator" "values"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1667 "variable" "verbose" "view" "volatile" "when" "where" "with" "without"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1668 "work"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1669 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1670
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1671 ;; Postgres Data Types
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1672 (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
1673 "anyarray" "bigint" "bigserial" "bit" "boolean" "box" "bytea" "char"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1674 "character" "cidr" "circle" "cstring" "date" "decimal" "double"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1675 "float4" "float8" "inet" "int2" "int4" "int8" "integer" "internal"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1676 "interval" "language_handler" "line" "lseg" "macaddr" "money"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1677 "numeric" "oid" "opaque" "path" "point" "polygon" "precision" "real"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1678 "record" "regclass" "regoper" "regoperator" "regproc" "regprocedure"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1679 "regtype" "serial" "serial4" "serial8" "smallint" "text" "time"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1680 "timestamp" "varchar" "varying" "void" "zone"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1681 )))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1682
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1683 "Postgres SQL keywords used by font-lock.
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1684
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1685 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
1686 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
1687 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
1688 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
1689
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1690 (defvar sql-mode-linter-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1691 (eval-when-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1692 (list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1693 ;; Linter Keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1694 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1695 "autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1696 "committed" "count" "countblob" "cross" "current" "data" "database"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1697 "datafile" "datafiles" "datesplit" "dba" "dbname" "default" "deferred"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1698 "denied" "description" "device" "difference" "directory" "error"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1699 "escape" "euc" "exclusive" "external" "extfile" "false" "file"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1700 "filename" "filesize" "filetime" "filter" "findblob" "first" "foreign"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1701 "full" "fuzzy" "global" "granted" "ignore" "immediate" "increment"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1702 "indexes" "indexfile" "indexfiles" "indextime" "initial" "integrity"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1703 "internal" "key" "last_autoinc" "last_rowid" "limit" "linter"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1704 "linter_file_device" "linter_file_size" "linter_name_length" "ln"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1705 "local" "login" "maxisn" "maxrow" "maxrowid" "maxvalue" "message"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1706 "minvalue" "module" "names" "national" "natural" "new" "new_table"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1707 "no" "node" "noneuc" "nulliferror" "numbers" "off" "old" "old_table"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1708 "only" "operation" "optimistic" "option" "page" "partially" "password"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1709 "phrase" "plan" "precision" "primary" "priority" "privileges"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1710 "proc_info_size" "proc_par_name_len" "protocol" "quant" "range" "raw"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1711 "read" "record" "records" "references" "remote" "rename" "replication"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1712 "restart" "rewrite" "root" "row" "rule" "savepoint" "security"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1713 "sensitive" "sequence" "serializable" "server" "since" "size" "some"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1714 "startup" "statement" "station" "success" "sys_guid" "tables" "test"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1715 "timeout" "trace" "transaction" "translation" "trigger"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1716 "trigger_info_size" "true" "trunc" "uncommitted" "unicode" "unknown"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1717 "unlimited" "unlisted" "user" "utf8" "value" "varying" "volumes"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1718 "wait" "windows_code" "workspace" "write" "xml"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1719 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1720
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1721 ;; Linter Reserved
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1722 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1723 "access" "action" "add" "address" "after" "all" "alter" "always" "and"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1724 "any" "append" "as" "asc" "ascic" "async" "at_begin" "at_end" "audit"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1725 "aud_obj_name_len" "backup" "base" "before" "between" "blobfile"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1726 "blobfiles" "blobpct" "brief" "browse" "by" "case" "cast" "check"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1727 "clear" "close" "column" "comment" "commit" "connect" "contains"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1728 "correct" "create" "delete" "desc" "disable" "disconnect" "distinct"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1729 "drop" "each" "ef" "else" "enable" "end" "event" "except" "exclude"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1730 "execute" "exists" "extract" "fetch" "finish" "for" "from" "get"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1731 "grant" "group" "having" "identified" "in" "index" "inner" "insert"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1732 "instead" "intersect" "into" "is" "isolation" "join" "left" "level"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1733 "like" "lock" "mode" "modify" "not" "nowait" "null" "of" "on" "open"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1734 "or" "order" "outer" "owner" "press" "prior" "procedure" "public"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1735 "purge" "rebuild" "resource" "restrict" "revoke" "right" "role"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1736 "rollback" "rownum" "select" "session" "set" "share" "shutdown"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1737 "start" "stop" "sync" "synchronize" "synonym" "sysdate" "table" "then"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1738 "to" "union" "unique" "unlock" "until" "update" "using" "values"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1739 "view" "when" "where" "with" "without"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1740 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1741
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1742 ;; Linter Functions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1743 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1744 "abs" "acos" "asin" "atan" "atan2" "avg" "ceil" "cos" "cosh" "divtime"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1745 "exp" "floor" "getbits" "getblob" "getbyte" "getlong" "getraw"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1746 "getstr" "gettext" "getword" "hextoraw" "lenblob" "length" "log"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1747 "lower" "lpad" "ltrim" "max" "min" "mod" "monthname" "nvl"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1748 "octet_length" "power" "rand" "rawtohex" "repeat_string"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1749 "right_substr" "round" "rpad" "rtrim" "sign" "sin" "sinh" "soundex"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1750 "sqrt" "sum" "tan" "tanh" "timeint_to_days" "to_char" "to_date"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1751 "to_gmtime" "to_localtime" "to_number" "trim" "upper" "decode"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1752 "substr" "substring" "chr" "dayname" "days" "greatest" "hex" "initcap"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1753 "instr" "least" "multime" "replace" "width"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1754 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1755
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1756 ;; Linter Data Types
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1757 (sql-font-lock-keywords-builder 'font-lock-type-face nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1758 "bigint" "bitmap" "blob" "boolean" "char" "character" "date"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1759 "datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1760 "number" "numeric" "real" "smallint" "varbyte" "varchar" "byte"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1761 "cursor" "long"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1762 )))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1763
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1764 "Linter SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1765
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1766 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
1767 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
1768 function `regexp-opt'.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1769
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1770 (defvar sql-mode-ms-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1771 (eval-when-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1772 (list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1773 ;; MS isql/osql Commands
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1774 (cons
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1775 (concat
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1776 "^\\(?:\\(?:set\\s-+\\(?:"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1777 (regexp-opt '(
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1778 "datefirst" "dateformat" "deadlock_priority" "lock_timeout"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1779 "concat_null_yields_null" "cursor_close_on_commit"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1780 "disable_def_cnst_chk" "fips_flagger" "identity_insert" "language"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1781 "offsets" "quoted_identifier" "arithabort" "arithignore" "fmtonly"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1782 "nocount" "noexec" "numeric_roundabort" "parseonly"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1783 "query_governor_cost_limit" "rowcount" "textsize" "ansi_defaults"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1784 "ansi_null_dflt_off" "ansi_null_dflt_on" "ansi_nulls" "ansi_padding"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1785 "ansi_warnings" "forceplan" "showplan_all" "showplan_text"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1786 "statistics" "implicit_transactions" "remote_proc_transactions"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1787 "transaction" "xact_abort"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1788 ) t)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1789 "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1790 'font-lock-doc-face)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1791
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1792 ;; MS Reserved
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1793 (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
1794 "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
1795 "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
1796 "cascade" "case" "check" "checkpoint" "close" "clustered" "coalesce"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1797 "column" "commit" "committed" "compute" "confirm" "constraint"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1798 "contains" "containstable" "continue" "controlrow" "convert" "count"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1799 "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
1800 "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
1801 "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
1802 "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
1803 "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
1804 "fillfactor" "first" "floppy" "for" "foreign" "freetext"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1805 "freetexttable" "from" "full" "goto" "grant" "group" "having"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1806 "holdlock" "identity" "identity_insert" "identitycol" "if" "in"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1807 "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
1808 "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
1809 "mirrorexit" "national" "next" "nocheck" "nolock" "nonclustered" "not"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1810 "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
1811 "opendatasource" "openquery" "openrowset" "option" "or" "order"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1812 "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
1813 "plan" "precision" "prepare" "primary" "print" "prior" "privileges"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1814 "proc" "procedure" "processexit" "public" "raiserror" "read"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1815 "readcommitted" "readpast" "readtext" "readuncommitted" "reconfigure"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1816 "references" "relative" "repeatable" "repeatableread" "replication"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1817 "restore" "restrict" "return" "revoke" "right" "rollback" "rowcount"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1818 "rowguidcol" "rowlock" "rule" "save" "schema" "select" "serializable"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1819 "session_user" "set" "shutdown" "some" "statistics" "sum"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1820 "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
1821 "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
1822 "tsequal" "uncommitted" "union" "unique" "update" "updatetext"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1823 "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
1824 "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
1825 "returns"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1826 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1827
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1828 ;; MS Functions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1829 (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
1830 "@@connections" "@@cpu_busy" "@@cursor_rows" "@@datefirst" "@@dbts"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1831 "@@error" "@@fetch_status" "@@identity" "@@idle" "@@io_busy"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1832 "@@langid" "@@language" "@@lock_timeout" "@@max_connections"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1833 "@@max_precision" "@@nestlevel" "@@options" "@@pack_received"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1834 "@@pack_sent" "@@packet_errors" "@@procid" "@@remserver" "@@rowcount"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1835 "@@servername" "@@servicename" "@@spid" "@@textsize" "@@timeticks"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1836 "@@total_errors" "@@total_read" "@@total_write" "@@trancount"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1837 "@@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
1838 "avg" "case" "cast" "ceiling" "char" "charindex" "coalesce"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1839 "col_length" "col_name" "columnproperty" "containstable" "convert"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1840 "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
1841 "databaseproperty" "datalength" "dateadd" "datediff" "datename"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1842 "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
1843 "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
1844 "filegroupproperty" "fileproperty" "floor" "formatmessage"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1845 "freetexttable" "fulltextcatalogproperty" "fulltextserviceproperty"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1846 "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
1847 "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
1848 "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
1849 "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
1850 "object_id" "object_name" "objectproperty" "openquery" "openrowset"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1851 "parsename" "patindex" "patindex" "permissions" "pi" "power"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1852 "quotename" "radians" "rand" "replace" "replicate" "reverse" "right"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1853 "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
1854 "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
1855 "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
1856 "textptr" "textvalid" "typeproperty" "unicode" "upper" "user"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1857 "user_id" "user_name" "var" "varp" "year"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1858 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1859
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1860 ;; MS Variables
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1861 '("\\b@[a-zA-Z0-9_]*\\b" . font-lock-variable-name-face)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1862
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1863 ;; MS Types
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1864 (sql-font-lock-keywords-builder 'font-lock-type-face nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1865 "binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1866 "double" "float" "image" "int" "integer" "money" "national" "nchar"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1867 "ntext" "numeric" "numeric" "nvarchar" "precision" "real"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1868 "smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1869 "uniqueidentifier" "varbinary" "varchar" "varying"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1870 )))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1871
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1872 "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
1873
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1874 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
1875 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
1876 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
1877 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
1878
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1879 (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
1880 "Sybase SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1881
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1882 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
1883 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
1884 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
1885 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
1886
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1887 (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
1888 "Informix SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1889
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1890 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
1891 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
1892 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
1893 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
1894
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1895 (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
1896 "Interbase SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1897
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1898 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
1899 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
1900 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
1901 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
1902
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1903 (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
1904 "Ingres SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1905
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1906 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
1907 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
1908 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
1909 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
1910
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1911 (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
1912 "Solid SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1913
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1914 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
1915 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
1916 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
1917 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
1918
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1919 (defvar sql-mode-mysql-font-lock-keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1920 (eval-when-compile
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1921 (list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1922 ;; MySQL Functions
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1923 (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
1924 "ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1925 "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
1926 "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
1927 "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
1928 "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
1929 "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
1930 "geomcollfromtext" "geomcollfromwkb" "geometrycollectionfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1931 "geometrycollectionfromwkb" "geometryfromtext" "geometryfromwkb"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1932 "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
1933 "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
1934 "length" "linefromtext" "linefromwkb" "linestringfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1935 "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
1936 "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
1937 "mlinefromwkb" "mpointfromtext" "mpointfromwkb" "mpolyfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1938 "mpolyfromwkb" "multilinestringfromtext" "multilinestringfromwkb"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1939 "multipointfromtext" "multipointfromwkb" "multipolygonfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1940 "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
1941 "pointfromtext" "pointfromwkb" "polyfromtext" "polyfromwkb"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1942 "polygonfromtext" "polygonfromwkb" "position" "quote" "rand"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1943 "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
1944 "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
1945 "trailing" "trim" "ucase" "unix_timestamp" "upper" "user" "variance"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1946 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1947
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1948 ;; MySQL Keywords
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1949 (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
1950 "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
1951 "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
1952 "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
1953 "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
1954 "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
1955 "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
1956 "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
1957 "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
1958 "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
1959 "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
1960 "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
1961 "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
1962 "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
1963 "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
1964 "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
1965 "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
1966 "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
1967 "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
1968 "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
1969 "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
1970 "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
1971 "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
1972 "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
1973 "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
1974 "with" "write" "xor"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1975 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1976
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1977 ;; MySQL Data Types
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
1978 (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
1979 "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
1980 "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
1981 "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
1982 "longblob" "longtext" "mediumblob" "mediumint" "mediumtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1983 "multicurve" "multilinestring" "multipoint" "multipolygon"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1984 "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
1985 "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
1986 "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
1987 "zerofill"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1988 )))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1989
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1990 "MySQL 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-mysql-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-sqlite-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1998 "SQLite 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-sqlite-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-db2-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2006 "DB2 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-db2-font-lock-keywords'.")
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2012
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2013 (defvar sql-mode-font-lock-keywords nil
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2014 "SQL keywords used by font-lock.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2015
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2016 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
2017 `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
2018 highlighting rules in SQL mode.")
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2019
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2020
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2021
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2022 ;;; SQL Product support functions
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2023
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2024 (defun sql-add-product (product display &rest plist)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2025 "Add support for a database product in `sql-mode'.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2026
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2027 Add PRODUCT to `sql-product-alist' which enables `sql-mode' to
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2028 properly support syntax highlighting and interactive interaction.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2029 DISPLAY is the name of the SQL product that will appear in the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2030 menu bar and in messages. PLIST initializes the product
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2031 configuration."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2032
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2033 ;; Don't do anything if the product is already supported
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2034 (if (assoc product sql-product-alist)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2035 (message "Product `%s' is already defined" product)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2036
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2037 ;; Add product to the alist
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2038 (add-to-list 'sql-product-alist `((,product :name ,display . ,plist)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2039 ;; Add a menu item to the SQL->Product menu
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2040 (easy-menu-add-item sql-mode-menu '("Product")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2041 ;; Each product is represented by a radio
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2042 ;; button with it's display name.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2043 `[,display
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2044 (sql-set-product ',product)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2045 :style radio
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2046 :selected (eq sql-product ',product)]
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2047 ;; Maintain the product list in
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2048 ;; (case-insensitive) alphabetic order of the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2049 ;; display names. Loop thru each keymap item
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2050 ;; looking for an item whose display name is
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2051 ;; after this product's name.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2052 (let ((next-item)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2053 (down-display (downcase display)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2054 (map-keymap (lambda (k b)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2055 (when (and (not next-item)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2056 (string-lessp down-display
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2057 (downcase (cadr b))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2058 (setq next-item k)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2059 (easy-menu-get-map sql-mode-menu '("Product")))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2060 next-item))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2061 product))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2062
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2063 (defun sql-del-product (product)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2064 "Remove support for PRODUCT in `sql-mode'."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2065
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2066 ;; Remove the menu item based on the display name
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2067 (easy-menu-remove-item sql-mode-menu '("Product") (sql-get-product-feature product :name))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2068 ;; Remove the product alist item
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2069 (setq sql-product-alist (assq-delete-all product sql-product-alist))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2070 nil)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2071
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2072 (defun sql-set-product-feature (product feature newvalue)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2073 "Set FEATURE of database PRODUCT to NEWVALUE.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2074
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2075 The PRODUCT must be a symbol which identifies the database
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2076 product. The product must have already exist on the product
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2077 list. See `sql-add-product' to add new products. The FEATURE
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2078 argument must be a plist keyword accepted by
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2079 `sql-product-alist'."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2080
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2081 (let* ((p (assoc product sql-product-alist))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2082 (v (plist-get (cdr p) feature)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2083 (if p
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2084 (if (and
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2085 (member feature sql-indirect-features)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2086 (symbolp v))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2087 (set v newvalue)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2088 (setcdr p (plist-put (cdr p) feature newvalue)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2089 (message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2090
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2091 (defun sql-get-product-feature (product feature &optional fallback not-indirect)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2092 "Lookup FEATURE associated with a SQL PRODUCT.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2093
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2094 If the FEATURE is nil for PRODUCT, and FALLBACK is specified,
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2095 then the FEATURE associated with the FALLBACK product is
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2096 returned.
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2097
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2098 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
2099 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
2100 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
2101
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
2102 See `sql-product-alist' for a list of products and supported features."
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2103 (let* ((p (assoc product sql-product-alist))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2104 (v (plist-get (cdr p) feature)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2105
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2106 (if p
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2107 ;; If no value and fallback, lookup feature for fallback
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2108 (if (and (not v)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2109 fallback
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2110 (not (eq product fallback)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2111 (sql-get-product-feature fallback feature)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2112
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2113 (if (and
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2114 (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
2115 (not not-indirect)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2116 (symbolp v))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2117 (symbol-value v)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2118 v))
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2119 (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
2120 nil)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2121
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2122 (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
2123 "Configure font-lock and imenu with product-specific settings.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2124
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2125 The KEYWORDS-ONLY flag is passed to font-lock to specify whether
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2126 only keywords should be hilighted and syntactic hilighting
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2127 skipped. The IMENU flag indicates whether `imenu-mode' should
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2128 also be configured."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2129
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2130 (let
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2131 ;; Get the product-specific syntax-alist.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2132 ((syntax-alist
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2133 (append
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2134 (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
2135 '((?_ . "w") (?. . "w")))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2136
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2137 ;; Get the product-specific keywords.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2138 (setq sql-mode-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2139 (append
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
2140 (unless (eq sql-product 'ansi)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2141 (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
2142 ;; Always highlight ANSI keywords
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2143 (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
2144 ;; 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
2145 ;; statements
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2146 (list sql-mode-font-lock-object-name)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2147
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
2148 ;; Setup font-lock. Force re-parsing of `font-lock-defaults'.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2149 (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
2150 (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
2151 keywords-only t syntax-alist))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2152
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
2153 ;; 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
2154 ;; 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
2155 (when (and (fboundp 'font-lock-mode)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2156 (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
2157 font-lock-mode)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
2158 (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
2159 (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
2160
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
2161 (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
2162 (lambda ()
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
2163 ;; 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
2164 (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
2165 (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
2166 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
2167 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
2168 (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
2169 nil t)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
2170
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2171 ;; 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
2172 (when imenu
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2173 (setq imenu-syntax-alist syntax-alist))))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2174
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2175 ;;;###autoload
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2176 (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
2177 "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
2178
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
2179 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
2180 `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
2181 `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
2182 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
2183 `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
2184 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
2185 of the current highlighting list.
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2186
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2187 For example:
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2188
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2189 (sql-add-product-keywords 'ms
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2190 '((\"\\\\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
2191
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2192 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
2193 `_t' as data types."
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2194
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2195 (let* ((sql-indirect-features nil)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2196 (font-lock-var (sql-get-product-feature product :font-lock))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2197 (old-val))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2198
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2199 (setq old-val (symbol-value font-lock-var))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2200 (set font-lock-var
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2201 (if (eq append 'set)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2202 keywords
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2203 (if append
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2204 (append old-val keywords)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2205 (append keywords old-val))))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2206
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2207
30905
2069c10bf952 (sql-magic-go): Use comint-bol.
Gerd Moellmann <gerd@gnu.org>
parents: 30838
diff changeset
2208
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2209 ;;; Functions to switch highlighting
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2210
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2211 (defun sql-highlight-product ()
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
2212 "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
2213 (when (derived-mode-p 'sql-mode)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2214 ;; Setup font-lock
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2215 (sql-product-font-lock nil t)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2216
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2217 ;; Set the mode name to include the product.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2218 (setq mode-name (concat "SQL[" (or (sql-get-product-feature sql-product :name)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2219 (symbol-name sql-product)) "]"))))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2220
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2221 (defun sql-set-product (product)
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
2222 "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
2223 (interactive
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2224 (list (completing-read "SQL product: "
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
2225 (mapcar (lambda (info) (symbol-name (car info)))
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
2226 sql-product-alist)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2227 nil 'require-match
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2228 (or (and sql-product (symbol-name sql-product)) "ansi"))))
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
2229 (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
2230 (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
2231 (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
2232 (setq product 'ansi))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2233
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2234 ;; Save product setting and fontify.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2235 (setq sql-product product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2236 (sql-highlight-product))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2237
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2238
30838
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
2239 ;;; Compatibility functions
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
2240
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
2241 (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
2242 ;; 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
2243 (defun comint-line-beginning-position ()
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
2244 "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
2245 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
2246 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
2247 (save-excursion (comint-bol nil) (point))))
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
2248
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
2249
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2250
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2251 ;;; Small functions
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2252
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2253 (defun sql-magic-go (arg)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2254 "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
2255 `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
2256 (interactive "P")
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2257 (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
2258 (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
2259 (save-excursion
30642
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2260 (comint-bol nil)
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2261 (looking-at "go\\b")))
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2262 (comint-send-input)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2263
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2264 (defun sql-magic-semicolon (arg)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2265 "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
2266 `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
2267 (interactive "P")
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2268 (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
2269 (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
2270 (comint-send-input)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2271
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2272 (defun sql-accumulate-and-indent ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2273 "Continue SQL statement on the next line."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2274 (interactive)
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2275 (if (fboundp 'comint-accumulate)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2276 (comint-accumulate)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2277 (newline))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2278 (indent-according-to-mode))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2279
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2280 (defun sql-help-list-products (indent freep)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2281 "Generate listing of products available for use under SQLi.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2282
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2283 List products with :free-softare attribute set to FREEP. Indent
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2284 each line with INDENT."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2285
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2286 (let (sqli-func doc)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2287 (setq doc "")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2288 (dolist (p sql-product-alist)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2289 (setq sqli-func (intern (concat "sql-" (symbol-name (car p)))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2290
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2291 (if (and (fboundp sqli-func)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2292 (eq (sql-get-product-feature (car p) :free-software) freep))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2293 (setq doc
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2294 (concat doc
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2295 indent
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2296 (or (sql-get-product-feature (car p) :name)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2297 (symbol-name (car p)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2298 ":\t"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2299 "\\["
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2300 (symbol-name sqli-func)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2301 "]\n"))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2302 doc))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2303
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2304 ;;;###autoload
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2305 (defun sql-help ()
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2306 "Show short help for the SQL modes.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2307
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2308 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
2309 usually named `*SQL*'. The name of the major mode is SQLi.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2310
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2311 Use the following commands to start a specific SQL interpreter:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2312
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2313 \\\\FREE
24268
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
2314
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
2315 Other non-free SQL implementations are also supported:
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
2316
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2317 \\\\NONFREE
24268
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
2318
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
2319 But we urge you to choose a free implementation instead of these.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2320
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2321 You can also use \\[sql-product-interactive] to invoke the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2322 interpreter for the current `sql-product'.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2323
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2324 Once you have the SQLi buffer, you can enter SQL statements in the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2325 buffer. The output generated is appended to the buffer and a new prompt
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2326 is generated. See the In/Out menu in the SQLi buffer for some functions
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2327 that help you navigate through the buffer, the input history, etc.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2328
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2329 If you have a really complex SQL statement or if you are writing a
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2330 procedure, you can do this in a separate buffer. Put the new buffer in
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2331 `sql-mode' by calling \\[sql-mode]. The name of this buffer can be
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2332 anything. The name of the major mode is SQL.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2333
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2334 In this SQL buffer (SQL mode), you can send the region or the entire
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2335 buffer to the interactive SQL buffer (SQLi mode). The results are
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2336 appended to the SQLi buffer without disturbing your SQL buffer."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2337 (interactive)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2338
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2339 ;; Insert references to loaded products into the help buffer string
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2340 (let ((doc (documentation 'sql-help t))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2341 changedp)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2342 (setq changedp nil)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2343
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2344 ;; Insert FREE software list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2345 (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*\n" doc 0)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2346 (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2347 t t doc 0)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2348 changedp t))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2349
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2350 ;; Insert non-FREE software list
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2351 (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*\n" doc 0)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2352 (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2353 t t doc 0)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2354 changedp t))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2355
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2356 ;; If we changed the help text, save the change so that the help
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2357 ;; sub-system will see it
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2358 (when changedp
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2359 (put 'sql-help 'function-documentation doc)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2360
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2361 ;; Call help on this function
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2362 (describe-function 'sql-help))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2363
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2364 (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
2365 "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
2366 (read-passwd prompt nil default))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2367
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2368 (defun sql-get-login (&rest what)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2369 "Get username, password and database from the user.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2370
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2371 The variables `sql-user', `sql-password', `sql-server', and
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2372 `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
2373 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
2374 `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
2375 in a history.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2376
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2377 Parameter WHAT is a list of tokens passed as arguments in the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2378 function call. The function asks for the username if WHAT
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2379 contains the symbol `user', for the password if it contains the
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2380 symbol `password', for the server if it contains the symbol
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2381 `server', and for the database if it contains the symbol
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2382 `database'. The members of WHAT are processed in the order in
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2383 which they are provided.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2384
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2385 In order to ask the user for username, password and database, call the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2386 function like this: (sql-get-login 'user 'password 'database)."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2387 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2388 (while what
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2389 (cond
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2390 ((eq (car what) 'user) ; user
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2391 (setq sql-user
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2392 (read-from-minibuffer "User: " sql-user nil nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2393 'sql-user-history)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2394 ((eq (car what) 'password) ; password
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2395 (setq sql-password
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2396 (sql-read-passwd "Password: " sql-password)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2397
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2398 ((eq (car what) 'server) ; server
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2399 (setq sql-server
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2400 (read-from-minibuffer "Server: " sql-server nil nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2401 'sql-server-history)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2402 ((eq (car what) 'port) ; port
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2403 (setq sql-port
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2404 (read-from-minibuffer "Port: " sql-port nil nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2405 'sql-port-history)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2406 ((eq (car what) 'database) ; database
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2407 (setq sql-database
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2408 (read-from-minibuffer "Database: " sql-database nil nil
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2409 'sql-database-history))))
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2410
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2411 (setq what (cdr what))))
25381
970b18c6803f (sql-sybase): use sql-server instead of sql-database.
Alex Schroeder <alex@gnu.org>
parents: 25183
diff changeset
2412
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2413 (defun sql-find-sqli-buffer ()
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2414 "Returns the current default SQLi buffer or nil.
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2415 In order to qualify, the SQLi buffer must be alive,
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2416 be in `sql-interactive-mode' and have a process."
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2417 (let ((default-buffer (default-value 'sql-buffer)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2418 (if (and (buffer-live-p default-buffer)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2419 (get-buffer-process default-buffer))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2420 default-buffer
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
2421 (save-current-buffer
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2422 (let ((buflist (buffer-list))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2423 (found))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2424 (while (not (or (null buflist)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2425 found))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2426 (let ((candidate (car buflist)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2427 (set-buffer candidate)
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
2428 (if (and (derived-mode-p 'sql-interactive-mode)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2429 (get-buffer-process candidate))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2430 (setq found candidate))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2431 (setq buflist (cdr buflist))))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2432 found)))))
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2433
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2434 (defun sql-set-sqli-buffer-generally ()
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2435 "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
2436 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
2437 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
2438 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
2439 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
2440 `sql-set-sqli-hook' is run."
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2441 (interactive)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2442 (save-excursion
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2443 (let ((buflist (buffer-list))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2444 (default-sqli-buffer (sql-find-sqli-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2445 (setq-default sql-buffer default-sqli-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2446 (while (not (null buflist))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2447 (let ((candidate (car buflist)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2448 (set-buffer candidate)
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
2449 (if (and (derived-mode-p 'sql-mode)
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2450 (not (buffer-live-p sql-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2451 (progn
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2452 (setq sql-buffer default-sqli-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2453 (run-hooks 'sql-set-sqli-hook))))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2454 (setq buflist (cdr buflist))))))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2455
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2456 (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
2457 "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
2458
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2459 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
2460 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
2461 `sql-set-sqli-hook'.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2462
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2463 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
2464 `sql-buffer'.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2465
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2466 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
2467 `sql-buffer'."
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2468 (interactive)
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2469 (let ((default-buffer (sql-find-sqli-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2470 (if (null default-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2471 (error "There is no suitable SQLi buffer"))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2472 (let ((new-buffer
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2473 (get-buffer
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2474 (read-buffer "New SQLi buffer: " default-buffer t))))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2475 (if (null (get-buffer-process new-buffer))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2476 (error "Buffer %s has no process" (buffer-name new-buffer)))
104304
35fbb27750a7 (sql-product-alist): Add :name tag to entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102020
diff changeset
2477 (if (null (with-current-buffer new-buffer
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2478 (equal major-mode 'sql-interactive-mode)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2479 (error "Buffer %s is no SQLi buffer" (buffer-name new-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2480 (if new-buffer
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2481 (progn
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2482 (setq sql-buffer new-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2483 (run-hooks 'sql-set-sqli-hook))))))
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2484
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2485 (defun sql-show-sqli-buffer ()
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2486 "Show the name of current SQLi buffer.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2487
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2488 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
2489 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
2490 (interactive)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2491 (if (null (buffer-live-p 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
2492 (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
2493 (if (null (get-buffer-process sql-buffer))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2494 (message "Buffer %s has no process." (buffer-name sql-buffer))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2495 (message "Current SQLi buffer is %s." (buffer-name sql-buffer)))))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2496
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2497 (defun sql-make-alternate-buffer-name ()
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
2498 "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
2499
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2500 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
2501 `sql-interactive-mode'.
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2502
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2503 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
2504 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
2505
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2506 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
2507 parameter.
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2508
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2509 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
2510 server/database name."
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
2511
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2512 (let ((name ""))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2513
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2514 ;; Try using the :sqli-login setting
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2515 (when (string= "" (or name ""))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2516 (setq name
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2517 (apply 'concat
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2518 (apply 'append nil
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2519 (mapcar
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2520 (lambda (v)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2521 (cond
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2522 ((eq v 'user) (list "/" sql-user))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2523 ((eq v 'server) (list "." sql-server))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2524 ((eq v 'database) (list "@" sql-database))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2525 ((eq v 'port) (list ":" sql-port))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2526
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2527 ((eq v 'password) nil)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2528 (t nil)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2529 (sql-get-product-feature sql-product :sqli-login))))))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2530
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2531 ;; Default: username/server format
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2532 (when (string= "" (or name ""))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2533 (setq name
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2534 (concat " "
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2535 (if (string= "" sql-user)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2536 (if (string= "" (user-login-name))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2537 ()
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2538 (concat (user-login-name) "/"))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2539 (concat sql-user "/"))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2540 (if (string= "" sql-database)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2541 (if (string= "" sql-server)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2542 (system-name)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2543 sql-server)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2544 sql-database))))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2545
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2546 ;; Return the final string; prefixed by the connection name
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2547 (if sql-connection
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2548 (format "<%s>%s" sql-connection (or name ""))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2549 (substring (or name " ") 1))))
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2550
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2551 (defun sql-rename-buffer ()
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
2552 "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
2553 (interactive)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2554 (rename-buffer (format "*SQL: %s*" sql-alternate-buffer-name) t))
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2555
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2556 (defun sql-copy-column ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2557 "Copy current column to the end of buffer.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2558 Inserts SELECT or commas if appropriate."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2559 (interactive)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2560 (let ((column))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2561 (save-excursion
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2562 (setq column (buffer-substring-no-properties
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2563 (progn (forward-char 1) (backward-sexp 1) (point))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2564 (progn (forward-sexp 1) (point))))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2565 (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
2566 (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
2567 (cond
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2568 ;; 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
2569 ((= bol (point))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2570 (insert "SELECT "))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2571 ;; 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
2572 ((save-excursion
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2573 (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
2574 bol t))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2575 (insert ", "))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2576 ;; else insert a space
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2577 (t
64052
68f51d595f7f (SQL): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 63410
diff changeset
2578 (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
2579 nil
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2580 (insert " ")))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2581 ;; in any case, insert the column
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2582 (insert column)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2583 (message "%s" column))))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2584
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
2585 ;; 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
2586 ;; 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
2587 ;; 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
2588 ;; Emacs query for the placeholders.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2589
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2590 (defvar sql-placeholder-history nil
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2591 "History of placeholder values used.")
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2592
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2593 (defun sql-placeholders-filter (string)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2594 "Replace placeholders in STRING.
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
2595 Placeholders are words starting with an ampersand like &this."
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2596
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2597 (when sql-oracle-scan-on
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2598 (while (string-match "&\\(\\sw+\\)" string)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2599 (setq string (replace-match
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2600 (read-from-minibuffer
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2601 (format "Enter value for %s: " (match-string 1 string))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2602 nil nil nil 'sql-placeholder-history)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2603 t t string))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2604 string)
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2605
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2606 ;; 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
2607 ;; The space before the backslash is relevant.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2608 (defun sql-escape-newlines-filter (string)
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
2609 "Escape newlines in STRING.
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2610 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
2611 (let ((result "") (start 0) mb me)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2612 (while (string-match "\n" string start)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2613 (setq mb (match-beginning 0)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2614 me (match-end 0)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2615 result (concat result
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2616 (substring string start mb)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2617 (if (and (> mb 1)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2618 (string-equal " \\" (substring string (- mb 2) mb)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2619 "" " \\\n"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2620 start me))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2621 (concat result (substring string start))))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2622
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2623
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2624
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2625 ;;; Input sender for SQLi buffers
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2626
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2627 (defun sql-input-sender (proc string)
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
2628 "Send STRING to PROC after applying filters."
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2629
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2630 (let* ((product (with-current-buffer (process-buffer proc) sql-product))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2631 (filter (sql-get-product-feature product :input-filter)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2632
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2633 ;; Send the string
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2634 (comint-simple-send proc (if filter (funcall filter string) string))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2635
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2636 ;;; Sending the region to the SQLi buffer.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2637
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2638 (defun sql-send-string (str)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2639 "Send the string STR to the SQL process."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2640 (interactive "sSQL Text: ")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2641
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2642 (let (comint-input-sender-no-newline proc)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2643 (if (buffer-live-p sql-buffer)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2644 (progn
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2645 ;; Ignore the hoping around...
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2646 (save-excursion
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2647 ;; Get the process
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2648 (setq proc (get-buffer-process sql-buffer))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2649
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2650 ;; Set product context
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2651 (with-current-buffer sql-buffer
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2652 ;; Send the string
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2653 (sql-input-sender proc str)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2654
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2655 ;; Send a newline if there wasn't one on the end of the string
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2656 (unless (string-equal "\n" (substring str (1- (length str))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2657 (comint-send-string proc "\n"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2658
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2659 ;; Send a command terminator if we must
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2660 (if sql-send-terminator
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2661 (sql-send-magic-terminator sql-buffer str sql-send-terminator))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2662
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2663 (message "Sent string to buffer %s." (buffer-name sql-buffer))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2664
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2665 ;; Display the sql buffer
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2666 (if sql-pop-to-buffer-after-send-region
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2667 (pop-to-buffer sql-buffer)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2668 (display-buffer sql-buffer)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2669
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2670 ;; We don't have no stinkin' sql
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2671 (message "No SQL process started."))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2672
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2673 (defun sql-send-region (start end)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2674 "Send a region to the SQL process."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2675 (interactive "r")
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2676 (sql-send-string (buffer-substring-no-properties start end)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2677
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2678 (defun sql-send-paragraph ()
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2679 "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
2680 (interactive)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2681 (let ((start (save-excursion
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2682 (backward-paragraph)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2683 (point)))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2684 (end (save-excursion
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2685 (forward-paragraph)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2686 (point))))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2687 (sql-send-region start end)))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2688
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2689 (defun sql-send-buffer ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2690 "Send the buffer contents to the SQL process."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2691 (interactive)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2692 (sql-send-region (point-min) (point-max)))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2693
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2694 (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
2695 "Send TERMINATOR to buffer BUF if its not present in STR."
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2696 (let (pat term)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2697 ;; If flag is merely on(t), get product-specific terminator
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2698 (if (eq terminator t)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2699 (setq terminator (sql-get-product-feature sql-product :terminator)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2700
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2701 ;; If there is no terminator specified, use default ";"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2702 (unless terminator
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2703 (setq terminator ";"))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2704
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2705 ;; Parse the setting into the pattern and the terminator string
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2706 (cond ((stringp terminator)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2707 (setq pat (regexp-quote terminator)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2708 term terminator))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2709 ((consp terminator)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2710 (setq pat (car terminator)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2711 term (cdr terminator)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2712 (t
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2713 nil))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2714
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2715 ;; Check to see if the pattern is present in the str already sent
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2716 (unless (and pat term
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2717 (string-match (concat pat "\n?\\'") str))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2718 (comint-send-string buf (concat term "\n")))))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2719
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2720 (defun sql-remove-tabs-filter (str)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2721 "Replace tab characters with spaces."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2722 (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
2723
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2724 (defun sql-toggle-pop-to-buffer-after-send-region (&optional value)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2725 "Toggle `sql-pop-to-buffer-after-send-region'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2726
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2727 If given the optional parameter VALUE, sets
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
2728 `sql-toggle-pop-to-buffer-after-send-region' to VALUE."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2729 (interactive "P")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2730 (if value
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2731 (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
2732 (setq sql-pop-to-buffer-after-send-region
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2733 (null sql-pop-to-buffer-after-send-region))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2734
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2735
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2736
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2737 ;;; SQL mode -- uses SQL interactive mode
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2738
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2739 ;;;###autoload
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2740 (defun sql-mode ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2741 "Major mode to edit SQL.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2742
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2743 You can send SQL statements to the SQLi buffer using
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2744 \\[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
2745 See `sql-help' on how to create SQLi buffers.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2746
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2747 \\{sql-mode-map}
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2748 Customization: Entry to this mode runs the `sql-mode-hook'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2749
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2750 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
2751 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
2752 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
2753 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
2754 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
2755 value of `sql-buffer' using \\[sql-set-sqli-buffer].
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2756
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2757 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
2758 `sql-interactive-mode'.
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2759
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2760 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
2761 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
2762 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
2763
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2764 \(add-hook 'sql-mode-hook
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2765 (lambda ()
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2766 (modify-syntax-entry ?\\\\ \".\" sql-mode-syntax-table)))"
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2767 (interactive)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2768 (kill-all-local-variables)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2769 (setq major-mode 'sql-mode)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2770 (setq mode-name "SQL")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2771 (use-local-map sql-mode-map)
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
2772 (if sql-mode-menu
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
2773 (easy-menu-add sql-mode-menu)); XEmacs
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2774 (set-syntax-table sql-mode-syntax-table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2775 (make-local-variable 'font-lock-defaults)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2776 (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
2777 (make-local-variable 'comment-start)
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2778 (setq comment-start "--")
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2779 ;; 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
2780 (make-local-variable 'sql-buffer)
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2781 ;; 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
2782 ;; 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
2783 ;; 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
2784 (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
2785 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
2786 ;; 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
2787 ;; lines.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2788 (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
2789 (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
2790 (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
2791 paragraph-start "[\n\f]")
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2792 ;; Abbrevs
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2793 (setq local-abbrev-table sql-mode-abbrev-table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2794 (setq abbrev-all-caps 1)
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2795 ;; Run hook
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 59996
diff changeset
2796 (run-mode-hooks 'sql-mode-hook)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2797 ;; 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
2798 (sql-highlight-product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2799 (add-hook 'hack-local-variables-hook 'sql-highlight-product t t))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2800
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2801
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2802
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2803 ;;; SQL interactive mode
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2804
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2805 (put 'sql-interactive-mode 'mode-class 'special)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2806
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2807 (defun sql-interactive-mode ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2808 "Major mode to use a SQL interpreter interactively.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2809
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2810 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
2811 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
2812 See `sql-help' for a list of available entry functions.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2813
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2814 \\[comint-send-input] after the end of the process' output sends the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2815 text from the end of process to the end of the current line.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2816 \\[comint-send-input] before end of process output copies the current
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2817 line minus the prompt to the end of the buffer and sends it.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2818 \\[comint-copy-old-input] just copies the current line.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2819 Use \\[sql-accumulate-and-indent] to enter multi-line statements.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2820
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2821 If you want to make multiple SQL buffers, rename the `*SQL*' buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2822 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
2823 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
2824 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
2825 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
2826 their creation. See `sql-mode' for details.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2827
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2828 Sample session using two connections:
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2829
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2830 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
2831 2. Rename buffer \"*SQL*\" to \"*Connection 1*\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2832 3. Create a SQL buffer \"test1.sql\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2833 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
2834 5. Rename buffer \"*SQL*\" to \"*Connection 2*\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2835 6. Create a SQL buffer \"test2.sql\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2836
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2837 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
2838 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
2839 will send the region to buffer \"*Connection 2*\".
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2840
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2841 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
2842 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
2843 the signals are not supported.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2844
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2845 \\{sql-interactive-mode-map}
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2846 Customization: Entry to this mode runs the hooks on `comint-mode-hook'
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2847 and `sql-interactive-mode-hook' (in that order). Before each input, the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2848 hooks on `comint-input-filter-functions' are run. After each SQL
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2849 interpreter output, the hooks on `comint-output-filter-functions' are
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2850 run.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2851
65198
7fbb366ab47a (sql-interactive-mode): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 64837
diff changeset
2852 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
2853 input ring history.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2854
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2855 Variables `comint-output-filter-functions', a hook, and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2856 `comint-scroll-to-bottom-on-input' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2857 `comint-scroll-to-bottom-on-output' control whether input and output
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2858 cause the window to scroll to the end of the buffer.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2859
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2860 If you want to make SQL buffers limited in length, add the function
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2861 `comint-truncate-buffer' to `comint-output-filter-functions'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2862
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2863 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
2864 certain length.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2865
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2866 \(add-hook 'sql-interactive-mode-hook
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2867 \(function (lambda ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2868 \(setq comint-output-filter-functions 'comint-truncate-buffer))))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2869
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2870 Here is another example. It will always put point back to the statement
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2871 you entered, right above the output it created.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2872
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2873 \(setq comint-output-filter-functions
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2874 \(function (lambda (STR) (comint-show-output))))"
63410
37dd5dc2f5ae (sql-interactive-mode): Use delay-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents: 62772
diff changeset
2875 (delay-mode-hooks (comint-mode))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2876
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2877 ;; 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
2878 (set (make-local-variable 'sql-product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2879 (or sql-interactive-product
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2880 sql-product))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2881
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2882 ;; Setup the mode.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2883 (setq major-mode 'sql-interactive-mode)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2884 (setq mode-name (concat "SQLi[" (or (sql-get-product-feature sql-product :name)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2885 (symbol-name sql-product)) "]"))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2886 (use-local-map sql-interactive-mode-map)
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
2887 (if sql-interactive-mode-menu
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2888 (easy-menu-add sql-interactive-mode-menu)) ; XEmacs
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2889 (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
2890 (make-local-variable 'sql-mode-font-lock-keywords)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2891 (make-local-variable 'font-lock-defaults)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2892
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2893 ;; 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
2894 ;; 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
2895 ;; 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
2896 ;; disabled for interactive buffers. No imenu support.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2897 (sql-product-font-lock t nil)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2898
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2899 ;; 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
2900 (make-local-variable 'comment-start)
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2901 (setq comment-start "--")
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2902 ;; 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
2903 ;; by default.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2904 (setq local-abbrev-table sql-mode-abbrev-table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2905 (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
2906 ;; Exiting the process will call sql-stop.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2907 (set-process-sentinel (get-buffer-process sql-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
2908 ;; 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
2909 (make-local-variable 'sql-connection)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2910 ;; 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
2911 (make-local-variable 'sql-alternate-buffer-name)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2912 (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
2913 ;; User stuff. Initialize before the hook.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2914 (set (make-local-variable 'sql-prompt-regexp)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2915 (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
2916 (set (make-local-variable 'sql-prompt-length)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2917 (sql-get-product-feature sql-product :prompt-length))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2918 (make-local-variable 'sql-input-ring-separator)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2919 (make-local-variable 'sql-input-ring-file-name)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2920 (setq comint-process-echoes t)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2921 ;; 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
2922 (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
2923 ;; Set comint based on user overrides.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2924 (setq comint-prompt-regexp sql-prompt-regexp)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2925 (setq left-margin sql-prompt-length)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2926 ;; Install input sender
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2927 (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
2928 ;; People wanting a different history file for each
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2929 ;; 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
2930 ;; on the sql-interactive-mode-hook.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2931 (setq comint-input-ring-separator sql-input-ring-separator
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2932 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
2933 ;; Calling the hook before calling comint-read-input-ring allows users
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2934 ;; 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
2935 (comint-read-input-ring t))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2936
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2937 (defun sql-stop (process event)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2938 "Called when the SQL process is stopped.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2939
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2940 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
2941 `comint-write-input-ring' and inserts a short message in the SQL buffer.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2942
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2943 This function is a sentinel watching the SQL interpreter process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2944 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
2945 (comint-write-input-ring)
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2946 (if (and (eq (current-buffer) sql-buffer)
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2947 (not buffer-read-only))
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2948 (insert (format "\nProcess %s %s\n" process event))
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2949 (message "Process %s %s" process event)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2950
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2951
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2952
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2953 ;;; Entry functions for different SQL interpreters.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2954
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2955 ;;;###autoload
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2956 (defun sql-product-interactive (&optional product)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2957 "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
2958
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2959 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
2960 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
2961
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2962 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2963 (interactive "P")
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2964
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2965 (setq product
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2966 (cond
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2967 ((equal product '(4)) ; Universal arg, prompt for product
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2968 (intern (completing-read "SQL product: "
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2969 (mapcar (lambda (info) (symbol-name (car info)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2970 sql-product-alist)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2971 nil 'require-match
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2972 (or (and sql-product (symbol-name sql-product)) "ansi"))))
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2973 ((and product ; Product specified
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2974 (symbolp product)) product)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2975 (t sql-product))) ; Default to sql-product
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
2976
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2977 (if product
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2978 (when (sql-get-product-feature product :sqli-comint-func)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2979 (if (and sql-buffer
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2980 (buffer-live-p sql-buffer)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2981 (comint-check-proc sql-buffer))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2982 (pop-to-buffer sql-buffer)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2983
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2984 ;; Is the current buffer in sql-mode and
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2985 ;; there is a buffer local setting of sql-buffer
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2986 (let* ((start-buffer
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2987 (and (derived-mode-p 'sql-mode)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2988 (current-buffer)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2989 (start-sql-buffer
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2990 (and start-buffer
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2991 (let (found)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2992 (dolist (var (buffer-local-variables))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2993 (and (consp var)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2994 (eq (car var) 'sql-buffer)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2995 (buffer-live-p (cdr var))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2996 (get-buffer-process (cdr var))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2997 (setq found (cdr var))))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2998 found)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
2999 new-sqli-buffer)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3000
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3001 ;; Get credentials.
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3002 (apply 'sql-get-login (sql-get-product-feature product :sqli-login))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3003
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3004 ;; Connect to database.
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3005 (message "Login...")
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3006 (funcall (sql-get-product-feature product :sqli-comint-func)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3007 product
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3008 (sql-get-product-feature product :sqli-options))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3009
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3010 ;; Set SQLi mode.
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3011 (setq sql-interactive-product product
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3012 new-sqli-buffer (current-buffer)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3013 sql-buffer new-sqli-buffer)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3014 (sql-interactive-mode)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3015
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3016 ;; Set `sql-buffer' in the start buffer
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3017 (when (and start-buffer (not start-sql-buffer))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3018 (with-current-buffer start-buffer
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3019 (setq sql-buffer new-sqli-buffer)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3020
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3021 ;; All done.
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3022 (message "Login...done")
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3023 (pop-to-buffer sql-buffer))))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3024 (message "No default SQL product defined. Set `sql-product'.")))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3025
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3026 (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
3027 "Set up a comint buffer to run the SQL processor.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3028
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3029 PRODUCT is the SQL product. PARAMS is a list of strings which are
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3030 passed as command line arguments."
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3031 (let ((program (sql-get-product-feature product :sqli-program)))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3032 (set-buffer
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3033 (apply 'make-comint "SQL" program nil params))))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3034
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3035 ;;;###autoload
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3036 (defun sql-connect (connection)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3037 "Connect to an interactive session using CONNECTION settings.
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3038
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3039 See `sql-connection-alist' to see how to define connections and
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3040 their settings.
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3041
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3042 The user will not be prompted for any login parameters if a value
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3043 is specified in the connection settings."
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3044
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3045 ;; Prompt for the connection from those defined in the alist
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3046 (interactive
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3047 (if sql-connection-alist
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3048 (list
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3049 (let ((completion-ignore-case t))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3050 (completing-read "Connection: "
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3051 (mapcar (lambda (c) (car c))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3052 sql-connection-alist)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3053 nil t nil nil '(()))))
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3054 nil))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3055
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3056 ;; Are there connections defined
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3057 (if sql-connection-alist
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3058 ;; Was one selected
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3059 (when connection
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3060 ;; Get connection settings
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3061 (let ((connect-set (assoc connection sql-connection-alist)))
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3062 ;; Settings are defined
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3063 (if connect-set
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3064 ;; Set the desired parameters
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3065 (eval `(let*
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3066 (,@(cdr connect-set)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3067 ;; :sqli-login params variable
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3068 (param-var (sql-get-product-feature sql-product
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3069 :sqli-login nil t))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3070 ;; :sqli-login params value
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3071 (login-params (sql-get-product-feature sql-product
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3072 :sqli-login))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3073 ;; which params are in the connection
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3074 (set-params (mapcar
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3075 (lambda (v)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3076 (cond
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3077 ((eq (car v) 'sql-user) 'user)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3078 ((eq (car v) 'sql-password) 'password)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3079 ((eq (car v) 'sql-server) 'server)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3080 ((eq (car v) 'sql-database) 'database)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3081 ((eq (car v) 'sql-port) 'port)
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3082 (t (car v))))
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3083 (cdr connect-set)))
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3084 ;; the remaining params (w/o the connection params)
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3085 (rem-params (delq nil
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3086 (mapcar
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3087 (lambda (l)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3088 (unless (member l set-params)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3089 l))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3090 login-params)))
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3091 ;; Remember the connection
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3092 (sql-connection connection))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3093
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3094 ;; Set the remaining parameters and start the
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3095 ;; interactive session
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3096 (eval `(let ((,param-var ',rem-params))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3097 (sql-product-interactive sql-product)))))
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3098 (message "SQL Connection <%s> does not exist" connection)
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3099 nil)))
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3100 (message "No SQL Connections defined")
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3101 nil))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3102
109482
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3103 (defun sql-save-connection (name)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3104 "Captures the connection information of the current SQLi session.
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3105
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3106 The information is appended to `sql-connection-alist' and
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3107 optionally is saved to the user's init file."
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3108
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3109 (interactive "sNew connection name: ")
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3110
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3111 (if sql-connection
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3112 (message "This session was started by a connection; it's already been saved.")
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3113
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3114 (let ((login (sql-get-product-feature sql-product :sqli-login))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3115 (alist sql-connection-alist)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3116 connect)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3117
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3118 ;; Remove the existing connection if the user says so
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3119 (when (and (assoc name alist)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3120 (yes-or-no-p (format "Replace connection definition <%s>? " name)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3121 (setq alist (assq-delete-all name alist)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3122
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3123 ;; Add the new connection if it doesn't exist
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3124 (if (assoc name alist)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3125 (message "Connection <%s> already exists" name)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3126 (setq connect
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3127 (append (list name)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3128 (delq nil
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3129 (mapcar
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3130 (lambda (param)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3131 (cond
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3132 ((eq param 'product) `(sql-product (quote ,sql-product)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3133 ((eq param 'user) `(sql-user ,sql-user))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3134 ((eq param 'database) `(sql-database ,sql-database))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3135 ((eq param 'server) `(sql-server ,sql-server))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3136 ((eq param 'port) `(sql-port ,sql-port))))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3137 (append (list 'product) login)))))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3138
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3139 (setq alist (append alist (list connect)))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3140
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3141 ;; confirm whether we want to save the connections
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3142 (if (yes-or-no-p "Save the connections for future sessions? ")
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3143 (customize-save-variable 'sql-connection-alist alist)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3144 (customize-set-variable 'sql-connection-alist alist))))))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3145
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3146 (defun sql-connection-menu-filter (tail)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3147 "Generates menu entries for using each connection."
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3148 (append
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3149 (mapcar
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3150 (lambda (conn)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3151 (vector
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3152 (format "Connection <%s>" (car conn))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3153 (list 'sql-connect (car conn))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3154 t))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3155 sql-connection-alist)
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3156 tail))
c9df47f7bbf3 SQL Mode V2.3 - cleanup connection handling
Michael Mauger <mmaug@yahoo.com>
parents: 109460
diff changeset
3157
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3158 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3159 (defun sql-oracle ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3160 "Run sqlplus by Oracle as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3161
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3162 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3163 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3164 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3165
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3166 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
3167 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
3168 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
3169 the list `sql-oracle-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3170
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3171 The buffer is put in SQL interactive mode, giving commands for sending
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3172 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3173
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3174 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3175 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3176 before \\[sql-oracle]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3177 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3178 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3179 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3180
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3181 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3182 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3183 (sql-product-interactive 'oracle))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3184
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3185 (defun sql-comint-oracle (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3186 "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
3187 ;; 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
3188 ;; 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
3189 ;; 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
3190 ;; "param".
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3191 (let ((parameter nil))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3192 (if (not (string= "" sql-user))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3193 (if (not (string= "" sql-password))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3194 (setq parameter (concat sql-user "/" sql-password))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3195 (setq parameter sql-user)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3196 (if (and parameter (not (string= "" sql-database)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3197 (setq parameter (concat parameter "@" sql-database)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3198 (if parameter
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3199 (setq parameter (nconc (list parameter) options))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3200 (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
3201 (sql-comint product parameter)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3202
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3203
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3204
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
3205 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3206 (defun sql-sybase ()
108569
6e7ebe021a2c * progmodes/sql.el: Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 108381
diff changeset
3207 "Run isql by Sybase as an inferior process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3208
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3209 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3210 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3211 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3212
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3213 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
3214 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
3215 `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
3216 can be stored in the list `sql-sybase-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3217
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3218 The buffer is put in SQL interactive mode, giving commands for sending
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3219 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3220
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3221 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3222 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3223 before \\[sql-sybase]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3224 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3225 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3226 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3227
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3228 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3229 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3230 (sql-product-interactive 'sybase))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3231
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3232 (defun sql-comint-sybase (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3233 "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
3234 ;; 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
3235 ;; make-comint.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3236 (let ((params options))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3237 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3238 (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
3239 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3240 (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
3241 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3242 (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
3243 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3244 (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
3245 (sql-comint product params)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3246
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3247
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3248
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
3249 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3250 (defun sql-informix ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3251 "Run dbaccess by Informix as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3252
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3253 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3254 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3255 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3256
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3257 Interpreter used comes from variable `sql-informix-program'. Login uses
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3258 the variable `sql-database' as default, if set.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3259
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3260 The buffer is put in SQL interactive mode, giving commands for sending
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3261 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3262
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3263 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3264 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3265 before \\[sql-informix]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3266 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3267 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3268 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3269
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3270 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3271 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3272 (sql-product-interactive 'informix))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3273
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3274 (defun sql-comint-informix (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3275 "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
3276 ;; username and password are ignored.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3277 (let ((db (if (string= "" sql-database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3278 "-"
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3279 (if (string= "" sql-server)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3280 sql-database
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3281 (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
3282 (sql-comint product (append `(,db "-") options))))
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3283
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3284
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3285
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
3286 ;;;###autoload
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3287 (defun sql-sqlite ()
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3288 "Run sqlite as an inferior process.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3289
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3290 SQLite is free software.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3291
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3292 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
3293 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
3294 `*SQL*'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3295
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3296 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
3297 the variables `sql-user', `sql-password', `sql-database', and
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3298 `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
3299 can be stored in the list `sql-sqlite-options'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3300
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3301 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
3302 input. See `sql-interactive-mode'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3303
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3304 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
3305 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
3306 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
3307 in the SQL buffer, after you start the process.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3308 The default comes from `process-coding-system-alist' and
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3309 `default-process-coding-system'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3310
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3311 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3312 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3313 (sql-product-interactive 'sqlite))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3314
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3315 (defun sql-comint-sqlite (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3316 "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
3317 ;; 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
3318 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3319 (let ((params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3320 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3321 (setq params (append (list sql-database) params)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3322 (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
3323 (sql-comint product params)))
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3324
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3325
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3326
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
3327 ;;;###autoload
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3328 (defun sql-mysql ()
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3329 "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
3330
40432
225bd38b0ce7 (sql-mysql): Doc change by RMS.
Gerd Moellmann <gerd@gnu.org>
parents: 38872
diff changeset
3331 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
3332
24268
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
3333 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
3334 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
3335 `*SQL*'.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3336
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3337 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
3338 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
3339 `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
3340 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
3341
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3342 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
3343 input. See `sql-interactive-mode'.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3344
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3345 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
3346 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
3347 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
3348 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
3349 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
3350 `default-process-coding-system'.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3351
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3352 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
3353 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3354 (sql-product-interactive 'mysql))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3355
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3356 (defun sql-comint-mysql (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3357 "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
3358 ;; 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
3359 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3360 (let ((params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3361 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3362 (setq params (append (list sql-database) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3363 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3364 (setq params (append (list (concat "--host=" sql-server)) params)))
108991
b2a9d4e48488 * lisp/progmodes/sql.el (sql-connect-mysql): Fix typo.
Glenn Morris <rgm@gnu.org>
parents: 108569
diff changeset
3365 (if (and sql-port (numberp sql-port))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3366 (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
3367 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3368 (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
3369 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3370 (setq params (append (list (concat "--user=" sql-user)) params)))
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3371 (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
3372 (sql-comint product params)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3373
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3374
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3375
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
3376 ;;;###autoload
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3377 (defun sql-solid ()
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3378 "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
3379
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3380 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
3381 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
3382 `*SQL*'.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3383
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3384 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
3385 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
3386 defaults, if set.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3387
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3388 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
3389 input. See `sql-interactive-mode'.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3390
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3391 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
3392 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
3393 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
3394 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
3395 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
3396 `default-process-coding-system'.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3397
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3398 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3399 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3400 (sql-product-interactive 'solid))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3401
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3402 (defun sql-comint-solid (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3403 "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
3404 ;; 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
3405 ;; make-comint.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3406 (let ((params options))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3407 ;; 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
3408 (if (not (or (string= "" sql-user)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3409 (string= "" sql-password)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3410 (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
3411 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3412 (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
3413 (sql-comint product params)))
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3414
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3415
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3416
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
3417 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3418 (defun sql-ingres ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3419 "Run sql by Ingres as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3420
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3421 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3422 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3423 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3424
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3425 Interpreter used comes from variable `sql-ingres-program'. Login uses
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3426 the variable `sql-database' as default, if set.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3427
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3428 The buffer is put in SQL interactive mode, giving commands for sending
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3429 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3430
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3431 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3432 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3433 before \\[sql-ingres]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3434 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3435 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3436 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3437
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3438 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3439 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3440 (sql-product-interactive 'ingres))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3441
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3442 (defun sql-comint-ingres (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3443 "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
3444 ;; 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
3445 (sql-comint product
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3446 (append (if (string= "" sql-database)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3447 nil
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3448 (list sql-database))
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3449 options)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3450
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3451
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3452
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
3453 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3454 (defun sql-ms ()
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3455 "Run osql by Microsoft as an inferior process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3456
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3457 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3458 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3459 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3460
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3461 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
3462 variables `sql-user', `sql-password', `sql-database', and `sql-server'
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3463 as defaults, if set. Additional command line parameters can be stored
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3464 in the list `sql-ms-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3465
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3466 The buffer is put in SQL interactive mode, giving commands for sending
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3467 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3468
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3469 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3470 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
3471 before \\[sql-ms]. You can also specify this with \\[set-buffer-process-coding-system]
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3472 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3473 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3474 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3475
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3476 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3477 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3478 (sql-product-interactive 'ms))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3479
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3480 (defun sql-comint-ms (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3481 "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
3482 ;; 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
3483 ;; make-comint.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3484 (let ((params options))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3485 (if (not (string= "" sql-server))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3486 (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
3487 (if (not (string= "" sql-database))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3488 (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
3489 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3490 (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
3491 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3492 (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
3493 (if (string= "" sql-user)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3494 ;; 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
3495 ;; credentials.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3496 (setq params (append (list "-E") params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3497 ;; 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
3498 ;; password, it's considered null.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3499 (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
3500 (sql-comint product params)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3501
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3502
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3503
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3504 ;;;###autoload
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3505 (defun sql-postgres ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3506 "Run psql by Postgres as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3507
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
3508 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3509 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3510 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3511
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3512 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
3513 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
3514 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
3515 `sql-postgres-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3516
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3517 The buffer is put in SQL interactive mode, giving commands for sending
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3518 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3519
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3520 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3521 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3522 before \\[sql-postgres]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3523 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3524 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
3525 `default-process-coding-system'. If your output lines end with ^M,
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3526 your might try undecided-dos as a coding system. If this doesn't help,
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3527 Try to set `comint-output-filter-functions' like this:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3528
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3529 \(setq comint-output-filter-functions (append comint-output-filter-functions
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3530 '(comint-strip-ctrl-m)))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3531
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3532 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3533 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3534 (sql-product-interactive 'postgres))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3535
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3536 (defun sql-comint-postgres (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3537 "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
3538 ;; 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
3539 ;; 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
3540 ;; 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
3541 ;; 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
3542 ;; sql-postgres-options.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3543 (let ((params options))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3544 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3545 (setq params (append params (list sql-database))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3546 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3547 (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
3548 (if (not (string= "" sql-user))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
3549 (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
3550 (sql-comint product params)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3551
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3552
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3553
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3554 ;;;###autoload
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3555 (defun sql-interbase ()
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3556 "Run isql by Interbase as an inferior process.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3557
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3558 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
3559 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
3560 `*SQL*'.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3561
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3562 Interpreter used comes from variable `sql-interbase-program'. Login
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3563 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
3564 defaults, if set.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3565
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3566 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
3567 input. See `sql-interactive-mode'.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3568
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3569 To specify a coding system for converting non-ASCII characters
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3570 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
3571 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
3572 in the SQL buffer, after you start the process.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3573 The default comes from `process-coding-system-alist' and
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3574 `default-process-coding-system'.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3575
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3576 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3577 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3578 (sql-product-interactive 'interbase))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3579
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3580 (defun sql-comint-interbase (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3581 "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
3582 ;; 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
3583 ;; make-comint.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3584 (let ((params options))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3585 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3586 (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
3587 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3588 (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
3589 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3590 (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
3591 (sql-comint product params)))
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
3592
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3593
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3594
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3595 ;;;###autoload
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3596 (defun sql-db2 ()
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3597 "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
3598
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3599 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
3600 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
3601 `*SQL*'.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3602
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3603 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
3604 automatic login.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3605
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3606 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
3607 input. See `sql-interactive-mode'.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3608
38872
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
3609 If you use \\[sql-accumulate-and-indent] to send multiline commands to
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
3610 db2, newlines will be escaped if necessary. If you don't want that, set
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
3611 `comint-input-sender' back to `comint-simple-send' by writing an after
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
3612 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
3613
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3614 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
3615 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
3616 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
3617 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
3618 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
3619 `default-process-coding-system'.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3620
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3621 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3622 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3623 (sql-product-interactive 'db2))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3624
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3625 (defun sql-comint-db2 (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3626 "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
3627 ;; 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
3628 ;; make-comint.
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3629 (sql-comint product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3630 )
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3631 ;; ;; Properly escape newlines when DB2 is interactive.
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3632 ;; (setq comint-input-sender 'sql-escape-newlines-and-send))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
3633
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3634 ;;;###autoload
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3635 (defun sql-linter ()
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3636 "Run inl by RELEX as an inferior process.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3637
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3638 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
3639 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
3640 `*SQL*'.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3641
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3642 Interpreter used comes from variable `sql-linter-program' - usually `inl'.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3643 Login uses the variables `sql-user', `sql-password', `sql-database' and
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3644 `sql-server' as defaults, if set. Additional command line parameters
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3645 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
3646 parameters.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3647
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3648 `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
3649 local connections, `sql-server' refers to the server name from the
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3650 `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
3651 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
3652 an empty password.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3653
108352
cf2043af9228 * progmodes/sql.el: Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
3654 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
3655 input. See `sql-interactive-mode'.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3656
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3657 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3658 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3659 (sql-product-interactive 'linter))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3660
109460
597339bd6bef SQL Mode V2.2 - Added sql-connect and sql-connection-alist
Michael Mauger <mmaug@yahoo.com>
parents: 108991
diff changeset
3661 (defun sql-comint-linter (product options)
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3662 "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
3663 ;; 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
3664 ;; make-comint.
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3665 (let ((params options)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3666 (login nil)
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3667 (old-mbx (getenv "LINTER_MBX")))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3668 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3669 (setq login (concat sql-user "/" sql-password)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3670 (setq params (append (list "-u" login) params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3671 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3672 (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
3673 (if (string= "" sql-database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3674 (setenv "LINTER_MBX" nil)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3675 (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
3676 (sql-comint product params)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
3677 (setenv "LINTER_MBX" old-mbx)))
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3678
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3679
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
3680
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3681 (provide 'sql)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3682
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
3683 ;; arch-tag: 7e1fa1c4-9ca2-402e-87d2-83a5eccb7ac3
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3684 ;;; sql.el ends here
108381
aa05f2497948 SQL mode version 2.1
Michael Mauger <mmaug@yahoo.com>
parents: 108352
diff changeset
3685