From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] lisp/ob-sql.el: add support for :dbport parameter Date: Tue, 07 Apr 2015 08:17:59 +0200 Message-ID: <87zj6kpilk.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfMoZ-0008UR-8G for emacs-orgmode@gnu.org; Tue, 07 Apr 2015 02:16:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfMoU-0008C4-5N for emacs-orgmode@gnu.org; Tue, 07 Apr 2015 02:16:47 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:58616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfMoT-0008Bq-Ve for emacs-orgmode@gnu.org; Tue, 07 Apr 2015 02:16:42 -0400 In-Reply-To: ("Saulius \=\?utf-8\?Q\?Menkevi\=C4\=8Di\?\= \=\?utf-8\?Q\?us\=22's\?\= message of "Mon, 06 Apr 2015 23:34:50 +0300") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Saulius =?utf-8?Q?Menkevi=C4=8Dius?= Cc: emacs-orgmode@gnu.org Hello, Saulius Menkevi=C4=8Dius writes: > This (tiny) patch implements ability to set dbport for org-babel sql > functionality. I often use ssh port forwarding to connect to remote > mysql servers where port is mapped to non-standard one on local > machine. Thank you. > This is my first patch, below the 15 line threshold. > > From ca3f85877bdf406deefaf66cbac3483a7e41f134 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Saulius=3D20Menkevi=3DC4=3D8Dius?=3D > Date: Mon, 6 Apr 2015 23:13:06 +0300 > Subject: [PATCH] ob-sql: Add possibility to set dbport > > * lisp/ob-sql.el: will now recognize dbport parameter. Currently it > is supported for mysql engine only. You need to also specify what functions are modified, e.g., * lisp/ob-sql.el (org-babel-sql-dbstring-mysql): Change signature. > +(defun org-babel-sql-dbstring-mysql (host port user password database) > "Make MySQL cmd line args for database connection. Pass nil to omit t= hat arg." > (combine-and-quote-strings > (delq nil > (list (when host (concat "-h" host)) > + (when port (concat "-P" (number-to-string port))) Isn't PORT a string already? > (dbhost (cdr (assoc :dbhost params))) > + (dbport (cdr (assoc :dbport params))) Nitpick: `assoc' -> `assq' Regards, --=20 Nicolas Goaziou