From d89ddbd2a44a88505f7e8c363ff6268b8c6bf9a6 Mon Sep 17 00:00:00 2001 From: Phil Estival Date: Tue, 26 Nov 2024 11:51:05 +0100 Subject: [PATCH 04/10] ob-sql: set default header args as a custom variable, :options with composite types --- lisp/ob-sql.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 5fdba7aaa..9ed695aa8 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -81,6 +81,7 @@ (require 'ob) (require 'sql) +(defvar sql-connection-alist) (defvar ob-sql-session--batch-end-indicator "---#" "Indicate the end of a command batch.") (defvar ob-sql-session-command-terminated nil) (defvar org-babel-sql-out-file) @@ -112,8 +113,13 @@ (declare-function cygwin-convert-file-name-to-windows "cygw32.c" (file &optional absolute-p)) (declare-function sql-set-product "sql" (product)) -(defvar sql-connection-alist) -(defvar org-babel-default-header-args:sql '()) +(defcustom org-babel-default-header-args:sql '((:engine . "unset")) + "Default header args." + :type '(alist :key-type symbol :value-type string + :options ("dbi" "sqlite" "mysql" "postgres" + "sqsh" "mssql" "vertica" "oracle" "saphana" )) + :group 'org-babel-sql + :safe t) (defcustom org-babel-sql-run-comint-p 'nil "Run non-session SQL commands through comoint (or command line if nil)." -- 2.39.5