;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\301\307\310\311\312& \210\313\314\315\316\317DD\320\306\303\321\322\323\324\311\325& \210\313\326\315\316\327DD\330\306\303\321\322\323\331\311\332& \207" [require lsp-mode custom-declare-group lsp-sqls nil "LSP support for SQL, using sqls" :group :link (url-link "https://github.com/lighttiger2505/sqls") :package-version (lsp-mode . "7.0") custom-declare-variable lsp-sqls-server funcall function #[0 "\300\207" [#1="sqls"] 1 #1#] "Path to the `sqls` binary." :risky t :type file (lsp-mode . "7.0") lsp-sqls-workspace-config-path #[0 "\300\207" [#2="workspace"] 1 #2#] "If non-nil then setup workspace configuration with json file path." (choice (const "workspace") (const "root")) (lsp-mode . "7.0")] 12) (defalias 'lsp-sqls--make-launch-cmd #[0 "C\207" [lsp-sqls-server] 2]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\210\300\312\302\303\313DD\314\306\315%\207" [custom-declare-variable lsp-sqls-timeout funcall function #[0 "\300\207" [0.5] 1] "Timeout to use for `sqls' requests." :type number :package-version (lsp-mode . "7.1.0") lsp-sqls-connections #[0 "\300\207" [nil] 1] "The connections to the SQL server(s)." (repeat (alist :key-type (choice (const :tag "Driver" driver) (const :tag "Connection String" dataSourceName)) :value-type string))] 8) #@94 Setup workspace configuration using json file depending on `lsp-sqls-workspace-config-path'. (defalias 'lsp-sqls-setup-workspace-configuration #[0 "\203\302\303\304\305\306\"DD!\207 \307\267\202!\310\202\"\311\312 \310\"\202\"\313\211\2051\314!\2051\302\315!!\207" [lsp-sqls-connections lsp-sqls-workspace-config-path lsp--set-configuration :sqls :connections apply vector #s(hash-table size 2 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("workspace" 21 "root" 25)) ".sqls/config.json" f-join lsp-workspace-root nil file-exists-p lsp--read-json-file] 6 (#$ . 1407)]) #@15 (fn RESULT) (defalias 'lsp-sqls--show-results #[257 "r\305\306!q\210\307\211\223\210\310 B\311\nB\312 \313 \314!\211\307\211\315 \210c\262rq\210\316\307\"\262)\317\320!\203>\320\"\202?\211)\266\204+\207" [help-window-point-marker temp-buffer-window-setup-hook temp-buffer-window-show-hook help-window-old-frame standard-output get-buffer-create "*sqls results*" nil help-mode-setup help-mode-finish selected-frame buffer-name temp-buffer-window-setup erase-buffer temp-buffer-window-show functionp help-window-setup] 8 (#$ . 2014)]) #@217 Execute COMMAND on buffer text against current database. Buffer text is between START and END. If START and END are nil, use the current region if set, otherwise the entire buffer. (fn &optional COMMAND START END) (defalias 'lsp-sql-execute-query #[768 "\301\302\303\304\305\306\203\307 !\206\310\311 !\312\313\314\315 \203% \2020\316 \203/\317 \2020e!\320\315\203=\202H\316 \203G\321 \202Hd!F\257\"!\207" [lsp-sqls-timeout lsp-sqls--show-results lsp-request "workspace/executeCommand" :command "executeQuery" :arguments lsp:command-arguments\? vector lsp--buffer-uri :timeout :range :start lsp--point-to-position use-region-p region-beginning :end region-end] 18 (#$ . 2571) nil]) #@80 Execute COMMAND on paragraph against current database. (fn &optional COMMAND) (defalias 'lsp-sql-execute-paragraph #[256 "\212\300 \210`)\212\301 \210`)\302#\207" [backward-paragraph forward-paragraph lsp-sql-execute-query] 7 (#$ . 3284) nil]) #@41 Show databases. (fn &optional COMMAND) (defalias 'lsp-sql-show-databases #[256 "\301\302\303\304\305\306F\"!\207" [lsp-sqls-timeout lsp-sqls--show-results lsp-request "workspace/executeCommand" :command "showDatabases" :timeout] 8 (#$ . 3538) nil]) #@39 Show schemas. (fn &optional COMMAND) (defalias 'lsp-sql-show-schemas #[256 "\301\302\303\304\305\306F\"!\207" [lsp-sqls-timeout lsp-sqls--show-results lsp-request "workspace/executeCommand" :command "showSchemas" :timeout] 8 (#$ . 3795) nil]) #@43 Show connections. (fn &optional COMMAND) (defalias 'lsp-sql-show-connections #[256 "\301\302\303\304\305\306F\"!\207" [lsp-sqls-timeout lsp-sqls--show-results lsp-request "workspace/executeCommand" :command "showConnections" :timeout] 8 (#$ . 4046) nil]) #@42 Switch database. (fn &optional COMMAND) (defalias 'lsp-sql-switch-database #[256 "\300\301\302\303\304\305\300\306!!\307\310$!\"\207" [lsp-workspace-command-execute "switchDatabase" vector completing-read "Select database: " s-lines "showDatabases" nil t] 9 (#$ . 4309) nil]) #@44 Switch connection. (fn &optional COMMAND) (defalias 'lsp-sql-switch-connection #[256 "\300\301\302\303\304\305\306\307\300\310!!\311\312$\"@!\"\207" [lsp-workspace-command-execute "switchConnections" vector s-match "\\([[:digit:]]*\\)" completing-read "Select connection: " s-lines "showConnections" nil t] 11 (#$ . 4592) nil]) (byte-code "\300\301\302\303\304!\305\306\307\310\311\312\313\314\"\315\316\317#\210\315\320\321#\210\315\322\323#\210\315\324\325#\210\315\326\327#\210\315\330\331#\210\211\262\332\333\334\335&\f!\207" [lsp-register-client make-lsp-client :new-connection lsp-stdio-connection lsp-sqls--make-launch-cmd :major-modes (sql-mode) :priority -1 :action-handlers make-hash-table :test equal puthash "executeQuery" lsp-sql-execute-query "showDatabases" lsp-sql-show-databases "showSchemas" lsp-sql-show-schemas "showConnections" lsp-sql-show-connections "switchDatabase" lsp-sql-switch-database "switchConnections" lsp-sql-switch-connection :server-id sqls :initialized-fn #[257 "\301\302H\303\"\210\211\304 )\207" [lsp--cur-workspace lsp:set-server-capabilities-execute-command-provider\? 2 t lsp-sqls-setup-workspace-configuration] 4 "\n\n(fn WORKSPACE)"]] 14) (defconst lsp-sqls-plist-value-when-compiled nil) (provide 'lsp-sqls)