Commit Graph
109 Commits
Author SHA1 Message Date
Kenneth Skovhede 230d80642a Fixed invariant formatting helpers
This fixes an issue with formatting for invariant values that was caused by incrorrect function overload selection.

To avoid future issues, the two similar functions have been renamed to clarify what they are working for.
2025-09-25 11:14:54 +02:00
Carl Johnsen 7670ea9a58 Ensured that all values that are passed to interpolation strings have been passed through FormatInvariant to prevent SQLite errors related to string formatting cultures. 2025-09-05 14:11:05 +02:00
Carl Johnsen b3fe276a13 Ensured that all temporary tables uset the same type of generated guid name 2025-09-05 14:06:55 +02:00
Carl Johnsen 1c103c18b8 Made the LocalRecreateDatabase methods accept a cancellation token 2025-06-19 07:15:28 +02:00
Carl Johnsen 9ac583db94 Made all relevant using statements use await to use DisposeAsync 2025-06-18 11:53:11 +02:00
Carl Johnsen 859b65054d Simplified using statements that uses databases or accesses their methods 2025-06-18 11:52:05 +02:00
Carl Johnsen f221098c28 Formatted SQL queries - mainly adding double quotes where they were missing. 2025-06-18 10:42:08 +02:00
Carl Johnsen 273b0f093e Added more docstrings 2025-06-17 21:30:11 +02:00
Carl Johnsen b4e5f2739e Found incorrect type signature for DisposeAsync() methods 2025-06-17 21:05:34 +02:00
Carl Johnsen 3d11a05400 Added .ConfigureAwait(false) to all of the await statements 2025-06-12 08:34:29 +02:00
Carl Johnsen e5337e4d26 Formatted SQL queries 2025-06-11 12:09:58 +02:00
Carl Johnsen cb06275a81 Removed TODOs 2025-06-11 11:30:13 +02:00
Carl Johnsen d2a34b600f Fixed typo on which integer was the one being saved during recreatedatabase 2025-05-27 18:37:09 +02:00
Carl Johnsen 5463cdcf24 NOT keyword was accidentally removed from an SQL query. 2025-05-27 05:40:52 +02:00
Carl Johnsen b54bcba624 All commands should run in a transaction 2025-05-27 05:40:07 +02:00
Carl Johnsen 7fa181a759 Commit to ensure that changes are visible 2025-05-27 05:39:51 +02:00
Carl Johnsen 006efa875d Fixed missing increment 2025-05-23 11:16:30 +02:00
Carl Johnsen d0df1386cc Removed line that's also been removed on master 2025-05-23 11:16:17 +02:00
Carl Johnsen abc7c79841 Dispose made infinite recursion between different class derivations 2025-05-23 08:20:00 +02:00
Carl Johnsen 7a6bc2ba26 Removed transactions as parameter in the methods of LocalRecreateDatabase as part of the move towards implicit transactions 2025-05-22 06:14:16 +02:00
Carl Johnsen d45e977d53 Found more factory construction inconsistencies 2025-05-21 08:47:24 +02:00
Carl Johnsen 4affe460ad Restructered SQL queries in LocalRecreateDatabase 2025-05-21 08:42:42 +02:00
Carl Johnsen 003faef8bf Ensured all calls to sqlite in LocalRecreateDatabase uses extension methods and are properly async 2025-05-21 07:57:13 +02:00
Carl Johnsen 712d75a3d3 Removed FormatInvariant as it's now handeld by the extension methods 2025-05-21 07:40:39 +02:00
Carl Johnsen 89a5f5d4f7 Changed LocalRecreateDatabase to use factory construction 2025-05-21 07:36:44 +02:00
Carl Johnsen 1c1c83b093 Updated LocalRecreateDatabase to be async using Microsoft.Data.Sqlilte 2025-05-16 12:21:24 +02:00
Carl Johnsen f3b102dc66 Removed whitespace 2025-05-16 12:21:24 +02:00
Kenneth Skovhede 457349fd2d More cleanup 2025-04-03 22:15:19 +02:00
Kenneth Skovhede 0b735d79ff More cleanup and a few bug fixes 2025-04-03 16:38:51 +02:00
Kenneth Skovhede 2006556778 Fixed some more nullable support in the database layer 2025-04-03 15:46:20 +02:00
Kenneth Skovhede ba8866f7d8 Added LocalRecreateDatabase 2025-04-02 16:54:16 +02:00
Kenneth Skovhede d40301b2b7 Guard against fileset errors
This PR adds a few extra consistency checks to the database, so any failure in the operations is detected earlier than before.

