Skip to content

bug re autoincrementing New Record #514

@praxisity

Description

@praxisity

When there are constraints on a db table that were set by a program other than sqlitebrowser:

Currently, when the [New Record] button is pressed, the program populates the input fields (incorrectly) and then throws an error without any option to "Ignore Check Constraints", and without providing a Help 'tip' on how to edit the Pragmas to ignore the constraints.
An example is a constraint that the HOURS field must be 0-23 and sqlitebrowser inserts the value 24, which obviously is incorrect.

Instead:
The program should present the input fields as empty, without 'guessing' the values, ever.
The program should only throw an error (pop up) when the values entered will either create a duplicate unique index or if the check constraints are violated. It should also clearly explain why the record will not be added, i.e. a duplicate key or a constraint such as HOUR > 23 and leave the input fields to allow the user to make a correction or to exit the [New Record] mode/function/method.

Once the first addition is successfully added, those values can/should be left 'as is' for subsequent records, the user can change all or some values..

You should allow the user to enter data into the fields and press [Enter] to add that record (even if to only a temporary holding array/file) and begin entering the next record or press a new button, [Exit New Record Mode] to exit the "New Record" mode.

You should not provide a Pragma to "Ignore Check Constraints".
The Constraints are there for a good reason and should never be violated since the database may be used by a different program which depends on the constraints.

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.constraints & foreign keys

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions