You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FEATURE: Enable editing of "View" cell data. #1360
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.
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.
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.
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.
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.
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.
@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!
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.
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"
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?
Activity
chrisjlocke commentedon Mar 30, 2018
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.shaun-ba commentedon Mar 30, 2018
@chrisjlocke I'm now using "Version 3.10.99 (Mar 28 2018)"
I still don't see the ability to edit the view?
chrisjlocke commentedon Mar 30, 2018
So no 'unlock' menu option?
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...)
shaun-ba commentedon Mar 30, 2018
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.
chrisjlocke commentedon Mar 30, 2018
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.
shaun-ba commentedon Mar 30, 2018
Perfect, it works so thanks!
shaun-ba commentedon Mar 30, 2018
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.
chrisjlocke commentedon Mar 30, 2018
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.
chrisjlocke commentedon Apr 12, 2018
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.
shaun-ba commentedon Oct 12, 2018
@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.
chrisjlocke commentedon Oct 12, 2018
An existing issue relating to editing views is already open. #141. See the second comment above.
shaun-ba commentedon Oct 12, 2018
@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!
chrisjlocke commentedon Oct 12, 2018
A view is sortable - and on multiple columns. Admittedly you have to do it via SQL, rather than clicking the column headings...
shaun-ba commentedon Oct 12, 2018
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
chrisjlocke commentedon Oct 12, 2018
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.
endlisnis commentedon Nov 3, 2023
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"
chrisjlocke commentedon Nov 4, 2023
And have you created the necessary triggers?
endlisnis commentedon Nov 4, 2023
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?
justinclift commentedon Nov 4, 2023
@endlisnis Just to check, have you read through this wiki page yet? 😄
https://github.com/sqlitebrowser/sqlitebrowser/wiki/Views#editing-data-in-a-view
endlisnis commentedon Nov 4, 2023
No, I had not read that. But I just read it and I was able to get it all working with triggers. Thanks!
justinclift commentedon Nov 4, 2023
You're welcome. 😄