Especially when cleaning temporary and partial files, it is important that the deletes do not remove unexpected entries.

Also, after a recreate, repair or purge command, the database consistency is verified, so it becomes easier to identify which operation caused the failure.

To assist in trouble shooting, there is also a more elaborate error message if a fileset discrepancy is detected, that pinpoints which versions are affected.

Finally, the repair command has been extended to support recreating a fileset from the remote data.
2025-03-20 15:59:14 +01:00
Kenneth Skovhede bb1aa8e1f7 Cosmetic cleanup
Removed superfluous namespaces.
Using `var` most places.
Using extension methods for common setup of commands.
2025-03-14 14:34:56 +01:00
Kenneth Skovhede 7234d43961 Fixed all SQL strings to use interpolation and forced them into the FormattableString handler using the invariant formatting. 2025-03-14 12:13:17 +01:00
Kenneth Skovhede f342d70819 Implemented forced invariant locale on all SQL strings.
This fixes #6023
2025-03-13 23:06:32 +01:00
Kenneth Skovhede be16323f24 General cleanup, common database validation exception 2025-03-10 14:38:45 +01:00
Kenneth SkovhedeandGitHub 52a73c3418 Fixed issue 5845 (#5880)
* Fixed issue 5845

This commit introduces the test that makes the error.

* Fixed query cleaning up duplicates, in the case that where a block has multiple valid source candidates.

* Reduced number of replicas for the test
2025-01-16 14:27:15 +01:00
Kenneth SkovhedeandGitHub d64c7e721f Handle duplicated missing blocks (#5858)
* Implemented test for #5845

* Removed unittests not executing cleanup.

* Cleanup commit

* Fixed the query that causes the constraint violation
2025-01-10 09:24:54 +01:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Kenneth Skovhede dedee8fd35 Hand-picked the recreate fixes from #4982.
This fixes that the recreate will move unused blocks into the `DeletedBlock` table after the database has been recreated.
Due to this, the disruption test can now be verified.
2024-11-01 15:56:14 +01:00
Kenneth Skovhede 1dc2acb2bf Ensure repair also works with the index 2024-11-01 15:02:48 +01:00
Kenneth Skovhede be0e4d2ed1 Fixed an incorrect string quote 2024-10-05 17:36:42 +02:00
Jojo-1000 55284410c7 Fix sql queries that use double quoted strings.
Closes #5202
2024-05-30 00:00:48 +02:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
gpatel-frandGitHub ec9d49d684 Experiment/rebuildfaster (#5043)
* experimental faster db rebuild (#4955)

* try run update db query for every block file only when needed
add repair-force-block-use option
more appropriate naming for some routines
more tracing
more comments
2023-11-05 18:19:08 +01:00
Kenneth Hsu 5951047ff1 Fix incorrect or misleading indentations.
This also adds braces to clarify scope where beneficial.
2020-11-21 13:58:16 -08:00
Kenneth Hsu 13e1f0dac6 Remove unused Database members. 2020-03-14 16:45:08 -07:00
BlueBlock e8f3bccef8 spelling fix 2019-09-09 18:28:25 -04:00
BlueBlock a230e3b228 Revert "spelling fix"
This reverts commit 8bb4bfaeb4.
2019-09-09 18:26:01 -04:00
BlueBlock 8bb4bfaeb4 spelling fix 2019-09-09 18:25:29 -04:00