From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Estival Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: package submission : ob-sql-session Date: Wed, 18 Sep 2024 03:41:23 +0200 Message-ID: <3a694658-9184-4c45-ac17-6e6083a21517@7d.nz> References: <1a69c5fb-4069-45c8-b37b-4d54ef88b92d@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3778"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org, Org Mode List To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 18 03:43:08 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sqjim-0000mg-3M for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Sep 2024 03:43:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqjhn-0006Ls-J5; Tue, 17 Sep 2024 21:42:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqjhl-0006LF-93 for emacs-devel@gnu.org; Tue, 17 Sep 2024 21:42:05 -0400 Original-Received: from smtp-42ad.mail.infomaniak.ch ([84.16.66.173]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqjhi-0007jF-TG for emacs-devel@gnu.org; Tue, 17 Sep 2024 21:42:05 -0400 Original-Received: from smtp-3-0001.mail.infomaniak.ch (smtp-3-0001.mail.infomaniak.ch [10.4.36.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4X7hGH2c6wzdFy; Wed, 18 Sep 2024 03:41:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=7d.nz; s=20240212; t=1726623719; bh=dRlWzM6I/EBtTLWNrNSeTInVIcH0cjIJ3xfnSYkyr4Q=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=n8toFFYmTXQR/DN77TF3w/zS1e+MwhPIUL7rLFx8VhL7ZPzEZGolxaSJuMtKHtOhg gPuA/K9ZeIHb5W0P2y9I+JRMGmOwStUlWD0DwOG93ttAE4HZL9NmlFI/pXEPuu6VF3 utDU+XHlPTc102brbe0qp9kN3FjauV7jDLl5Uvjm/hhAydMJXX9nrMBOPBX19aeGUW K1Ak6A8YbZGVhalkEQDk3X3hpgg0k/D6ckGyN7SMWS6IGIA5SY7KSguEYQtRe0eBOo +bAaxkFyrsEpjIQq6o/dN7Y4aMinlXhM3lG8l6APhg3aUIQ8HqlEda0At5B6Rain+p PzasaBsN3tu6w== Original-Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4X7hGG69gWzRsv; Wed, 18 Sep 2024 03:41:58 +0200 (CEST) Content-Language: fr, en-ZA In-Reply-To: <1a69c5fb-4069-45c8-b37b-4d54ef88b92d@alphapapa.net> X-Infomaniak-Routing: alpha Received-SPF: pass client-ip=84.16.66.173; envelope-from=pe@7d.nz; helo=smtp-42ad.mail.infomaniak.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323708 gmane.emacs.orgmode:163346 Archived-At: Hi Adam, * [2024-09-18 00:25] Adam Porter: > > Hi Phil, > > On 9/17/24 05:00, Phil Estival wrote: > >>> Also, for org-sql-session (which sounds very useful), it would be good >>> to compare and contrast it with the package it's meant to supersede. >> >> The following comparison was added to the readme file. >> >> ob-sql-mode : >> - is very simple : forward the sql source through `sql-redirect' >> - has a test suite >> - but gives clunky output >> - no :results table >> - sql client shell commands messes up output >> - prompt again for connection parameters when restarting a session >> >> ob-sql-session : >> - handle large results >> - has :results tables >> - accept header variables (:var) >> - accept sql client shell commands >> - keep login parameters >> - prompt only for blank connection parameters >> - can use `with-environment-variables' >> - provide some more tests >> >>> since it's meant to integrate with org-babel, it might be good to >>> discuss its inclusion on the Org mailing list also. > To be clear, this makes 3 implementations of SQL support for Org Babel > that I know of: > > 1. The built-in Org Babel SQL support, aka ob-sql, documented at > > > 2. ob-sql-mode, hosted at , > which advertises itself as "an alternative backend for Org-Babel SQL SRC > blocks that uses sql-mode to evaluate the query instead of Org-Babel's > built-in SQL backends." > > 3. Your new ob-sql-session library. > > You've mentioned how your library compares to ob-sql-mode, but how does > it compare to the built-in ob-sql library? > Here is a comparison with ob-sql-mode ob-sql-session exists is for session support, which is in the TODOs of ob-sql. - ob-sql command execution relies on org-babel-eval (→ process-file → call-process). - ob-sql-session runs an inferior process (in which sqli-interactive-mode can be activated when needed). The process output is filtered (e.g. results and prompts). When a session is demanded, this shell stays open for further commands and can keep a state (typically, when given special SQL commands). |-----------+----------------------------+----------------------------| | | ob-sql | ob-sql-session | |-----------+----------------------------+----------------------------| | Feat. | - cmdline | - support for sessions | | | - colnames as header arg | - optionnal colnames | |-----------+----------------------------+----------------------------| | TODO | | | |-----------+----------------------------+----------------------------| | | - support for sessions | - colnames as header arg | | | - support for more engines | - support for more engines | |-----------+----------------------------+----------------------------| | engines | | | | supported | | | |-----------+----------------------------+----------------------------| | | - mysql | - Postgresql | | | - dbi | - sqlite | | | - mssql | | | | - sqsh | | | | - postgresql | | | | - oracle | | | | - vertica | | | | - saphana | | |-----------+----------------------------+----------------------------| ob-sql-session adapts sql-connect of sql.el by declaring ob-sql-connect, in order to prompt only for missing connection parameters. - ob-sql defines org-babel-sql-dbstring-[engine] to be provided on a shell command line. - likewise, ob-sql-session has to define - a connection string, - the prompt, - and the terminal command prefix for a every supported SQL client shell (or "engines") - ob-sql-session requires sql.el. With the above defined, it should be compatible with most database of the sql.el's zoo. maybe. Phil