-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] The "File -> Export -> Database to SQL File ..." doesn't export the values in the "sqlite_sequence" table #3637
Comments
While noted, what impact do you feel this causes? I've tagged this and can leave it open, but as it has little impact on the usability, fixing this would be a low priority. |
Hello @chrisjlocke Anyone would expect a backup to represent the exact state of the database, not something that looks like the actual state of the database (but isn't). In the export form you can select the When that backup is reloaded back into SQLite, values from sequence counters that were previously used could be reused again. Imagine a case where the last records added to the database have been deleted, And imagine that those IDs have been used in services external to the database. And that the external service uses the existence of those IDs in the database for its decision making. And that now an export is made. When reloading the database, previously used ID values would be generated again, which would make the external service believe that an ID is active when in fact it was deleted and a new record is reusing an old value. In addition, if the exported file is to be used to load the backup into another database engine, it is important to have the values of the sequence counters, to ensure that the correct values are retrieved, without making assumptions about what SQLite does when. In summary, for security, reliability, repeatability and to avoid unanticipated problems, if the user flags the |
What did you do?
I choose "File -> Export -> Database to SQL File ..." doesn't export the values in the "sqlite_sequence" table and in the Tables box appears the table named "sqlite_sequence":
but in the exported file don't appear the values of the sequence counters, as they would appear when you use the
.dump
command from the sqlite command.What did you expect to see?
I expected that the values of the sequence counter where exported in the backup. Using
.dump
in sqlite command the appear:The sequence counters are created, because there are related to the PRIMARY KEYs
Without the correct sequence counter values, a failure will occur when inserting the next row, as a duplicate primary key error will be generated.
What did you see instead?
There is no values for sequences in the exported file.
DB4S Version
3.12.2
What OS are you seeing the problem on?
Windows, Linux
OS version
Windows 10 (native and under WSL2 with Ubuntu 22.04)
Relevant log output
No response
Prevention against duplicate issues
The text was updated successfully, but these errors were encountered: