Skip to content

Document passing arrays as an argument to PostgresΒ #61

@piranha

Description

@piranha

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. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions