kostafey / ejc-sql

Emacs SQL client uses Clojure JDBC.
279 stars 29 forks source link

ejc-add-outside-borders-p: Wrong number of arguments #117

Closed orencio closed 4 years ago

orencio commented 4 years ago

Hi, I've installed ejc-sql and I've configured it, but after connecting to database I execute this sentence:

select * from dual;

but I get this error:

ejc-check-connection: Run M-x ejc-connect first!
Connection started...
[nREPL] Starting server via /usr/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0\"\] -- repl :headless :host localhost
Starting nREPL server for ejc-sql...
You can run the command ‘ejc-connect’ with C-c e c
[nREPL] server started on 39379
[nREPL] Establishing direct connection to localhost:39379 ...
[nREPL] Direct connection to localhost:39379 established
Connected -> dbname.
Starting nREPL server for ejc-sql...
Mark set [4 times]
Processing SQL query...
ejc-add-outside-borders-p: Wrong number of arguments: #[nil "Æ ˆÇÈÉÊˉÌ!!Èlj!#ˆÍÎÏ!‡" [truncate-lines major-mode mode-name ejc-result-table-impl view-read-only font-lock-defaults kill-all-local-variables t ejc-result-mode "SQL-Result" ...] 6 nil nil], 1
user-error: Minibuffer window is not active

This is my configuration:

(use-package ejc-sql
  :ensure t ;Auto-install the package from Melpa (optional)
  :load (ejc-interaction)
  :commands (ejc-connect ejc-connect-existing-repl ejc-sql-mode)
  :config
  (org-mode)
  (sql-mode)
  (load "~/.emacs.d/01-otras-libs/spinner.el/spinner.el")

  (add-hook 'ejc-sql-minor-mode-hook         ; Activa autocompletado.
            (lambda ()
              (auto-complete-mode t)
              (ejc-ac-setup)))
  (setq ejc-use-flx t)                         ; Autocompletado Fuzzy matching (requiere paquete «flx-ido».
  (setq ejc-flx-threshold 2)                   ; Autocompletado Fuzzu matching, número de letras mínimo para hacer autocompletado.
  (add-hook 'ejc-sql-minor-mode-hook           ; ElDoc para Oracle, PostgresSQL y MySQL.
            (lambda ()
              (ejc-eldoc-setup)))
  (add-hook 'ejc-sql-connected-hook
            (lambda ()
              (ejc-set-fetch-size 50)          ; Númere de filas que debe mostrar. Si se indica «nil» muestra todas.
              (ejc-set-max-rows 50)            ; Número de registros que tendrá el resultset. «nil» indica todos los registros.
              (ejc-set-column-width-limit 30)  ; Número máximos de carácteres por columna. «nil» indica todos.
              )
            )
  (setq ejc-result-table-impl                  ; Utiliza el modo orgtbl-mode para mostrar las tablas (parece mejor). Otra acternativa es «ejc-result-mode».
        'orgtbl-mode
        ;'ejc-result-mode
        )

  (setq ejc-org-mode-show-results nil)
  (setq ejc-org-mode-babel-wrapper t)

  (defun my-ejc-sql-ac-setup ()
    (ejc-sql-mode 1)
    (auto-complete-mode 1)
    (ejc-ac-setup))
  (add-hook 'sql-mode-hook 'my-ejc-sql-ac-setup)

  ;; Conexiones.
  (ejc-create-connection
   "dbname"
   :classpath (concat "~/.m2/repository/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.jar")
   :dbtype "oracle"
   :dbname "db"
   :host "db.domain.org"
   :port "1681"
   :user "***"
   :password "***"
   :separator "/")
  )

How can I solve it?

kostafey commented 4 years ago

@orencio Could you please eval and provide the evaluation results of the following expressions in you ejc-sql connected buffer:

orencio commented 4 years ago

Hello, these are theresults:

Ejc-Sql mode enabled in current buffer
You can run the command ‘ejc-sql-mode’ with M-x -sq-m RET
Ejc-Sql mode enabled in current buffer
Mark set [2 times]
Connection started...
[nREPL] Starting server via /usr/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0\"\] -- repl :headless :host localhost
Starting nREPL server for ejc-sql...
You can run the command ‘ejc-connect’ with C-c e c
Starting nREPL server for ejc-sql...
[nREPL] server started on 38501
[nREPL] Establishing direct connection to localhost:38501 ...
[nREPL] Direct connection to localhost:38501 established
Connected -> db.
#<buffer *cider-repl elpa/ejc-sql-20191201.1636:localhost:38501(clj)*>
Quit
((:separator . "/") (:classpath . "/home/user/.m2/repository/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.jar") (:password . "***") (:user . "user") (:port . "1681") (:host . "db.domain.org") (:dbname . "db") (:dbtype . "oracle"))
ejc-sql 0.3.3 (package: 20191201.1636)
You can run the command ‘ejc-version’ with M-x ejc-v RET
ejc-sql 0.3.3 (package: 20191201.1636)
GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29
You can run the command ‘emacs-version’ with M-x em-v RET
GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3
pepperblue commented 4 years ago

I get this error message from time to time. Rebuilding packages - I'm using Doom-Emacs - helps in this case ...

orencio commented 4 years ago

Hi @pepperblue, you are alright, I've uninstalled and installed again and now it runs ok.

Thank you very much.