artanis
[Top][All Lists]
Advanced

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

VARCHAR comes out of Postgres without quotes


From: Mortimer Cladwell
Subject: VARCHAR comes out of Postgres without quotes
Date: Sun, 8 Mar 2020 09:54:26 -0400

Hi,
Working with Artanis 0.4.1 which is dated later than the message at https://lists.gnu.org/archive/html/artanis/2019-10/msg00001.html

My Project table in postgres look like:

id | project_sys_name |                  descr                   |     project_name     | lnsession_id |            updated            
----+------------------+------------------------------------------+----------------------+--------------+-------------------------------
  1 | PRJ-1            | 3 plate sets with 2 96 well plates each  | With AR, HL          |            1 | 2020-02-28 06:12:51.679321-05
  2 | PRJ-2            | 1 plate set with 2 384 well plates each  | With AR              |            1 | 2020-02-28 06:12:51.679321-05
  3 | PRJ-3            | 1 plate set with 1 1536 well plate       | With AR              |            1 | 2020-02-28 06:12:51.679321-05

I follow your example and set up the scheme code:

(use-modules (artanis artanis))
(init-server)

(get "/dbtest" #:conn #t ; apply for a DB connection from pool
     (lambda (rc)
       (let ((mtable (map-table-from-DB (:conn rc))))
         (object->string
 (mtable 'get 'project #:columns '(project_name descr))
 ))))

(run #:use-db? #t #:dbd 'postgresql #:db-username "ln_admin"
     #:db-name "lndb" #:db-addr "127.0.0.1:6432" #:db-passwd "xxxxxxx"  #:port 3000)

I see in the browser:

(((project_name . With AR, HL) (descr . 3 plate sets with 2 96 well plates each)) ((project_name . With AR) (descr . 1 plate set with 2 384 well plates each)) ((project_name . With AR) (descr . 1 plate set with 1 1536 well plate)))

Looks OK except no quotes.  If I try (cdr (descr . 3 plate sets with 2 96 well plates each)) I get an error like "missing parentheses" but the real problem is no quotes around results elements. Any suggestions?
Thanks
Mortimer

reply via email to

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