Hello, Saulius Menkevičius <saulius.menkevic...@gmail.com> 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: =?UTF-8?q?Saulius=20Menkevi=C4=8Dius?= <saulius.menkevic...@gmail.com> > 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 that > 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, -- Nicolas Goaziou