Changeset 313ec50 in dotfiles


Ignore:
Timestamp:
Oct 27, 2022, 6:10:48 PM (2 years ago)
Author:
w96k <w96k@…>
Branches:
master
Children:
ee24a4b
Parents:
a198d42
Message:

Emacs: Add SQL lsp and org support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emacs/.emacs.d/.emacs-config.org

    ra198d42 r313ec50  
    12401240  (add-hook 'sql-mode-hook 'lsp)
    12411241  (setq lsp-sqls-server "~/go/bin/sqls")
     1242
     1243  (setq lsp-sqls-workspace-config-path nil)
     1244
     1245  (setq lsp-sqls-connections
     1246        '(((driver . "mysql") (dataSourceName . "dbuser:mangoworms@tcp(192.168.2206.6:3306)/profile24"))))
     1247
     1248  (defun org-babel-edit-prep:sql (babel-info)
     1249    (setq-local buffer-file-name (->> babel-info caddr (alist-get :tangle)))
     1250    (setq-local lsp-buffer-uri (->> babel-info caddr (alist-get :tangle) lsp--path-to-uri))
     1251    (setq-local lsp-headerline-breadcrumb-enable nil)
     1252    (lsp))
    12421253#+END_SRC
    12431254
    12441255The main way to interact with SQL is using org-mode
    1245 #+begin_src emacs-lisp
     1256#+begin_src emacs-lisp :tangle init.el
    12461257  (when (package-loaded? "org-sql")
    12471258    (setq org-sql-files "~/projects/profile24/org"))
     1259
     1260  (setq sql-connection-alist
     1261      '((pool-a
     1262         (sql-product 'mysql)
     1263         (sql-server "192.168.220.6")
     1264         (sql-user "dbuser")
     1265         (sql-password "mangoworms")
     1266         (sql-database "profile24")
     1267         (sql-port 3306))))
    12481268#+end_src
    12491269
Note: See TracChangeset for help on using the changeset viewer.