403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/share/emacs/28.2/lisp/org/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/emacs/28.2/lisp/org/ob-sql.elc
;ELC
;;; Compiled
;;; in Emacs version 28.2
;;; with all optimizations.



(require 'ob)
(defvar org-babel-default-header-args:sql nil)
#@32 SQL-specific header arguments.
(defconst org-babel-header-args:sql '((engine . :any) (out-file . :any) (dbhost . :any) (dbport . :any) (dbuser . :any) (dbpassword . :any) (dbinstance . :any) (database . :any)) (#$ . 145))
#@66 Expand BODY according to the values of PARAMS.

(fn BODY PARAMS)
(defalias 'org-babel-expand-body:sql #[514 "\300\236A\301\236A\302\303\304\305!\"E\306#\207" [:prologue :epilogue mapconcat identity org-babel-sql-expand-vars org-babel--get-vars "\n"] 11 (#$ . 373)])
#@156 Set `sql-product' in Org edit buffer.
Set `sql-product' in Org edit buffer according to the
corresponding :engine source block header argument.

(fn INFO)
(defalias 'org-babel-edit-prep:sql #[257 "\300\3018\236A\3021\303!0\207\210\304\207" [:engine 2 (user-error) sql-set-product "Cannot set `sql-product' in Org Src edit buffer"] 4 (#$ . 654)])
#@118 Make MySQL cmd line args for database connection.  Pass nil to omit that arg.

(fn HOST PORT USER PASSWORD DATABASE)
(defalias 'org-babel-sql-dbstring-mysql #[1285 "\300\301\302\205\f\303P\205\304\305	\"\205\306P\205(\307P\2051\310P\257\"!\207" [combine-and-quote-strings delq nil "-h" format "-P%d" "-u" "-p" "-D"] 14 (#$ . 1011)])
#@117 Make PostgreSQL command line args for database connection.
Pass nil to omit that arg.

(fn HOST PORT USER DATABASE)
(defalias 'org-babel-sql-dbstring-postgresql #[1028 "\300\301\302\205\f\303P\205\304\305\"\205\306P\205(\307PF\"!\207" [combine-and-quote-strings delq nil "-h" format "-p%d" "-U" "-d"] 12 (#$ . 1378)])
#@336 Make Oracle command line arguments for database connection.

If HOST and PORT are nil then don't pass them.  This allows you
to use names defined in your "TNSNAMES" file.  So you can
connect with

  <user>/<password>@<host>:<port>/<database>

or

  <user>/<password>@<database>

using its alias.

(fn HOST PORT USER PASSWORD DATABASE)
(defalias 'org-babel-sql-dbstring-oracle #[1285 "\203!\203!\211\203!\203!\203!\300\301&\207\2034\2034\211\2034\300\302$\207\303\304!\207" [format "%s/%s@%s:%s/%s" "%s/%s@%s" user-error "Missing information to connect to database"] 12 (#$ . 1725)])
#@196 Make sqlcmd command line args for database connection.
`sqlcmd' is the preferred command line tool to access Microsoft
SQL Server on Windows and Linux platform.

(fn HOST USER PASSWORD DATABASE)
(defalias 'org-babel-sql-dbstring-mssql #[1028 "\300\301\302\303\205\304\305	\"\205\304\306	\"\205\"\304\307	\"\205,\304\310	\"F\"\311#\207" [mapconcat identity delq nil format "-S \"%s\"" "-U \"%s\"" "-P \"%s\"" "-d \"%s\"" " "] 14 (#$ . 2341)])
#@155 Make sqsh command line args for database connection.
"sqsh" is one method to access Sybase or MS SQL via Linux platform

(fn HOST USER PASSWORD DATABASE)
(defalias 'org-babel-sql-dbstring-sqsh #[1028 "\300\301\302\303\205\304\305	\"\205\304\306	\"\205\"\304\307	\"\205,\304\310	\"F\"\311#\207" [mapconcat identity delq nil format "-S \"%s\"" "-U \"%s\"" "-P \"%s\"" "-D \"%s\"" " "] 14 (#$ . 2808)])
#@123 Make Vertica command line args for database connection.
Pass nil to omit that arg.

(fn HOST PORT USER PASSWORD DATABASE)
(defalias 'org-babel-sql-dbstring-vertica #[1285 "\300\301\302\303\205\304\305\n\"\205\304\306\n\"\205\"\304\307\n\"\205.\304\310\311!\"\2058\304\312\n\"\257\"\313#\207" [mapconcat identity delq nil format "-h %s" "-p %d" "-U %s" "-w %s" shell-quote-argument "-d %s" " "] 16 (#$ . 3233)])
#@133 Make SAP HANA command line args for database connection.
Pass nil to omit that arg.

(fn HOST PORT INSTANCE USER PASSWORD DATABASE)
(defalias 'org-babel-sql-dbstring-saphana #[1542 "\300\301\302\303	\205\205\304\305#\n\205%	?\205%\304\306\f\"	\205/\304\307\"	\2059\304\310\"	\205E\304\311\312\f!\"	\205O\304\313\"\257\"\314#\207" [mapconcat identity delq nil format "-n %s:%s" "-n %s" "-i %d" "-u %s" "-p %s" shell-quote-argument "-d %s" " "] 18 (#$ . 3675)])
#@227 Convert FILE to OS standard file name.
If in Cygwin environment, uses Cygwin specific function to
convert the file name.  In a Windows-NT environment, do nothing.
Otherwise, use Emacs' standard conversion function.

(fn FILE)
(defalias 'org-babel-sql-convert-standard-filename #[257 "\301\302!\203
\303\304\302!\"\207\305\230\203\207\303\304\306!\"\207" [system-type fboundp cygwin-convert-file-name-to-windows format "%S" "windows-nt" convert-standard-filename] 5 (#$ . 4174)])
#@335 Return database connection parameter NAME.
Given a parameter NAME, if :dbconnection is defined in PARAMS
then look for the parameter into the corresponding connection
defined in `sql-connection-alist', otherwise look into PARAMS.
See `sql-connection-alist' (part of SQL mode) for how to define
database connections.

(fn PARAMS NAME)
(defalias 'org-babel-find-db-connection-param #[514 "\301\236\203\301\236A\302\236A\211\303\"A\236A@\207\211\236A\207" [sql-connection-alist :dbconnection ((:dbhost . sql-server) (:dbport . sql-port) (:dbuser . sql-user) (:dbpassword . sql-password) (:dbinstance . sql-dbinstance) (:database . sql-database)) assoc] 9 (#$ . 4666)])
#@117 Execute a block of Sql code with Babel.
This function is called by `org-babel-execute-src-block'.

(fn BODY PARAMS)
(defalias 'org-babel-execute:sql #[514 "\301\236A\302\236A\303\304\"\303\305\"\303\306\"\303\307\"\303\310\"\303\311\"\312	\236A\313\n\236A\314\232?\315\316!\317\f\236A\206>\315\320!\321C\322!\211\323\267\202\200\324\325\206Q\321\326!\327\326!%\202\205\324\330\206f\321\326!\326!$\202\205\324\331\206z\321\332
$\333\326	!!\333\326	!!%\202\205\324\334\335
%\203\253\321\202\254\336\206\262\321\326	!\326	!&\202\205\324\337\n\203\316\324\340\f\"\202\317\321\341\300!\203\331\206\332\342\203\343\321\202\344\343\344$\326\n!\326\n!\206\374\321&\202\205\324\345\206	\321\346
$\333\326	!!\333\326	!!%\202\205\324\347\350
%\326!\326!\206?\321%\202\205\324\351\352
%\326!\326!$\202\205\324\353\354\f&\326!\326!\206|\321%\202\205\355\356\"\262\357\360\361\"\362\363\"\216r\211q\210\322!\211\364\267\202\256\365\202\257\366\202\257\367\202\257\370\202\257\321\262\371\"\372\230\203\302\373\202\303\321\261\210)r\211q\210\374\375\211\375\376%\210*\210\377\321\"\210\201@\235?\205e\201A\235\204H\201B\235\204H\201C\235\204H\201D\235\204H\201E\235\204H\201F\235\204H\201G\235\204?\201H\235\204?\201I\235\204?\201J\235\203e\201K\235\204e\357\201L\361\"r\211q\210\362\201M\"\216\201N!\210\201O *\207\357\201L\361\"r\211q\210\362\201P\"\216\322!\201Q>\203\272\203\357\201L\361\"r\211q\210\362\201R\"\216\201S!\210eb\210\201Ty\210\201Uc\210\201V\240\210\201W!\210*\210\202\357\201L\361\"r\211q\210\362\201X\"\216\201S!\210eb\210\201Y\201Z\375\361#\203\352\201[\201T!\240\210db\210\201\\u\210\201]\201^!\203\201_\201T!\210db\210\201\\u\210\202\362\201W!\210*\210\201`\372\230\203(\201a\202+\201b\"\210\201c\201d\362\201e\"\201f \"\201g\201h\236A\313\236A\"\201g\201i\236A\201j\236A\"#*\262\207" [sql-postgres-program :result-params :cmdline org-babel-find-db-connection-param :dbhost :dbport :dbuser :dbpassword :dbinstance :database :engine :colnames "no" org-babel-temp-file "sql-in-" :out-file "sql-out-" "" intern #s(hash-table size 10 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (dbi 73 monetdb 94 mssql 114 mysql 148 postgresql 191 postgres 191 sqsh 257 vertica 291 oracle 323 saphana 349)) format "dbish --batch %s < %s | sed '%s' > %s" org-babel-process-file-name "/^+/d;s/^|//;s/(NULL)/ /g;$d" "mclient -f tab %s < %s > %s" "sqlcmd %s -s \"	\" %s -i %s -o %s" org-babel-sql-dbstring-mssql org-babel-sql-convert-standard-filename "mysql %s %s %s < %s > %s" org-babel-sql-dbstring-mysql "-N" "%s%s --set=\"ON_ERROR_STOP=1\" %s -A -P footer=off -F \"	\"  %s -f %s -o %s %s" "PGPASSWORD=%s " boundp "psql" "-t" org-babel-sql-dbstring-postgresql "sqsh %s %s -i %s -o %s -m csv" org-babel-sql-dbstring-sqsh "vsql %s -f %s -o %s %s" org-babel-sql-dbstring-vertica "sqlplus -s %s < %s > %s" org-babel-sql-dbstring-oracle "hdbsql %s -I %s -o %s %s" org-babel-sql-dbstring-saphana user-error "No support for the %s SQL engine" generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (dbi 414 oracle 418 sqsh 422 mssql 422 vertica 426)) "/format partbox\n" "SET PAGESIZE 50000\nSET NEWPAGE 0\nSET TAB OFF\nSET SPACE 0\nSET LINESIZE 9999\nSET TRIMOUT ON TRIMSPOOL ON\nSET ECHO OFF\nSET FEEDBACK OFF\nSET VERIFY OFF\nSET HEADING ON\nSET MARKUP HTML OFF SPOOL OFF\nSET COLSEP '|'\n\n" "SET NOCOUNT ON\n\n" "\\a\n" org-babel-expand-body:sql "sqsh" "\ngo" write-region nil 0 org-babel-eval "none" "scalar" "verbatim" "html" "code" "pp" "file" "output" "raw" "org" "drawer" "table" " *temp*" #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents-literally buffer-string #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] (dbi mysql postgresql postgres saphana sqsh vertica) #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents 1 "-\n" "-" write-file #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] re-search-forward "^\\(-+\\)[^-]" match-string-no-properties -1 looking-at "\n" delete-char org-table-import (4) (16) org-babel-reassemble-table mapcar #[257 "\211@\300\242\230\203\n\301\207\207" [V0 hline] 3 "\n\n(fn X)"] org-table-to-lisp org-babel-pick-name :colname-names :rowname-names :rownames] 26 (#$ . 5348)])
#@295 Expand the variables held in VARS in BODY.

If SQLITE has been provided, prevent passing a format to
`orgtbl-to-csv'.  This prevents overriding the default format, which if
there were commas in the context of the table broke the table as an
argument mechanism.

(fn BODY VARS &optional SQLITE)
(defalias 'org-babel-sql-expand-vars #[770 "C\300\301\302#\"\210\211\242\207" [mapc make-closure #[257 "\300\302\303\304@\"A\211<\203>\305\306!\307\310\311\"\312\313\"\216r\211q\210\314\301?\205&\315\"c\210)r\211q\210\316\317\211\317\320%\210*\210\211\262\202K\211;\203G\211\202K\303\321\"\262\300\242#\240\207" [V0 V1 replace-regexp-in-string format "$%s" org-babel-temp-file "sql-data-" generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] orgtbl-to-csv (:fmt (lambda (el) (if (stringp el) el (format "%S" el)))) write-region nil 0 "%S"] 13 "\n\n(fn PAIR)"]] 9 (#$ . 10040)])
#@78 Raise an error because Sql sessions aren't implemented.

(fn SESSION PARAMS)
(defalias 'org-babel-prep-session:sql #[514 "\300\301!\207" [error "SQL sessions not yet implemented"] 4 (#$ . 10999)])
(provide 'ob-sql)

Youez - 2016 - github.com/yon3zu
LinuXploit