Bug 306960

Summary: Kexi forms based on queries should not be read-only
Product: [Applications] KEXI Reporter: Dirk Sarpe <dns_hmpf>
Component: FormsAssignee: Kexi Bugs <kexi-bugs>
Status: CONFIRMED ---    
Severity: wishlist CC: dimitrios.tanis
Priority: NOR    
Version: 2.5.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dirk Sarpe 2012-09-17 22:01:03 UTC
Currently it is not possible to edit or add values in forms which are based on queries.

Reproducible: Always

Steps to Reproduce:
1. Create a query
2. Create a form that is based on it
3. Switch to data view in the form and try to edit the data
Actual Results:  
It is not possible to edit the data via the form.

Expected Results:  
Editing data via a form should be possible if the the form is based on a query as well.

An example database https://dl.dropbox.com/u/2658308/secondTry.kexi
Comment 1 Dimitrios T Tanis 2012-09-21 20:43:37 UTC
If I'm not mistaken, this is not Kexi's but rather SQLite's limitation.

Views in SQLite (aka queries) are read only, thus basing a form on a query makes it consequently read only.

Fixing this would require the use of an INSTEAD OF trigger in Kexi internals and change in query implementation, which I believe should be filed as a separate bug.

Thanks for the report.
Comment 2 Jarosław Staniek 2012-09-21 21:40:22 UTC
@Dimitrios: yes, views in SQLite 3 are read only (http://www.sqlite.org/lang_createview.html). But Kexi does not use views for its queries, so it's possible to determine if query can be writable (there may be several conditions, one of them is lack of aggregations). We're just not doing the checks now and we're marking all queries as read-only. Summing up, this wish is valid.