branch: elpa/emacsql
commit d45f3dedd643f7fed67087f63c908c16b0efe979
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Adapt to changes in pg v0.60
---
emacsql-pg.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/emacsql-pg.el b/emacsql-pg.el
index 826a4d104b..744e071110 100644
--- a/emacsql-pg.el
+++ b/emacsql-pg.el
@@ -19,11 +19,9 @@
(require 'emacsql)
(require 'pg nil t)
-(declare-function pg-connect "ext:pg"
- ( dbname user &optional
- (password "") (host "localhost") (port 5432) (tls nil)))
+(declare-function pg-connect-plist "ext:pg")
(declare-function pg-disconnect "ext:pg" (con))
-(declare-function pg-exec "ext:pg" (connection &rest args))
+(declare-function pg-exec "ext:pg" (con &rest args))
(declare-function pg-result "ext:pg" (result what &rest arg))
(defclass emacsql-pg-connection (emacsql-connection)
@@ -38,11 +36,14 @@
(nil "TEXT"))))
"A connection to a PostgreSQL database via pg.el.")
-(cl-defun emacsql-pg (dbname user &key
- (host "localhost") (password "") (port 5432)
debug)
+(cl-defun emacsql-pg ( dbname user &key
+ (host "localhost") (password nil) (port 5432) debug)
"Connect to a PostgreSQL server using pg.el."
(require 'pg)
- (let* ((pgcon (pg-connect dbname user password host port))
+ (let* ((pgcon (pg-connect-plist dbname user
+ :password password
+ :host host
+ :port port))
(connection (make-instance 'emacsql-pg-connection
:handle (and (fboundp 'pgcon-process)
(pgcon-process pgcon))