From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wJVsJNvYy2P4iAAAbAwnHQ (envelope-from ) for ; Sat, 21 Jan 2023 13:21:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cFivI9vYy2Of/AAAG6o9tA (envelope-from ) for ; Sat, 21 Jan 2023 13:21:47 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5A618929E for ; Sat, 21 Jan 2023 13:21:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJCrl-0005UO-EX; Sat, 21 Jan 2023 07:21:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJCrk-0005S5-7b for emacs-orgmode@gnu.org; Sat, 21 Jan 2023 07:21:00 -0500 Received: from mail.bundesbrandschatzamt.de ([198.7.63.95]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJCri-0002ZZ-B2 for emacs-orgmode@gnu.org; Sat, 21 Jan 2023 07:20:59 -0500 Received-SPF: pass (mail.bundesbrandschatzamt.de: authenticated connection) receiver=mail.bundesbrandschatzamt.de; client-ip=91.64.203.22; helo=smtpclient.apple; envelope-from=baron@bundesbrandschatzamt.de; x-software=spfmilter 2.001 http://www.acme.com/software/spfmilter/ with libspf2-1.2.10; Received: from smtpclient.apple (ip5b40cb16.dynamic.kabel-deutschland.de [91.64.203.22]) (authenticated bits=0) by mail.bundesbrandschatzamt.de (8.14.7/8.14.7) with ESMTP id 30LCKsoP008518 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 21 Jan 2023 12:20:56 GMT From: Andreas Gerler Content-Type: multipart/signed; boundary="Apple-Mail=_DA8A865E-223D-4AAF-881E-AD586ABEDCF8"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: ob-sql dbconnection engine Message-Id: <31A92865-F761-42B4-BDD6-C8189CDE2045@bundesbrandschatzamt.de> Date: Sat, 21 Jan 2023 13:20:47 +0100 To: emacs-orgmode@gnu.org X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.bundesbrandschatzamt.de [198.7.63.95]); Sat, 21 Jan 2023 12:20:56 +0000 (UTC) X-DCC--Metrics: heimdall.bundesbrandschatzamt.de 1102; Body=1 Fuz1=1 Fuz2=1 X-SMTP-Vilter-Version: 1.3.6 X-Spamd-Symbols: PGP_BLOCK,SPF_PASS,UNPARSEABLE_RELAY Received-SPF: permerror client-ip=198.7.63.95; envelope-from=baron@bundesbrandschatzamt.de; helo=mail.bundesbrandschatzamt.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674303707; a=rsa-sha256; cv=none; b=DvY5WXV55zTOn29GzFEq8Z9XoVySoZ56e9w3yAaPnWI5s7yZ1Ch5JSoS6Tc/VHOlEf67U6 nkVWpLqxc/cgkQ1738sl2VwnUeZ1NRsf+HgnElzoyz3G12UyL/LYSQU8BpB7mRw+QUoZpn ohk7xS5ljYGQ3VXxxpdKhzUdScZmzLKJaj+89MG1UDqHnczuqAoZJrVFOGtkwztEIq42hy jjD5afYNefo//W29pyI3sexOZiLwwTet8HL8cI4hwTU19L7kzlzePZ7wE2l3SN8C7sCt0S 23RC0lMZjvs26td7irZgTfs3Ya7dksQMC/womJ3K8FgsJ4/513XYNDrUFeyxtQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674303707; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=VKKmEjubgPT6loqD1HXcZnEjdsru1qMLXdv9gQOqCQ8=; b=RW1VloTxMpaUlIB1tG+CMjxIxSdJLIU2MG4t1aCUkqKIzF9DSPImgc0iyTY8HREiYX/559 VQND0bsZD4tnnMowqYgGciOlWmzUVALPQQrCru9IMWJoittyI3K2bQY95IYWQXnp1YXeeW u0W+dhs8x3ag0zM1lDclLFu7kf7yZv3qbTqYY95YdEaV2iPm+yRcWxyz5SiVDGWNRRL9Kg QFp7sWSdJ3Tpenv/QNYDidRzmToIL1YDDi7nYP5x+goLjutU7PtRtP4SO8TcbSTdrvphGf dFaS+3uiEl07uoq3JuekxfQvnwuPuIe3hXAjIFV7H7iX7uuqgDqbR4xyGrs3jQ== X-Spam-Score: -3.81 X-Migadu-Queue-Id: 5A618929E Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.81 X-TUID: A79ZsRukDmzO --Apple-Mail=_DA8A865E-223D-4AAF-881E-AD586ABEDCF8 Content-Type: multipart/mixed; boundary="Apple-Mail=_90A9A411-0C58-45FE-944D-58E3B41F08C5" --Apple-Mail=_90A9A411-0C58-45FE-944D-58E3B41F08C5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi! as I am still learning more elisp it took me some try and error but I = can use the sql-product now within dbconnection. Using :engine still works as well. Still wondering if there is a more elegant way for the if clause. --Apple-Mail=_90A9A411-0C58-45FE-944D-58E3B41F08C5 Content-Disposition: attachment; filename=ob-sql.el.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="ob-sql.el.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index f73e7003f..c6a192ae3 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -231,10 +231,14 @@ database connections." (:dbuser . sql-user) (:dbpassword . sql-password) (:dbinstance . sql-dbinstance) - (:database . sql-database))) + (:database . sql-database) + (:engine . sql-product))) (mapped-name (cdr (assq name name-mapping)))) - (cadr (assq mapped-name - (cdr (assoc-string dbconnection sql-connection-alist t)))))))) + (if (string-equal ":engine" name) + (symbol-name (cadr (cadr (assq mapped-name + (cdr (assoc-string dbconnection sql-connection-alist t)))))) + (cadr (assq mapped-name + (cdr (assoc-string dbconnection sql-connection-alist t))))))))) (defun org-babel-execute:sql (body params) "Execute a block of Sql code with Babel. @@ -247,7 +251,7 @@ This function is called by `org-babel-execute-src-block'." (dbpassword (org-babel-find-db-connection-param params :dbpassword)) (dbinstance (org-babel-find-db-connection-param params :dbinstance)) (database (org-babel-find-db-connection-param params :database)) - (engine (cdr (assq :engine params))) + (engine (org-babel-find-db-connection-param params :engine)) (colnames-p (not (equal "no" (cdr (assq :colnames params))))) (in-file (org-babel-temp-file "sql-in-")) (out-file (or (cdr (assq :out-file params)) --Apple-Mail=_90A9A411-0C58-45FE-944D-58E3B41F08C5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 so long=E2=80=A6 Andreas Gerler =E2=80=94 http://www.bundesbrandschatzamt.de/~baron --Apple-Mail=_90A9A411-0C58-45FE-944D-58E3B41F08C5-- --Apple-Mail=_DA8A865E-223D-4AAF-881E-AD586ABEDCF8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIzBAEBCgAdFiEERvQn3i5iUQoCDew4lRrK1qSO/JEFAmPL2KAACgkQlRrK1qSO /JFl6w/+Jm2pmUoPUux8Jddr0WaoXJ63EKTDzPuNUQZ6WVO0aptJ/G03scgIMB8e CHdstWUUZuRGB7ZAmpttWRRh3FjLvpw+LJoMuZOt2vojHee9cKRJetBzSJO1GJoQ UEvhC/WerQH0moOhkoRokavGkHpv9JhOEchJUn3DTShx/gJSY+0g2zqPyx3XfmZ6 5FEwDVh1dxz18iddIbkj2tq8E+ucWL1Qt92O5bk0CKNN6FVZeFhvmrCxFDi4Al6V z9jMkbyaAj3vRXAcqQd1QjpVoveO5cajqTSuekzD9oTfI9g7+UY/Xn6p5w250ORL Cw00QtLDOx30XZ/rc47StcpuDFQwhtHh6D7HLI2JGxj7HVhIGRyrRtHRypXPks1j vR/vC9sFmgJ2YrKmX5ha/WHpk1brgthOuXy3LUZrGubCr1gUAu9ipjn+a/f2EOlR Y5VzaxpZRYszE4JxhSohKwz802TGbTYRA3WF4Jndsulkfj3tvHb9Chtx9suLSlAZ n8DGUklFbC794h9ZCmF8lUNMZ2KiDgLo1jHu1i/TQpYkaIFtSfIym9PjLr9JBQH4 a7sVkJkqcyxl2FRUDfDCLegKnFcFuqCu4yCKUI6MjDApuIW8fzXEozgHx5+aW8Gx LhJtGbDl1gD4cYl2z+qXoQ7LM0qZr+sD626g11IuYt2vPyFDwx8= =AZ3F -----END PGP SIGNATURE----- --Apple-Mail=_DA8A865E-223D-4AAF-881E-AD586ABEDCF8--