From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Re: sql.el MariaDB support Date: Sun, 10 Jun 2018 20:26:49 -0400 Message-ID: References: <874ligy5mh.fsf@cochranmail.com> <83y3fsvudp.fsf@gnu.org> <874lifm172.fsf@cochranmail.com> Reply-To: Michael Mauger NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1528682807 14069 195.159.176.226 (11 Jun 2018 02:06:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2018 02:06:47 +0000 (UTC) Cc: Eli Zaretskii , "emacs-devel\\@gnu.org" To: Robert Cochran Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 11 04:06:42 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSCED-0003Zf-Ow for ged-emacs-devel@m.gmane.org; Mon, 11 Jun 2018 04:06:41 +0200 Original-Received: from localhost ([::1]:45996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSCGK-0001xJ-Tj for ged-emacs-devel@m.gmane.org; Sun, 10 Jun 2018 22:08:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSAfz-0004GQ-2R for emacs-devel@gnu.org; Sun, 10 Jun 2018 20:27:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSAfx-0007AC-Hc for emacs-devel@gnu.org; Sun, 10 Jun 2018 20:27:15 -0400 Original-Received: from mail4.protonmail.ch ([185.70.40.27]:46138) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSAft-00074s-Sd; Sun, 10 Jun 2018 20:27:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1528676816; bh=/hqrYvaQtJvbMS1CGuoPmse5cSLfPdeBMW6CXEepu/A=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=GhTQAdX6ZOHQQqOCwTaPato4cv5N7azTmRgnoYdjR/ujqw0yjOekL+0LQVe5JTLo/ +XHv0W9H6PC/gF1sL7f7siPIpNYgUm+jJC/3jUmqMH1Ax0b19zD9VzE8W5ngTvWCWt 8fSZrVrrG47ppM9wcsbjYnPkkvCIaJB7bMvykl7c= In-Reply-To: <874lifm172.fsf@cochranmail.com> Feedback-ID: b6CpL0MxcIA6fpHRkn3ZHzWS0Hoqxbtv_SrHfEzC9D85cLvnRsVk4rKaAOJUw48iy20W0W1VX4whjBYFluIX0w==:Ext:ProtonMail X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 185.70.40.27 X-Mailman-Approved-At: Sun, 10 Jun 2018 22:08:47 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226179 Archived-At: On June 7, 2018 4:48 AM, Robert Cochran wrot= e: > =E2=80=8B=E2=80=8B > ... I made a copy of the MySQL entry and > modified it to fit MariaDB. I then made most all of the MariaDB > variables defvaralias-es of the MySQL ones. `sql-comint-mariadb' just cal= ls into`sql-comint-mysql'.=20 > MariaDB is almost no different than MySQL except for the prompt. >=20 I had to move the mariadb defvaraliases before the mysql defvar because tha= t is the order expected.=20 > So my first attempt is attached below. Doubtless I've done at least a > handful of things wrong, but I can just fix them as we go. >=20 > A couple of things I've been thinking about that might be wrong/need > changing: >=20 > 1. Should we try to support a configuration where the MariaDB and MySQL > configuration options differ (aka making MariaDB variables not mere > aliases for the MySQL ones)? Simple-minded me thinks not, that there > wouldn't really be a point in doing that since MariaDB is supposed to= be > able to drop-in replace MySQL. But I'm asking anyways. > =20 This is obviously the potential gotcha here, but if you are flipping betwee= n the two, you have enough other problems that I don't think Emacs will be you biggest= . :) > 2. Will it be problematic that the MariaDB entry doesn't have a > :prompt-length? The MariaDB prompt contains the current database, so > there's no real knowing ahead of time how long the prompt will > be. Looking at how it's used, it appears that query text on continuat= ion > lines will be messed up. Maybe it would be close enough to have > :prompt-length be (length "MariaDB []> ") - everything except the > database name? >=20 That's a hold-over from the original and I'm not sure it has any impact tod= ay. Let me know if you have any problems... > 3) To that end, is it okay that my regexp for matching the database name > is pretty loose? I figured on the first pass that being a little > generous with the match criterion is acceptable, but I wouldn't be > surprised if that wasn't good enough for a final solution. >=20 Keeping it loose is okay, anchoring it to the start of the line thru the ">= " text is really all that's needed. > Well, here goes. Hopefully this won't need tons of rework cycles. >=20 I had to rearrange the declarations a bit and correct a couple of spelling/= cut-n-paste=20 issues, but it looks fine. I went ahead and committed the code and gave you= credit. > > I'd also encourage you to update the shared font-lock settings to get i= t > > up-to-date with the latest features. It's been a very long time since I= used > > MySQL so there is some bit-rot there. >=20 > I'm probably not your guy on this one. I'm avery casual user, so I'd > honestly have no idea where to even start with that. Sorry. :( >=20 I took care of this. Basically the font-lock variables have long lists of k= eywords,=20 functions, and data types that are converted at build time to a massive reg= exp. I updated the lists from the MySQL and MariaDB documentation. Let me know i= f=20 you find any of the highlighting to be distracting or seeming incorrect. Wi= thout a=20 serious increase in complexity of the matching, there will always be some o= dd cases. >=20 > ~Robert Cochran Thank you very much, I greatly appreciate your contribution. Happy Hacking! =E2=80=8B--=20 MICHAEL@MAUGER.COM // FSF and EFF member // GNU Emacs sql.el maintainer= =E2=80=8B