Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport Updating Individual Array Elements #1681
Comments
sgrif
added
the
enhancement
label
May 4, 2018
This comment has been minimized.
|
This is a reasonable feature request, but isn't likely to get added in the near future. I'd recommend using |
This comment has been minimized.
philip-alldredge
commented
May 4, 2018
|
Okay. Thanks! It's only a minor inconvenience. Everything else works great. |
This comment has been minimized.
|
Glad to hear it. |
This comment has been minimized.
|
I actually don't think this would be super hard to implement if someone were interested in tackling it (being able to select a single element of an array would be a good first step). I think this might make sense as an issue for @galuhsahid or @yamishi13 in a few weeks. |
This comment has been minimized.
|
Just to write it somewhere: |
This comment has been minimized.
|
@weiznich We cannot safely implement |
philip-alldredge commentedMay 4, 2018
Problem Description
As far as I am aware, Diesel does not provide a mechanism for referencing individual array elements inside of the SQL queries.
What are you trying to accomplish?
Updating a single element in an array column when working with a Postgres database. I'd like to generate a query like:
Using syntax like:
update(table_with_array.set(my_array.index(1).eq(5.0)).execute(db_connection);