GNU bug report logs - #76025
[PATCH 1/1] * lisp/progmodes/sql.el: login without prompting

Previous Next

Package: emacs;

Reported by: Phil Estival <pe <at> 7d.nz>

Date: Mon, 3 Feb 2025 05:20:02 UTC

Severity: wishlist

Tags: patch

Full log


Message #52 received at 76025 <at> debbugs.gnu.org (full text, mbox):

From: Phil Estival <pe <at> 7d.nz>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 76025 <at> debbugs.gnu.org, Michael Mauger <mmauger <at> protonmail.com>
Subject: Re: [PATCH] ob-sql: session + sql.el w/o prompt
Date: Tue, 13 May 2025 16:03:49 +0200
[Message part 1 (text/plain, inline)]
* [2025-02-15 16:25 +0000] Ihor Radchenko <yantar92 <at> posteo.net>:
> Ihor Radchenko <yantar92 <at> posteo.net> writes:
>
> May you please update your latest patch for ob-sql.el, converting it
> into (1) patch to sql.el; (2) patch for ob-sql.el that assumes changes
> to sql.el?

I'm submitting again the patch to sql.el with two additionnal modifications.
This replaces the previous one.

--
Phil Estival

[0001-lisp-progmodes-sql.el-login-without-prompting.patch (text/x-diff, attachment)]
[0002-lisp-progmodes-sql.el-sql-comint-sqlite-allows-nil-d.patch (text/x-diff, inline)]
From 18c84feeb1d3f368a7e0e90692efe7a6a5b7c64f Mon Sep 17 00:00:00 2001
From: Phil Estival <pe <at> 7d.nz>
Date: Tue, 13 May 2025 15:57:24 +0200
Subject: [PATCH 2/2] * lisp/progmodes/sql.el: sql-comint-sqlite allows nil
 database name

Connecting to SQLite with no database name provided (be it nil or empty
string), means to connect to the in-memory transient database.  Since no
parameter can be given, they are made optional.
---
 lisp/progmodes/sql.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index af5b1a399cb..296f0336081 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -5075,13 +5075,15 @@ sql-sqlite
   (interactive "P")
   (sql-product-interactive 'sqlite buffer))
 
-(defun sql-comint-sqlite (product options &optional buf-name)
-  "Create comint buffer and connect to SQLite."
+(defun sql-comint-sqlite (product &optional options buf-name)
+  "Create a comint buffer and connect to SQLite (PRODUCT).
+See `sql-comint' for the OPTIONS and BUF-NAME parameters."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
   (let ((params
          (append options
-                 (if (not (string= "" sql-database))
+                 (if (and sql-database
+                          (not (string= "" sql-database)))
                      `(,(expand-file-name sql-database))))))
     (sql-comint product params buf-name)))
 
-- 
2.39.5


This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.