I have quite a few SQL org-babel functions for fetching various(single record) IDs from the database.
The snippet below works, but is there any way to skip that middle function that converts SQL result to a simple string? My goal here is to DRY this org-mode/org-babel file.
#+name: raw-sql-token
#+BEGIN_SRC sql :results value
SELECT 123 AS token
#+END_SRC
#+name: sql-token
#+BEGIN_SRC sql :var input=raw-sql-token :results value
(print (nth 0(nth 0 input)))
#+END_SRC
#+HEADER: :var id=sql-token
#+BEGIN_SRC http :pretty
GET http://localhost:3000/api/items/${id}
#+END_SRC