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

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

Re: sql and auth-source


From: Robert
Subject: Re: sql and auth-source
Date: Fri, 27 Nov 2020 06:52:13 +0000

The ideal solution will include:
- no passwords in init.el
- I connect to the database using sql-connect or sql-postgres (usually 
PostgreSQL)
- when connecting, I choose an alias to the database
- I am only asked to enter a password in order to decrypt the authinfo wallet 
file

--
Robert

Sent from ProtonMail, encrypted email based in Switzerland.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, November 27, 2020 2:58 AM, Jean Louis <bugs@gnu.support> wrote:

> * Robert via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org 
> [2020-11-26 18:20]:
>
> > Hello,
> > how to configure the sql mode to work with a wallet file?
>
> > A code example would be very helpful.
> > I found function sql-auth-source-search-wallet, but i don't know how to use 
> > it.
> > https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/sql.el#n736
>
> What you configure is .authinfo then how I understand, the sql-mode
> would search for user/password and server datails in .authinfo by
> using that function. Unless you are programming you need not use that
> function. And function is prefixed sql- only because it belongs to sql
> mode, not that it is doing any SQL itself.
>
> I have not configured authinfo as I mostly work with local database.
>
> Instead I have configured environment variables:
>
> export PGDATABASE="databasename"
> export PGUSER='username'
> export PGCLIENTENCODING='UTF8'
>
> You better say what you wish to achieve, do you wish to remember
> credentials for remote databases?
>
> File ~/.authinfo is in format:
>
> host localhost port port-number user user-ID password password





reply via email to

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