Hi, <div><br></div><div>I propose to add new query formats:</div><div><br></div><div><div>diff --git a/doc/postmodern.html b/doc/postmodern.html</div><div>index 3691ae8..9ac466f 100644</div><div>--- a/doc/postmodern.html</div>
<div>+++ b/doc/postmodern.html</div><div>@@ -202,6 +202,10 @@</div><div> row.</td></tr></div><div> <tr><td><code>:list</code>, <code>:row</code></td><td>Return a</div>
<div> single row as a list.</td></tr></div><div>+ <tr><td><code>:plists</code></td><td>Return a list of plists which map column</div><div>+ names to values,with the names represented as</div>
<div>+ keywords.</td></tr></div><div>+ <tr><td><code>:plist</code></td><td>Return a single row as an plist.</td></tr></div><div> <tr><td><code>:alists</code></td><td>Return a list of alists which map column</div>
<div> names to values,with the names represented as</div><div> keywords.</td></tr></div><div>diff --git a/postmodern/query.lisp b/postmodern/query.lisp</div><div>index 3e5bfa5..921d03d 100644</div>
<div>--- a/postmodern/query.lisp</div><div>+++ b/postmodern/query.lisp</div><div>@@ -9,6 +9,15 @@</div><div> :for symbol :in symbols</div><div> :collect (cons symbol (next-field field))))))</div>
<div> </div><div>+;; Like symbol-alist-row-reader, but return plist</div><div>+(def-row-reader symbol-plist-row-reader (fields)</div><div>+ (let ((symbols (map 'list (lambda (desc) (from-sql-name (field-name desc))) fields)))</div>
<div>+ (loop :while (next-row)</div><div>+ :collect (loop :for field :across fields</div><div>+ :for symbol :in symbols</div><div>+ :collect symbol</div><div>+ :collect (next-field field)))))</div>
<div>+</div><div> ;; A row-reader for reading only a single column, and returning a list</div><div> ;; of single values.</div><div> (def-row-reader column-row-reader (fields)</div><div>@@ -22,6 +31,8 @@</div><div> (:list list-row-reader t)</div>
<div> (:rows list-row-reader nil)</div><div> (:row list-row-reader t)</div><div>+ (:plists symbol-plist-row-reader nil)</div><div>+ (:plist symbol-plist-row-reader t)</div><div> (:alists symbol-alist-row-reader nil)</div>
<div> (:alist symbol-alist-row-reader t)</div><div> (:str-alists alist-row-reader nil)</div><div><br></div><div><br></div><div>Moskvitin Andrey</div></div>