emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117869: Add support for Vertica SQL.


From: Sam Steingold
Subject: [Emacs-diffs] trunk r117869: Add support for Vertica SQL.
Date: Fri, 12 Sep 2014 19:57:46 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117869
revision-id: address@hidden
parent: address@hidden
committer: Sam Steingold <address@hidden>
branch nick: trunk
timestamp: Fri 2014-09-12 15:57:40 -0400
message:
  Add support for Vertica SQL.
  
  * lisp/progmodes/sql.el (sql-product-alist): Add vertica.
  (sql-vertica-program, sql-vertica-options)
  (sql-vertica-login-params, sql-comint-vertica, sql-vertica):
  New functions and variables to support Vertica.
  Inspired by code by Roman Scherer <address@hidden>.
modified:
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/sql.el          sql.el-20091113204419-o5vbwnq5f7feedwu-1303
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2014-09-08 12:38:53 +0000
+++ b/etc/NEWS  2014-09-12 19:57:40 +0000
@@ -155,6 +155,8 @@
 interactive buffer and advances to the next line, skipping whitespace
 and comments.
 
+*** Add support for Vertica SQL.
+
 ** VC and related modes
 
 *** New option `vc-annotate-background-mode' controls whether

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-09-11 19:44:25 +0000
+++ b/lisp/ChangeLog    2014-09-12 19:57:40 +0000
@@ -1,3 +1,11 @@
+2014-09-12  Sam Steingold  <address@hidden>
+
+       * progmodes/sql.el (sql-product-alist): Add vertica.
+       (sql-vertica-program, sql-vertica-options)
+       (sql-vertica-login-params, sql-comint-vertica, sql-vertica):
+       New functions and variables to support Vertica.
+       Inspired by code by Roman Scherer <address@hidden>.
+
 2014-09-11  Paul Eggert  <address@hidden>
 
        * ses.el (ses-file-format-extend-parameter-list): Rename from

=== modified file 'lisp/progmodes/sql.el'
--- a/lisp/progmodes/sql.el     2014-09-09 20:39:31 +0000
+++ b/lisp/progmodes/sql.el     2014-09-12 19:57:40 +0000
@@ -505,6 +505,19 @@
      :prompt-length 5
      :syntax-alist ((?@ . "_"))
      :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 ("select table_name from v_catalog.tables" .
+                "select * from v_catalog.tables")
+     :list-table "\\d %s"
+     :prompt-regexp "^\\w*=[#>] "
+     :prompt-length 5
+     :prompt-cont-regexp "^\\w*[-(][#>] ")
     )
   "An alist of product specific configuration settings.
 
@@ -5056,6 +5069,51 @@
 
 
 
+(defcustom sql-vertica-program "vsql"
+  "Command to start the Vertica client."
+  :version "24.5"
+  :type 'file
+  :group 'SQL)
+
+(defcustom sql-vertica-options '("-P" "pager=off")
+  "List of additional options for `sql-vertica-program'.
+The default value disables the internal pager."
+  :version "24.5"
+  :type '(repeat string)
+  :group 'SQL)
+
+(defcustom sql-vertica-login-params '(user password database server)
+  "List of login parameters needed to connect to Vertica."
+  :version "24.5"
+  :type 'sql-login-params
+  :group 'SQL)
+
+(defun sql-comint-vertica (product options)
+  "Create comint buffer and connect to Vertica."
+  (sql-comint product
+              (nconc
+               (and (not (string= "" sql-server))
+                    (list "-h" sql-server))
+               (and (not (string= "" sql-database))
+                    (list "-d" sql-database))
+               (and (not (string= "" sql-password))
+                    (list "-w" sql-password))
+               (and (not (string= "" sql-user))
+                    (list "-U" sql-user))
+               options)))
+
+;;;###autoload
+(defun sql-vertica (&optional buffer)
+  "Run vsql as an inferior process."
+  (interactive "P")
+  (sql-product-interactive 'vertica buffer))
+
+(provide 'vertica)
+
+;;; vertica.el ends here
+
+
+
 (provide 'sql)
 
 ;;; sql.el ends here


reply via email to

[Prev in Thread] Current Thread [Next in Thread]