Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show required parameters within documentation #54

Open
mkaschenko opened this issue Oct 9, 2016 · 4 comments
Open

Show required parameters within documentation #54

mkaschenko opened this issue Oct 9, 2016 · 4 comments

Comments

@mkaschenko
Copy link

At the moment clojure.repl/doc shows documentation defined with -- :doc only.
It would be nice if function signatures are shown too like Yesql does https://github.com/krisajenkins/yesql#one-file-one-query.
I think it's handy to know which parameters are required within an sql query.

(clojure.repl/doc users-by-country)

;=> -------------------------
;=> user/users-by-country
;=> ([{:keys [country_code]}]
;=>  [{:keys [country_code]} {:keys [connection]}])
;=>
;=>   Counts the users in a given country.
@csummers
Copy link
Member

csummers commented Oct 9, 2016

I think this is a good idea for the simple case of parameters directly defined in the SQL. However, it's worth noting that HugSQL's support for Clojure Expressions and dynamic, run-time parameters make support for this only partially possible since you can essentially create parameters on-the-fly at runtime.

Also related to this, I'm thinking about how to support and use Clojure Spec in the upcoming Clojure 1.9, which includes support for function signature documentation based on the given spec.

Thanks for the request. I'll consider putting the simple case into a future release.

@mkaschenko
Copy link
Author

Thank you.

On Oct 9, 2016, at 20:47, Curtis Summers notifications@github.com wrote:

I think this is a good idea for the simple case of parameters directly defined in the SQL. However, it's worth noting that HugSQL's support for Clojure Expressions and dynamic, run-time parameters make support for this only partially possible since you can essentially create parameters on-the-fly at runtime.

Also related to this, I'm thinking about how to support and use Clojure Spec in the upcoming Clojure 1.9, which includes support for function signature documentation based on the given spec.

Thanks for the request. I'll consider putting the simple case into a future release.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@crinklywrappr
Copy link

+1

@liotev
Copy link

liotev commented Sep 16, 2020

+1
Currently this issue is the only reason I am using yesql instead of hugsql. Having the key names in the doc string is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants