From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IJbQBcqYl2CS7QAAgWs5BA (envelope-from ) for ; Sun, 09 May 2021 10:09:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KK1gAcqYl2B3YgAAbx9fmQ (envelope-from ) for ; Sun, 09 May 2021 08:09:46 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0064F22CD4 for ; Sun, 9 May 2021 10:09:44 +0200 (CEST) Received: from localhost ([::1]:59110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfeVR-0006S1-ON for larch@yhetil.org; Sun, 09 May 2021 04:09:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfeTk-0005qI-6Y for emacs-orgmode@gnu.org; Sun, 09 May 2021 04:07:56 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:48081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfeTi-0004d5-3o for emacs-orgmode@gnu.org; Sun, 09 May 2021 04:07:55 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 27F5418D5 for ; Sun, 9 May 2021 04:07:51 -0400 (EDT) Received: from imap11 ([10.202.2.61]) by compute6.internal (MEProxy); Sun, 09 May 2021 04:07:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unanue.mx; h= mime-version:message-id:date:from:to:subject:content-type; s= fm2; bh=z5DtjewSP7OIuPuzAMQX75+ngb/f0DZng+xUaCtskxs=; b=cNawKjdF lN7si3jOdtjNDgOElIm7Ya6W6+TXymSQTvv3kwnL1T9p8enCwVTBkZ67Eb2rSUht a8OfWLyfxRIGsY8eO1fSeGfN3PuhIwplCLjYQbZafkPB9jP80dnp5uN8XmO9Fbfj JO6yzlJ+VZfuCMQHTWWPDn9v4AF2M+74dxtxl/JYdmK9/QHn/4sBZ3HXtldiUnxn miJrl8xGYHOqJFPjRsLQ6XLMPKBxvyFtVQqU9GArfEjVJrlCZED/2lAJQNLPSOp8 S+AIq0oyVD9s7NNks5h1fK/ede8agoxHcetFfSeA7v1cHEi96ip0F3+TanLKToVY j5aRKoE3ryVhGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=z5DtjewSP7OIuPuzAMQX75+ngb/f0 DZng+xUaCtskxs=; b=s3mgJ1DoXsR2InJWURh44NRI2E3ByonpW3nz89uOzboAx nGpSXwv2bJk+7rvSZe79ZXVTrsXxcpofOmD/YAiDSwOlQJdsan9RM+FJRuZfv/fs SxFyeGpsdK4cCXLY2gDyx54TKH8BhjyETl1hUYpU0NSPvmD1+daao+gY8P6gfiwt 5a31Tne2cjI058usX5+QrlN7JU7nD4DN7OXQQZQXcsjVQbSkorRFNI75EpM0tar+ I99EdVxfXAmyxDOnmqRnsig2L+3SpDE5r62QOjvdB6TGxSmSUCXjgXyIP1jKTouj t9p8aEwoPJlZ2fqPtwVbnGlOgoMUppZGLKeue5iUA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdegiedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsegrtderre erredtnecuhfhrohhmpedfteguohhlfhhoucffvgcufghnrghnuhgvfdcuoegrugholhhf ohdoohhrghesuhhnrghnuhgvrdhmgieqnecuggftrfgrthhtvghrnhepheeutdekiefhte ekjeekueevfeeffffhfedukeduheejieevhefhgfekgeehuddtnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprgguohhlfhhoodhorhhgsehunh grnhhuvgdrmhig X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6E48324009B; Sun, 9 May 2021 04:07:50 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-Id: <3d3611c4-17a6-4d55-875b-f566c28d297b@www.fastmail.com> Date: Sun, 09 May 2021 03:07:29 -0500 From: "Adolfo De Unanue" To: emacs-orgmode@gnu.org Subject: ob-sql is not finding psql when using direnv+guix Content-Type: multipart/alternative; boundary=76df4cea91c347d4bf64029c6d90fab6 Received-SPF: pass client-ip=64.147.123.25; envelope-from=adolfo+org@unanue.mx; helo=wout2-smtp.messagingengine.com 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620547785; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=z5DtjewSP7OIuPuzAMQX75+ngb/f0DZng+xUaCtskxs=; b=W+A5d7+aQ6DDog+Q3HT2NIrWVR5o0/upIGOKA2HUDe7e7NkLyYYIFp+Rqcf46xdBeknmvq sGI1vJvJz0x+WT7qDs8G1O5kF8t7gkjG66EpD26gFfNiae4AuzzPilZHs+NQy1/rTzbK0a Y8r/v8+dLgBPtRU5AIYSGSBV0wkMqfXe5f6tEbeGdRr9oVCjRaOOiI0dTRd/iD50WREIHH BmXPOkQDFZNMxxdKw7H7SS2e/MwunX2yY92662zWFGLCZ8FAilth7Um5I3768gtp0VQWQP yfMnSQQ8cK7HUQvug+iQV4igG115XKJ+CQyaE3boOc16FNfTtljzktcXFTldkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620547785; a=rsa-sha256; cv=none; b=K8MnpvgGypImLakuhebL6QYKwhsHbkqTbz4J4L8GkgAtDctCcqTxfZs1mr0JLWXwaxHYS1 PoNsPk3eJz7bE6TSQD1/4JYM1KwORVmqPVF6J8zuDGQ4WKcNZooa/VcExsHnKBMjD/Qd4K VmaSYlrhN7kgg1ewuxKDzy+4agoK62iuIQI8dclFlnVqgilPA9XTtPV8MCdyHLNGVcYTfZ oU/hguw/FeUUTuJPLfmag/wiuMPPiDX6AEkOHsHzHIjbYAarPq7KxYI5EDvvD8h6zyStgG MIhX40MaNRxACL/dLNTmk9d/z1Q4noS9X0VJsU82i8ErPN9U4YzN3Ip6YpJp4Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=unanue.mx header.s=fm2 header.b=cNawKjdF; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=s3mgJ1Do; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.64 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=unanue.mx header.s=fm2 header.b=cNawKjdF; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=s3mgJ1Do; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 0064F22CD4 X-Spam-Score: -1.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: tHRSNmm/pQRH --76df4cea91c347d4bf64029c6d90fab6 Content-Type: text/plain Hi I am using Guix with direnv. In an specific folder I am installing and using psql and postgresql using direnv+guix as follows: use guix --manifest=cdpp-manifest.scm export PGUSER=food_user export PGPASSWORD=some_password export PGDATABASE=food layout postgres Where cdpp-manifest.scm contains the following: (specifications->manifest '("python" "python-pandas" "python-numpy" "python-flask" "python-graphene" "postgresql" "jupyter")) I am able to use sql-mode and run queries against the database, in order to achieve that I am using the following .dir-locals.el ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") ((nil . ((projectile-project-test-cmd . "pytest --color=no --failed-first --maxfail=5"))) (python-mode . ((python-shell-buffer-name . "Python [CDPP-Inspecciones]"))) (org-mode . ( (indent-tabs-mode . nil) (org-src-preserve-indentation . t) (org-footnote-auto-adjust . t) (org-footnote-auto-label . t) (ispell-local-dictionary . "spanish") (org-export-allow-bind-keywords . t) (org-footnote-define-inline . nil) (org-footnote-section . "Footnotes"))) (sql-mode . ((sql-connection-alist . ((mydb (sql-product 'postgres) (sql-database "mydb") (sql-user "db_user") (sql-server (expand-file-name ".direnv/postgres")) (sql-port 5432) ) ))))) But If I try to use an sql org-babel block #+begin_src sql select 1; #+end_src (I am setting the connection variables in a PROPERTY) I get the error: `psql is not found` I was reading about the variable sql-postgres-program, so if I set the following in dir-locals.el (sql-postgres-program . "/gnu/store/f2v92bkx2vfzmkl14qxj3hlmby4dy9x0-profile/bin/psql") It works (note that psql ONLY lives inside the profile defined by direnv+guix), but I don't like the idea of hardcode the path. Is there a better way? Ideally I will expect that the org block will read it from the environment, but is not working. Thanks in advance --76df4cea91c347d4bf64029c6d90fab6 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Hi

