Current File : //kunden/usr/share/emacs/27.2/lisp/progmodes/sql.elc |
;ELC
;;; Compiled
;;; in Emacs version 27.2
;;; with all optimizations.
;;; This file contains utf-8 non-ASCII characters,
;;; and so cannot be loaded into Emacs 22 or earlier.
(and (boundp 'emacs-version)
(< (aref emacs-version (1- (length emacs-version))) ?A)
(string-lessp emacs-version "23")
(error "`%s' was compiled for Emacs 23 or later" #$))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307\310\311\312\313\314\315\314\316& \210\317\320\321\322\323DD\324\325\326\314\307\327\330& \210\317\331\321\322\332DD\333\325\326\314\307\334\335& \210\317\336\321\322\337DD\340\325\326\314\307\327\330& \210\317\341\321\322\342DD\343\325\326\314\307\327\330& \210\317\344\321\322\345DD\346\312\347\325\350\314\307\327\351&\210\317\352\321\322\353DD\354\312\355\325\356\314\307\327\330&\210\357\360\361\362\363\364\325\365&\207" [require cl-lib comint custom thingatpt view custom-declare-group SQL nil "Running a SQL interpreter from within Emacs buffers." :version "20.4" :group languages processes custom-declare-variable sql-user funcall function #[0 "\300\207" [#1=""] 1 #1#] "Default username." :type string :safe stringp sql-password #[0 "\300\207" [#1#] 1 #1#] "Default password.\nIf you customize this, the value will be stored in your init\nfile. Since that is a plaintext file, this could be dangerous." :risky t sql-database #[0 "\300\207" [#1#] 1 #1#] "Default database." sql-server #[0 "\300\207" [#1#] 1 #1#] "Default server or host." sql-port #[0 "\300\207" [0] 1] "Default port for connecting to a MySQL or Postgres server." "24.1" number numberp sql-default-directory #[0 "\300\207" [nil] 1] "Default directory for SQL processes." "25.1" (choice (const nil) string) define-widget sql-login-params lazy "Widget definition of the login parameters list" :tag "Login Parameters" (set :tag "Login Parameters" (choice :tag "user" :value user (const user) (list :tag "Specify a default" (const user) (list :tag "Default" :inline t (const :default) string))) (const password) (choice :tag "server" :value server (const server) (list :tag "Specify a default" (const server) (list :tag "Default" :inline t (const :default) string)) (list :tag "file" (const :format #1# server) (const :format #1# :file) regexp) (list :tag "completion" (const :format #1# server) (const :format #1# :completion) (const :format #1# :must-match) (restricted-sexp :match-alternatives (listp stringp)))) (choice :tag "database" :value database (const database) (list :tag "Specify a default" (const database) (list :tag "Default" :inline t (const :default) string)) (list :tag "file" (const :format #1# database) (const :format #1# :file) (choice (const nil) regexp) (const :format #1# :must-match) (symbol :tag ":must-match")) (list :tag "completion" (const :format #1# database) (const :format #1# :default) (string :tag ":default") (const :format #1# :completion) (sexp :tag ":completion") (const :format #1# :must-match) (restricted-sexp :match-alternatives (listp stringp)))) (const port))] 12)
#@39 Product under `sql-interactive-mode'.
(defvar sql-interactive-product nil (#$ . 3081))
#@66 Connection name if interactive session started by `sql-connect'.
(defvar sql-connection nil (#$ . 3174))
#@5532 An alist of product specific configuration settings.
Without an entry in this list a product will not be properly
highlighted and will not support `sql-interactive-mode'.
Each element in the list is in the following format:
(PRODUCT FEATURE VALUE ...)
where PRODUCT is the appropriate value of `sql-product'. The
product name is then followed by FEATURE-VALUE pairs. If a
FEATURE is not specified, its VALUE is treated as nil. FEATURE
may be any one of the following:
:name string containing the displayable name of
the product.
:free-software is the product Free (as in Freedom) software?
:font-lock name of the variable containing the product
specific font lock highlighting patterns.
:sqli-program name of the variable containing the product
specific interactive program name.
:sqli-options name of the variable containing the list
of product specific options.
:sqli-login name of the variable containing the list of
login parameters (i.e., user, password,
database and server) needed to connect to
the database.
:sqli-comint-func function of two arguments, PRODUCT
and OPTIONS, that will open a comint buffer
and connect to the database. PRODUCT is the
first argument to be passed to `sql-comint',
and OPTIONS should be included in its second
argument. The function should use the values
of `sql-user', `sql-password', `sql-database',
`sql-server' and `sql-port' to . Do product
specific configuration of comint in this
function. See `sql-comint-oracle' for an
example of such a function.
:list-all Command string or function which produces
a listing of all objects in the database.
If it's a cons cell, then the car
produces the standard list of objects and
the cdr produces an enhanced list of
objects. What "enhanced" means is
dependent on the SQL product and may not
exist. In general though, the
"enhanced" list should include visible
objects from other schemas.
:list-table Command string or function which produces
a detailed listing of a specific database
table. If its a cons cell, then the car
produces the standard list and the cdr
produces an enhanced list.
:completion-object A function that returns a list of
objects. Called with a single
parameter--if nil then list objects
accessible in the current schema, if
not-nil it is the name of a schema whose
objects should be listed.
:completion-column A function that returns a list of
columns. Called with a single
parameter--if nil then list objects
accessible in the current schema, if
not-nil it is the name of a schema whose
objects should be listed.
:prompt-regexp regular expression string that matches
the prompt issued by the product
interpreter.
:prompt-length length of the prompt on the line.
:prompt-cont-regexp regular expression string that matches
the continuation prompt issued by the
product interpreter.
:input-filter function which can filter strings sent to
the command interpreter. It is also used
by the `sql-send-string',
`sql-send-region', `sql-send-paragraph'
and `sql-send-buffer' functions. The
function is passed the string sent to the
command interpreter and must return the
filtered string. May also be a list of
such functions.
:statement name of a variable containing a regexp that
matches the beginning of SQL statements.
:terminator the terminator to be sent after a
`sql-send-string', `sql-send-region',
`sql-send-paragraph' and
`sql-send-buffer' command. May be the
literal string or a cons of a regexp to
match an existing terminator in the
string and the terminator to be used if
its absent. By default ";".
:syntax-alist alist of syntax table entries to enable
special character treatment by font-lock
and imenu.
Other features can be stored but they will be ignored. However,
you can develop new functionality which is product independent by
using `sql-get-product-feature' to lookup the product specific
settings.
(defvar sql-product-alist '((ansi :name "ANSI" :font-lock sql-mode-ansi-font-lock-keywords :statement sql-ansi-statement-starters) (db2 :name "DB2" :font-lock sql-mode-db2-font-lock-keywords :sqli-program sql-db2-program :sqli-options sql-db2-options :sqli-login sql-db2-login-params :sqli-comint-func sql-comint-db2 :prompt-regexp "^db2 => " :prompt-length 7 :prompt-cont-regexp "^db2 (cont\\.) => " :input-filter sql-escape-newlines-filter) (informix :name "Informix" :font-lock sql-mode-informix-font-lock-keywords :sqli-program sql-informix-program :sqli-options sql-informix-options :sqli-login sql-informix-login-params :sqli-comint-func sql-comint-informix :prompt-regexp "^> " :prompt-length 2 :syntax-alist ((123 . "<") (125 . ">"))) (ingres :name "Ingres" :font-lock sql-mode-ingres-font-lock-keywords :sqli-program sql-ingres-program :sqli-options sql-ingres-options :sqli-login sql-ingres-login-params :sqli-comint-func sql-comint-ingres :prompt-regexp "^\\* " :prompt-length 2 :prompt-cont-regexp "^\\* ") (interbase :name "Interbase" :font-lock sql-mode-interbase-font-lock-keywords :sqli-program sql-interbase-program :sqli-options sql-interbase-options :sqli-login sql-interbase-login-params :sqli-comint-func sql-comint-interbase :prompt-regexp "^SQL> " :prompt-length 5) (linter :name "Linter" :font-lock sql-mode-linter-font-lock-keywords :sqli-program sql-linter-program :sqli-options sql-linter-options :sqli-login sql-linter-login-params :sqli-comint-func sql-comint-linter :prompt-regexp "^SQL>" :prompt-length 4) (mariadb :name "MariaDB" :free-software t :font-lock sql-mode-mariadb-font-lock-keywords :sqli-program sql-mariadb-program :sqli-options sql-mariadb-options :sqli-login sql-mariadb-login-params :sqli-comint-func sql-comint-mariadb :list-all "SHOW TABLES;" :list-table "DESCRIBE %s;" :prompt-regexp "^MariaDB \\[.*]> " :prompt-cont-regexp "^ [\"'`-]> " :syntax-alist ((35 . "< b")) :input-filter sql-remove-tabs-filter) (ms :name "Microsoft" :font-lock sql-mode-ms-font-lock-keywords :sqli-program sql-ms-program :sqli-options sql-ms-options :sqli-login sql-ms-login-params :sqli-comint-func sql-comint-ms :prompt-regexp "^[0-9]*>" :prompt-cont-regexp "^[0-9]*>" :prompt-length 5 :syntax-alist ((64 . "_")) :terminator ("^go" . "go")) (mysql :name "MySQL" :free-software t :font-lock sql-mode-mysql-font-lock-keywords :sqli-program sql-mysql-program :sqli-options sql-mysql-options :sqli-login sql-mysql-login-params :sqli-comint-func sql-comint-mysql :list-all "SHOW TABLES;" :list-table "DESCRIBE %s;" :prompt-regexp "^mysql> " :prompt-length 6 :prompt-cont-regexp "^ -> " :syntax-alist ((35 . "< b")) :input-filter sql-remove-tabs-filter) (oracle :name "Oracle" :font-lock sql-mode-oracle-font-lock-keywords :sqli-program sql-oracle-program :sqli-options sql-oracle-options :sqli-login sql-oracle-login-params :sqli-comint-func sql-comint-oracle :list-all sql-oracle-list-all :list-table sql-oracle-list-table :completion-object sql-oracle-completion-object :prompt-regexp "^SQL> " :prompt-length 5 :prompt-cont-regexp "^\\(?:[ ][ ][1-9]\\|[ ][1-9][0-9]\\|[1-9][0-9]\\{2\\}\\)[ ]\\{2\\}" :statement sql-oracle-statement-starters :syntax-alist ((36 . "_") (35 . "_")) :terminator ("\\(^/\\|;\\)" . "/") :input-filter sql-placeholders-filter) (postgres :name "Postgres" :free-software t :font-lock sql-mode-postgres-font-lock-keywords :sqli-program sql-postgres-program :sqli-options sql-postgres-options :sqli-login sql-postgres-login-params :sqli-comint-func sql-comint-postgres :list-all ("\\d+" . "\\dS+") :list-table ("\\d+ %s" . "\\dS+ %s") :completion-object sql-postgres-completion-object :prompt-regexp "^[[:alnum:]_]*=[#>] " :prompt-length 5 :prompt-cont-regexp "^[[:alnum:]_]*[-(][#>] " :input-filter sql-remove-tabs-filter :terminator ("\\(^\\s-*\\\\g\\|;\\)" . "\\g")) (solid :name "Solid" :font-lock sql-mode-solid-font-lock-keywords :sqli-program sql-solid-program :sqli-options sql-solid-options :sqli-login sql-solid-login-params :sqli-comint-func sql-comint-solid :prompt-regexp "^" :prompt-length 0) (sqlite :name "SQLite" :free-software t :font-lock sql-mode-sqlite-font-lock-keywords :sqli-program sql-sqlite-program :sqli-options sql-sqlite-options :sqli-login sql-sqlite-login-params :sqli-comint-func sql-comint-sqlite :list-all ".tables" :list-table ".schema %s" :completion-object sql-sqlite-completion-object :prompt-regexp "^sqlite> " :prompt-length 8 :prompt-cont-regexp "^ \\.\\.\\.> ") (sybase :name "Sybase" :font-lock sql-mode-sybase-font-lock-keywords :sqli-program sql-sybase-program :sqli-options sql-sybase-options :sqli-login sql-sybase-login-params :sqli-comint-func sql-comint-sybase :prompt-regexp "^SQL> " :prompt-length 5 :syntax-alist ((64 . "_")) :terminator ("^go" . "go")) (vertica :name "Vertica" :sqli-program sql-vertica-program :sqli-options sql-vertica-options :sqli-login sql-vertica-login-params :sqli-comint-func sql-comint-vertica :list-all ("\\d" . "\\dS") :list-table "\\d %s" :prompt-regexp "^[[:alnum:]_]*=[#>] " :prompt-length 5 :prompt-cont-regexp "^[[:alnum:]_]*[-(][#>] ")) (#$ . 3287))
(defvar sql-indirect-features '(:font-lock :sqli-program :sqli-options :sqli-login :statement))
(byte-code "\301\302\303\304\305DD\306\307\310\311\312\313\314\315\316\317\320\321\"BE\322BB\257\323\324\325\326& \210\327\330\331\"\210\301\331\303\304\332DD\333\307\317\320\334\"B\325\326\335\336& \210\301\337\303\304\340DD\341\325\326\342\343\307\344\323\345&\207" [sql-product-alist custom-declare-variable sql-connection-alist funcall function #[0 "\300\207" [nil] 1] "An alist of connection parameters for interacting with a SQL product.\nEach element of the alist is as follows:\n\n (CONNECTION (SQL-VARIABLE VALUE) ...)\n\nWhere CONNECTION is a case-insensitive string identifying the\nconnection, SQL-VARIABLE is the symbol name of a SQL mode\nvariable, and VALUE is the value to be assigned to the variable.\nThe most common SQL-VARIABLE settings associated with a\nconnection are: `sql-product', `sql-user', `sql-password',\n`sql-port', `sql-server', and `sql-database'.\n\nIf a SQL-VARIABLE is part of the connection, it will not be\nprompted for during login. The command `sql-connect' starts a\npredefined SQLi session using the parameters from this list.\nConnections defined here appear in the submenu SQL->Start... for\nmaking new SQLi sessions." :type alist :key-type (string :tag "Connection") :value-type set group (const :tag "Product" sql-product) choice mapcar #[257 "\300\301\302A\303\"\206 \304\305@!!\306@DF\207" [const :tag plist-get :name capitalize symbol-name quote] 6 "\n\n(fn PROD-INFO)"] ((group (const :tag "Username" sql-user) string) (group (const :tag "Password" sql-password) string) (group (const :tag "Server" sql-server) string) (group (const :tag "Database" sql-database) string) (group (const :tag "Port" sql-port) integer) (repeat :inline t (list :tab "Other" (symbol :tag " Variable Symbol") (sexp :tag "Value Expression")))) :version "24.1" :group SQL defvaralias sql-dialect sql-product #[0 "\300\207" [ansi] 1] "Select the SQL database product used.\nThis allows highlighting buffers properly when you open them." #[257 "\300\301\302A\303\"\206 \304\305@!!@F\207" [const :tag plist-get :name capitalize symbol-name] 6 "\n\n(fn PROD-INFO)"] :safe symbolp sql-use-indent-support #[0 "\300\207" [t] 1] "If non-nil then use the SQL indent support features of sql-indent.\nThe `sql-indent' package in ELPA provides indentation support for\nSQL statements with easy customizations to support varied layout\nrequirements.\n\nThe package must be available to be loaded and activated." :link (url-link "https://elpa.gnu.org/packages/sql-indent.html") boolean "27.1"] 16)
#@56 Enable `sqlind-minor-mode' if available and requested.
(defalias 'sql-indent-enable #[0 "\301\302!\205 \302\203 \303\202 \304!\207" [sql-use-indent-support fboundp sqlind-minor-mode 1 -1] 2 (#$ . 16541)])
(require 'auth-source)
#@264 Read auth source WALLET to locate the USER secret.
Sets `auth-sources' to WALLET and uses `auth-source-search' to locate the entry.
The DATABASE and SERVER are concatenated with a slash between them as the
host key.
(fn WALLET PRODUCT USER SERVER DATABASE PORT)
(defalias 'sql-auth-source-search-wallet #[1542 "\301\211\211\211\302 !\262 \211\303\230\262?\205 \262\205. \247\205. \304U?\205. \305!\262\211\303\230\262?\205= \262\211\303\230\262?\205J \262\203c \203^ \306Q\202d \202d \262\307\310\311\"\211\203O\211@\n\203\206 \312\313\"\203\212 \314\313\"\232\202\207 \315\203H \203\240 \312\316\"\203\244 \314\316\"\n\232\202\241 \315\203H\203\272 \312\317\"\203\276 \314\317\"\232\202\273 \315\203H\203\333 \312\320\"\203\333 \314\320\"\232\203\333 \211B\262\202H\203\312\321\"\203\203\312\322\"\203\314\321\" \232\203\314\322\"\232\203\211B\262\202H\203-\312\321\"\203-\314\321\" \232\203-\211B\262\202H\203H\312\322\"\203H\314\322\"\232\203H\211B\262A\266\202\202j \210\206Y\211\206Y\262G\323U\205q@\262\312\324\"\205q\314\324\")\207" [auth-sources nil symbol-name "" 0 number-to-string "/" auth-source-search :max 1000 plist-member :product plist-get t :user :port :host :server :database 1 :secret] 15 (#$ . 16780)])
(byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable sql-password-wallet funcall function #[0 "\300\211\301\211\203'