Skip to content

FEATURE: Enable editing of "View" cell data. #1360

Closed

Description

@shaun-ba

The "View" feature is very nice, giving the ability to sort multiple columns at the same time etc. However, (for me) this is rendered completely useless when you can't edit the cells.

Any plans to add this ability?

I'm opening this issue because:

DB4S needs a feature

I'm using DB4S on:

Linux: ( Ubuntu )

I'm using DB4S version:

3.10.1

Activity

  1. chrisjlocke commented on Mar 30, 2018

    @chrisjlocke
    Member

    If you use one of the nightly versions of DB4S, then editing via views is possible.
    #141 (comment)

    This means you have to enable editing for a view by browsing it, right clicking on the column headers, and clicking "Unlock view editing". You'll then be asked for the name of a unique column in that view. That's because we somehow have to decide how to address rows in the view and there doesn't seem to be any good way to find out a suitable column automatically.

  2. shaun-ba commented on Mar 30, 2018

    @shaun-ba
    Author

    @chrisjlocke I'm now using "Version 3.10.99 (Mar 28 2018)"

    I still don't see the ability to edit the view?

  3. chrisjlocke commented on Mar 30, 2018

    @chrisjlocke
    Member

    So no 'unlock' menu option?

    image

    What options do you get when you right click the column headings in the 'browse data' tab? (and selecting a view, rather than a table...)

  4. shaun-ba commented on Mar 30, 2018

    @shaun-ba
    Author

    Hi, I see this option yes, but would never guess to right click the column heading in view! Not sure why there is even a need for this option to be honest.

  5. chrisjlocke commented on Mar 30, 2018

    @chrisjlocke
    Member

    As per the comment posted above (which gave instructions to click the header).
    Its work in progress. We're working on it. Its test code. Testing. Editing views isn't easy due to the natuire of how views work. So yes, it needs an option for the time being.

  6. shaun-ba commented on Mar 30, 2018

    @shaun-ba
    Author

    Perfect, it works so thanks!

  7. shaun-ba commented on Mar 30, 2018

    @shaun-ba
    Author

    Just to add to this feature, I can't add a new record so still can't use it for intended purpose.

    If you remember from an old issue you helped me on, I want to be able to view and edit the DB whilst sorting via 2 columns, this is the overall aim here.

  8. chrisjlocke commented on Mar 30, 2018

    @chrisjlocke
    Member

    Yes, a view (by it's name) is read only as it pulls it's data from multiple tables, so you can't add a row to it, as the data would exist in more than one table.

    Add a record to the tables, and the view is updated automatically.

  9. chrisjlocke commented on Apr 12, 2018

    @chrisjlocke
    Member

    I'll close this as the original query has been answered. Feel free to re-open it, add to it or open another query if you feel it hasn't been answered.

  10. shaun-ba commented on Oct 12, 2018

    @shaun-ba
    Author

    @chrisjlocke @mgrojo Then please re-open my feature request, clearly it is a valid request to expand on the sorting features of data when editing.

  11. chrisjlocke commented on Oct 12, 2018

    @chrisjlocke
    Member

    An existing issue relating to editing views is already open. #141. See the second comment above.

  12. shaun-ba commented on Oct 12, 2018

    @shaun-ba
    Author

    @chrisjlocke Yes but it doesn't sort, so ok i'll reply there instead but best to be clear what you want users to do when closing threads left right and center!

  13. chrisjlocke commented on Oct 12, 2018

    @chrisjlocke
    Member

    A view is sortable - and on multiple columns. Admittedly you have to do it via SQL, rather than clicking the column headings...

  14. shaun-ba commented on Oct 12, 2018

    @shaun-ba
    Author

    But it's not editable, so what is the point? I'll reply to the other thread because its an apparent fix that doesn't work

  15. chrisjlocke commented on Oct 12, 2018

    @chrisjlocke
    Member

    Aah, apologies. It should be editable. A fix to fix something has broken this bit... so its broke. Hopefully the fix to fix the bit that has broke won't broke something else.

  16. endlisnis commented on Nov 3, 2023

    @endlisnis

    I hate to comment on an ancient issue, but this no longer seems to work. I can enable cell editing, but actually trying to change the data results in "cannot modify [table] because it is a view"

  17. chrisjlocke commented on Nov 4, 2023

    @chrisjlocke
    Member

    And have you created the necessary triggers?

  18. endlisnis commented on Nov 4, 2023

    @endlisnis

    And have you created the necessary triggers?

    I didn't realize I needed triggers. I have a lot of software development experience, but only a small amount of SQL experience. I was hoping that Sqlite Browser would be able to edit the underlying source data when used on a view.

    Are you saying that it should work, but I'd have to write triggers that changed any attempt to update the view into changes to the original source tables?

  19. justinclift commented on Nov 4, 2023

    @justinclift
    Member

    @endlisnis Just to check, have you read through this wiki page yet? 😄

    https://github.com/sqlitebrowser/sqlitebrowser/wiki/Views#editing-data-in-a-view

  20. endlisnis commented on Nov 4, 2023

    @endlisnis

    @endlisnis Just to check, have you read through this wiki page yet? 😄

    No, I had not read that. But I just read it and I was able to get it all working with triggers. Thanks!

  21. justinclift commented on Nov 4, 2023

    @justinclift
    Member

    You're welcome. 😄

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