I am using Guix with direnv. In an specific folder= I am installing and using psql and postgresql using direnv+guix as foll= ows:


use guix --manifest=3Dc= dpp-manifest.scm

export PGUSER=3Dfood_user<= br>
export PGPASSWORD=3Dsome_password
export PGD= ATABASE=3Dfood

layout postgres


Where cdpp-manifest.scm contains the fol= lowing:

(specifications->manifest
'("python"
   "python-pandas"
<= div>   "python-numpy"
   "python-flask= "
   "python-graphene"
  = ; "postgresql"
   "jupyter"))

I am able to use sql-mode and run queries against = the database, in order to achieve that I am using the following .dir-loc= als.el

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables"= )


((nil .
&nbs= p;     ((projectile-project-test-cmd . "pytest --col= or=3Dno --failed-first --maxfail=3D5")))
(python-mode .
          =     ((python-shell-buffer-name . "Python [CDPP-Inspeccion= es]")))

(org-mode . (
 &= nbsp;            = (indent-tabs-mode . nil)
     &nb= sp;        (org-src-preserve-indentat= ion . t)
        &= nbsp;     (org-footnote-auto-adjust . t)
           &nb= sp;  (org-footnote-auto-label . t)
   =            (ispell-loc= al-dictionary . "spanish")
     &= nbsp;        (org-export-allow-bind-k= eywords . t)
       &nb= sp;      (org-footnote-define-inline . nil)
=
          &= nbsp;   (org-footnote-section . "Footnotes")))
<= br>
(sql-mode . ((sql-connection-alist . ((mydb
=             =             =             =     (sql-product 'postgres)
  &nb= sp;           &nb= sp;           &nb= sp;           &nb= sp; (sql-database "mydb")
     &n= bsp;           &n= bsp;           &n= bsp;          (sql-user "db= _user")
        &n= bsp;           &n= bsp;           &n= bsp;       (sql-server (expand-file-name "= .direnv/postgres"))
      &n= bsp;           &n= bsp;           &n= bsp;         (sql-port 5432)
=
          &= nbsp;           &= nbsp;           &= nbsp;     )
    &n= bsp;           &n= bsp;           &n= bsp;         )))))

But If I try to use an sql org-babel block

#+begin_src sql
select 1;
#+end_= src

(I am setting the connection variables in a= PROPERTY)

I get the error: `psql is not fo= und`


I was reading about the= variable sql-postgres-program, so if I set the following in dir-locals.= el

(sql-postgres-program . "/gnu/store/f2v9= 2bkx2vfzmkl14qxj3hlmby4dy9x0-profile/bin/psql")

=
It works (note that psql ONLY lives inside the profile defined by d= irenv+guix), but I don't like the idea of hardcode the path.
<= br>
Is there a better way?

Ideall= y I will expect that the org block will read it from the environment, bu= t is not working. 

Thanks in advance
--76df4cea91c347d4bf64029c6d90fab6--