Skip to content

Support for array placeholders #397

Closed as not planned
Closed as not planned

Description

Activity

  1. flavorjones commented on Sep 3, 2023

    @flavorjones
    Member

    Unfortunately, the sqlite database API does not support binding arrays to a prepared statement: https://www.sqlite.org/c3ref/bind_blob.html

    I want to suggest that you assemble the query string based on the arguments -- the suggested implementation in SO seems reasonable.

    Or, you may want to look into an ORM that is a bit higher-level and will provide support for more complex queries.

  2. forthrin commented on Sep 3, 2023

    @forthrin
    Author

    Oh, so the limitation is there. Have you (or anyone) requested this from Dwayne? What is their position on the matter?

  3. flavorjones commented on Sep 3, 2023

    @flavorjones
    Member

    @forthrin I don't know of any SQL database that supports such a feature. I briefly looked at postgresql and mysql docs and they have similar APIs.

    If this is something you're interested in pursuing, I'd recommend you bring it up with the upstream projects.

  4. forthrin commented on Sep 3, 2023

    @forthrin
    Author

    Kind of you to do a round trip. I truly support developer restraint to prevent software bloat, but it would be interesting to know why it's not considered important enough, particularly since it paves the way for malicious injection.

    The thing that comes to mind is that in/exclusion in a SQL paradigm is most commonly done by joining against other tables, and checking against lists inserted from code might be considered "unclean".

    Also, if exclusions are one per row, they can just as well be done in code afterwards, but obviously exclusions that hit many rows per entry would be very ineffective that way.

    I'll consider posting a request on the SQLite forum, referring to this posting.

  5. locked and limited conversation to collaborators on Sep 4, 2023
  6. converted this issue into a discussion #398 on Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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