We use gerbil, gerbil has a postgresql dbi. We interact with postgresql and gerbil.
We want to connect to a database. We want to use an external file to store password information. Pgpass to the rescue! See here for details.
(import :drewc/postgresql/pgpass)
(find-password user: "foobar")
;; => "ecm- colon : backslash \\ a1sd"
In reality, we do not want to find the password every time, we want it automated. ~connect~ , using pgass!
(import :drewc/postgresql/connect)
(connect user: "ecm" port: 5434)
;; => #<postgresql-connection #30>
This is a literate program[fn:lp].
./db/postgresql*
- The code for the driver and frontend are really in db/postgresql.org.