ruricolist / cl-yesql

Common Lisp library for using SQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement #'DOCUMENTATION entries for CL-YESQL functions

phoe opened this issue · comments

I hereby request a feature where, given CL-YESQL code,

-- name: users-by-country @rows
-- Counts the users in a given country.
SELECT count(*) AS count
FROM user
WHERE country_code = :country_code

evaluating

(documentation 'create-table-player 'function)

returns "Counts the users in a given country."

Please make it work for multiline comments as well.

This is mostly supported now in the dev branch. Only mostly supported, because it works on SBCL but not on Clozure -- Clozure seems to discard the docstrings of lambdas. I might have to look into fixing that in Clozure itself.

I can see multiline docstrings as required in SBCL.

GATEWAY/SQL> (describe 'select-players-by-display-name)
GATEWAY/SQL:SELECT-PLAYERS-BY-DISPLAY-NAME
  [symbol]

SELECT-PLAYERS-BY-DISPLAY-NAME names a compiled function:
  Lambda-list: (CL-YESQL/STATEMENT::?0 &KEY
                (CL-YESQL-USER::LIMIT
                 (REQUIRED-ARGUMENT 'CL-YESQL-USER::LIMIT)))
  Derived type: (FUNCTION (T &KEY (:LIMIT T)) *)
  Documentation:
    Selects an ordered list of players whose display name is similar to the argument.
    At most :LIMIT players are returned.
  Inline proclamation: NOTINLINE (no inline expansion available)
  Source file: /home/phoe/Projects/Lisp/Gateway/src/sql/yesql/player.sql