bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66983: 29.1; sql-sqlite prompt-cont-regexp incompatible since sqlite


From: Gustav Broberg
Subject: bug#66983: 29.1; sql-sqlite prompt-cont-regexp incompatible since sqlite 3.41.0
Date: Tue, 7 Nov 2023 11:20:18 +0100

The continuation prompt regexp for sql.el's sqlite product is hard coded as "   ...> ":
http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/sql.el?id=a1abb6a85e6605c256595b8d7b885018e5421c28#n497

But since SQLite version 3.41.0 this prompt is no longer static but dynamic
and contains information about current context (unclosed string, parentheses, etc.):
https://www.sqlite.org/releaselog/3_41_0.html

For example, sending a multi-line query with an unclosed string like:

  SELECT 1
  AS "two lines
  ";

will give an output like:

  SQLite version 3.44.0 2023-11-01 11:23:50
  Enter ".help" for usage hints.
  sqlite>
  "  ...> ┌───────────┐
  │ two lines │
  ├───────────┤
  │ 1         │
  └───────────┘
  Run Time: real 0.000 user 0.000118 sys 0.000076

because the continuation prompt is '"  ...> '.

Setting a custom sqlite continuation prompt regexp to match the dynamic prompt
fixes this:

  (sql-set-product-feature 'sqlite :prompt-cont-regexp "^...\\.\\.\\.> ")

I suggest updating the regexp in sql.el to this (or some more specific)
regexp.

Thanks!
--
Gustav

reply via email to

[Prev in Thread] Current Thread [Next in Thread]