From 5da846ed082c4c03dae3344eaf0da3b2b54656c0 Mon Sep 17 00:00:00 2001 From: Phil Estival Date: Tue, 7 Jan 2025 03:40:39 +0100 Subject: [PATCH 2/5] lisp/ob-sql.el: default header arguments are a custom variable default header arguments have :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 f94bb1272..df0059492 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