diff options
| author | Glenn Morris | 2012-02-07 23:54:09 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-02-07 23:54:09 -0800 |
| commit | 34e8a2da58131aa0e30f2b7427829b41d2997f10 (patch) | |
| tree | 3364592f7d78c633bd558444ffce2ae0d9f6133b | |
| parent | 14a1f3806c3d189d0dd10db863320fa36d428fd1 (diff) | |
| download | emacs-34e8a2da58131aa0e30f2b7427829b41d2997f10.tar.gz emacs-34e8a2da58131aa0e30f2b7427829b41d2997f10.zip | |
Shorten SQL mode NEWS entry, moving more details to doc strings
* lisp/progmodes/sql.el (sql-port, sql-connection-alist, sql-list-all)
(sql-list-table): Doc fixes.
* etc/NEWS: Related edits.
| -rw-r--r-- | etc/NEWS | 57 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/progmodes/sql.el | 34 |
3 files changed, 40 insertions, 54 deletions
| @@ -781,63 +781,50 @@ directory is a remote file name and neither the environment variable | |||
| 781 | $ESHELL nor the variable `explicit-shell-file-name' is set. | 781 | $ESHELL nor the variable `explicit-shell-file-name' is set. |
| 782 | 782 | ||
| 783 | --- | 783 | --- |
| 784 | ** SQL Mode enhancements. | 784 | ** SQL mode |
| 785 | 785 | ||
| 786 | *** `sql-dialect' is an alias for `sql-product'. | 786 | --- |
| 787 | *** New options `sql-port', `sql-connection-alist', `sql-send-terminator', | ||
| 788 | and `sql-oracle-scan-on'. | ||
| 787 | 789 | ||
| 788 | *** New variable `sql-port' specifies the port number for connecting | 790 | --- |
| 789 | to a MySQL or Postgres server. | 791 | *** New custom variables control prompting for login parameters. |
| 792 | Each supported product has a custom variable `sql-*-login-params', | ||
| 793 | which is a list of the parameters to be prompted for before a | ||
| 794 | connection is established. | ||
| 790 | 795 | ||
| 796 | --- | ||
| 791 | *** The command `sql-product-interactive' now takes a prefix argument, | 797 | *** The command `sql-product-interactive' now takes a prefix argument, |
| 792 | which causes it to prompt for an SQL product instead of the current | 798 | which causes it to prompt for an SQL product. |
| 793 | value of `sql-product'. | ||
| 794 | 799 | ||
| 795 | *** Product-specific SQL interactive commands now take prefix args. | 800 | --- |
| 801 | *** Product-specific SQL interactive commands now take prefix arguments. | ||
| 796 | These commands (`sql-sqlite', `sql-postgres', `sql-mysql', etc.), | 802 | These commands (`sql-sqlite', `sql-postgres', `sql-mysql', etc.), |
| 797 | given a prefix argument, prompt for a name for the SQL interactive | 803 | given a prefix argument, prompt for a name for the SQL interactive |
| 798 | buffer. This reduces the need for calling `sql-rename-buffer'. | 804 | buffer. This reduces the need for calling `sql-rename-buffer'. |
| 799 | 805 | ||
| 806 | --- | ||
| 800 | *** SQL interactive modes suppress command continuation prompts, and | 807 | *** SQL interactive modes suppress command continuation prompts, and |
| 801 | replace tabs with spaces. The first change impacts multiple line SQL | 808 | replace tabs with spaces. The first change impacts multiple line SQL |
| 802 | statements entered with C-j between each line, statements yanked into | 809 | statements entered with C-j between each line, statements yanked into |
| 803 | the buffer and statements sent with `sql-send-*' functions. The | 810 | the buffer and statements sent with `sql-send-*' functions. The |
| 804 | second change prevents the MySQL and Postgres interpreters from | 811 | second prevents the MySQL and Postgres interpreters from listing |
| 805 | listing object name completions when sent text via `sql-send-*' | 812 | object name completions when sent text via `sql-send-*' functions. |
| 806 | functions. | ||
| 807 | |||
| 808 | *** New custom variables control prompting for login parameters. | ||
| 809 | Each supported product has a custom variable `sql-*-login-params', | ||
| 810 | which is a list of the parameters to be prompted for before a | ||
| 811 | connection is established. | ||
| 812 | |||
| 813 | *** New variable `sql-connection-alist' for login parameter values. | ||
| 814 | This can be used to store different username, database and server | ||
| 815 | values. Connections defined in this variable appear in the submenu | ||
| 816 | SQL->Start... for making new SQLi sessions. | ||
| 817 | 813 | ||
| 814 | --- | ||
| 818 | *** New command `sql-connect' starts a predefined SQLi session, | 815 | *** New command `sql-connect' starts a predefined SQLi session, |
| 819 | using the login parameters from `sql-connection-alist'. | 816 | using the login parameters from `sql-connection-alist'. |
| 820 | 817 | ||
| 818 | --- | ||
| 821 | *** New "Save Connection" menu item in SQLi buffers. | 819 | *** New "Save Connection" menu item in SQLi buffers. |
| 822 | This gathers the login params specified for the SQLi session, if it | 820 | This gathers the login params specified for the SQLi session, if it |
| 823 | was not started by a connection, and saves them as a new connection. | 821 | was not started by a connection, and saves them as a new connection. |
| 824 | 822 | ||
| 825 | *** Commands for listing database objects and details. | 823 | --- |
| 826 | In an SQLi session, you can get a list of objects in the database. | 824 | *** New commands for listing database objects and details: |
| 827 | The contents of these lists are product specific. | 825 | sql-list-all and sql-list-table. |
| 828 | |||
| 829 | **** `C-c C-l a' or the "SQL->List all objects" menu item | ||
| 830 | lists all the objects in the database. With a prefix argument, it | ||
| 831 | displays additional details or extend the listing to include other | ||
| 832 | schemas objects. | ||
| 833 | |||
| 834 | **** `C-c C-l t' or the "SQL->List Table details" menu item | ||
| 835 | prompts for the name of a database table or view and displays the list | ||
| 836 | of columns in the relation. With a prefix argument, it displays | ||
| 837 | additional details about each column. | ||
| 838 | |||
| 839 | *** New options `sql-send-terminator' and `sql-oracle-scan-on'. | ||
| 840 | 826 | ||
| 827 | --- | ||
| 841 | *** An API for manipulating SQL product definitions has been added. | 828 | *** An API for manipulating SQL product definitions has been added. |
| 842 | 829 | ||
| 843 | ** TeX modes | 830 | ** TeX modes |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e8ed552ba07..9cda0d38acb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-02-08 Glenn Morris <rgm@gnu.org> | 1 | 2012-02-08 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * progmodes/sql.el (sql-port, sql-connection-alist, sql-list-all) | ||
| 4 | (sql-list-table): Doc fixes. | ||
| 5 | |||
| 3 | * image-mode.el (image-transform-minor-mode-map, image-transform-mode): | 6 | * image-mode.el (image-transform-minor-mode-map, image-transform-mode): |
| 4 | Comment out (does nothing). | 7 | Comment out (does nothing). |
| 5 | 8 | ||
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 2e59d8f8517..f8f62d113e6 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el | |||
| @@ -285,7 +285,7 @@ Customizing your password will store it in your ~/.emacs file." | |||
| 285 | :safe 'stringp) | 285 | :safe 'stringp) |
| 286 | 286 | ||
| 287 | (defcustom sql-port 0 | 287 | (defcustom sql-port 0 |
| 288 | "Default port." | 288 | "Default port for connecting to a MySQL or Postgres server." |
| 289 | :version "24.1" | 289 | :version "24.1" |
| 290 | :type 'number | 290 | :type 'number |
| 291 | :group 'SQL | 291 | :group 'SQL |
| @@ -613,30 +613,22 @@ settings.") | |||
| 613 | '(:font-lock :sqli-program :sqli-options :sqli-login :statement)) | 613 | '(:font-lock :sqli-program :sqli-options :sqli-login :statement)) |
| 614 | 614 | ||
| 615 | (defcustom sql-connection-alist nil | 615 | (defcustom sql-connection-alist nil |
| 616 | "An alist of connection parameters for interacting with a SQL | 616 | "An alist of connection parameters for interacting with a SQL product. |
| 617 | product. | ||
| 618 | |||
| 619 | Each element of the alist is as follows: | 617 | Each element of the alist is as follows: |
| 620 | 618 | ||
| 621 | \(CONNECTION \(SQL-VARIABLE VALUE) ...) | 619 | \(CONNECTION \(SQL-VARIABLE VALUE) ...) |
| 622 | 620 | ||
| 623 | Where CONNECTION is a symbol identifying the connection, SQL-VARIABLE | 621 | Where CONNECTION is a symbol identifying the connection, SQL-VARIABLE |
| 624 | is the symbol name of a SQL mode variable, and VALUE is the value to | 622 | is the symbol name of a SQL mode variable, and VALUE is the value to |
| 625 | be assigned to the variable. | 623 | be assigned to the variable. The most common SQL-VARIABLE settings |
| 626 | 624 | associated with a connection are: `sql-product', `sql-user', | |
| 627 | The most common SQL-VARIABLE settings associated with a connection | 625 | `sql-password', `sql-port', `sql-server', and `sql-database'. |
| 628 | are: | ||
| 629 | |||
| 630 | `sql-product' | ||
| 631 | `sql-user' | ||
| 632 | `sql-password' | ||
| 633 | `sql-port' | ||
| 634 | `sql-server' | ||
| 635 | `sql-database' | ||
| 636 | 626 | ||
| 637 | If a SQL-VARIABLE is part of the connection, it will not be | 627 | If a SQL-VARIABLE is part of the connection, it will not be |
| 638 | prompted for during login." | 628 | prompted for during login. The command `sql-connect' starts a |
| 639 | 629 | predefined SQLi session using the parameters from this list. | |
| 630 | Connections defined here appear in the submenu SQL->Start... for | ||
| 631 | making new SQLi sessions." | ||
| 640 | :type `(alist :key-type (string :tag "Connection") | 632 | :type `(alist :key-type (string :tag "Connection") |
| 641 | :value-type | 633 | :value-type |
| 642 | (set | 634 | (set |
| @@ -3647,7 +3639,9 @@ The list is maintained in SQL interactive buffers.") | |||
| 3647 | (read-from-minibuffer prompt tname)))) | 3639 | (read-from-minibuffer prompt tname)))) |
| 3648 | 3640 | ||
| 3649 | (defun sql-list-all (&optional enhanced) | 3641 | (defun sql-list-all (&optional enhanced) |
| 3650 | "List all database objects." | 3642 | "List all database objects. |
| 3643 | With optional prefix argument ENHANCED, displays additional | ||
| 3644 | details or extends the listing to include other schemas objects." | ||
| 3651 | (interactive "P") | 3645 | (interactive "P") |
| 3652 | (let ((sqlbuf (sql-find-sqli-buffer))) | 3646 | (let ((sqlbuf (sql-find-sqli-buffer))) |
| 3653 | (unless sqlbuf | 3647 | (unless sqlbuf |
| @@ -3659,7 +3653,9 @@ The list is maintained in SQL interactive buffers.") | |||
| 3659 | (set (make-local-variable 'sql-buffer) sqlbuf)))) | 3653 | (set (make-local-variable 'sql-buffer) sqlbuf)))) |
| 3660 | 3654 | ||
| 3661 | (defun sql-list-table (name &optional enhanced) | 3655 | (defun sql-list-table (name &optional enhanced) |
| 3662 | "List the details of a database table. " | 3656 | "List the details of a database table named NAME. |
| 3657 | Displays the columns in the relation. With optional prefix argument | ||
| 3658 | ENHANCED, displays additional details about each column." | ||
| 3663 | (interactive | 3659 | (interactive |
| 3664 | (list (sql-read-table-name "Table name: ") | 3660 | (list (sql-read-table-name "Table name: ") |
| 3665 | current-prefix-arg)) | 3661 | current-prefix-arg)) |