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

Document passing arrays as an argument to Postgres #61

Open
piranha opened this issue Feb 6, 2021 · 1 comment
Open

Document passing arrays as an argument to Postgres #61

piranha opened this issue Feb 6, 2021 · 1 comment

Comments

@piranha
Copy link

piranha commented Feb 6, 2021

Hey! It's a topic I struggle from time to time to the point where I've asked and answered myself on Clojureverse recently. Mainly because it's not documented anywhere and if you pass (honeysql.format/value [1 2]) it formats as a few arguments:

user> (honeysql.core/format {:select [(honeysql.format/value [1 2])]})
["SELECT (?, ?)" 1 2]

So I wonder if it makes sense to document PostgreSQL-specific array behavior (maybe just in README or something, so people at least can stumble upon it):

user> (honeysql.core/format {:select [(into-array [1 2])]})
["SELECT ?" [1, 2]]

This way you can pass arrays with many items without exhausting SQL query argument count. :)

@kitallis
Copy link
Contributor

Thanks @piranha, that makes sense. Will incorporate this into the README soon.

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

2 participants