将 org src dbpassword header 隐藏到其他地方
Hide org src dbpassword header to other place
我正在使用 "Practical SQL"
通过 postgres 学习
#+begin_src sql :engine postgresql :dbuser org :dbpassword 1618 :database analysis
select * from teachers
order by hire_date desc
limit 3;
#+end_src
#+RESULTS:
| id | first_name | last_name | school | hire_date | salary |
|----+------------+-----------+---------------------+------------+--------|
| 1 | Janet | Smith | F.D. Roosevelt HS | 2011-10-30 | 36200 |
| 4 | Samantha | Bush | Myers Middle School | 2011-10-30 | 36200 |
| 6 | Kathleen | Roush | F.D. Roosevelt HS | 2010-10-22 | 38500 |
对 :dbpassword 的 header 的引用,
是否可以将其保存在文件的 header 等其他位置,以避免在 src 中将其暴露为 header?
您应该可以使用 :dbpassword (read-passwd "Password: ")
。 (...)
只是普通的 Emacs Lisp 代码,您可以随意使用其他代码。
我正在使用 "Practical SQL"
通过 postgres 学习#+begin_src sql :engine postgresql :dbuser org :dbpassword 1618 :database analysis
select * from teachers
order by hire_date desc
limit 3;
#+end_src
#+RESULTS:
| id | first_name | last_name | school | hire_date | salary |
|----+------------+-----------+---------------------+------------+--------|
| 1 | Janet | Smith | F.D. Roosevelt HS | 2011-10-30 | 36200 |
| 4 | Samantha | Bush | Myers Middle School | 2011-10-30 | 36200 |
| 6 | Kathleen | Roush | F.D. Roosevelt HS | 2010-10-22 | 38500 |
对 :dbpassword 的 header 的引用,
是否可以将其保存在文件的 header 等其他位置,以避免在 src 中将其暴露为 header?
您应该可以使用 :dbpassword (read-passwd "Password: ")
。 (...)
只是普通的 Emacs Lisp 代码,您可以随意使用其他代码。