Commit Graph
50 Commits
Author SHA1 Message Date
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 2412800c0c Removed the sqlite page cache option. It should be set through the environment variable, or some other way of providing a custom database configurotion 2025-06-19 11:41:39 +02:00
Carl Johnsen 736b52c2fb Made the LocalPurgeDatabase methods accept a cancellation token 2025-06-19 07:00:14 +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 f167254efe LocalPurgeDatabase.ITemporaryFileset now implements IAsyncDisposable 2025-06-17 21:04:41 +02:00
Carl Johnsen 3d11a05400 Added .ConfigureAwait(false) to all of the await statements 2025-06-12 08:34:29 +02:00
Carl Johnsen f411260c03 Removed TODO in comments on newly introduced commits due to how the pre Microsoft.Data.Sqlite backend would make nested transactions 2025-06-11 09:11:35 +02:00
Carl Johnsen 80389f7bc1 Incorrectly mimicked old way of executing SQL queries without a transaction 2025-06-04 09:33:12 +02:00
Carl Johnsen 85e6f45338 Moved some of the commits to transactions outside of database methods, as this more closely mimics the commit flow of the old IDb backend.
This was especially needed due to the Microsoft.Data.Sqlite backend not supporting nested transactions.
2025-06-03 21:44:55 +02:00
Carl Johnsen ee40767412 Merge branch 'master' into performance/mssqlite-async 2025-05-27 12:04:50 +02:00
Kenneth Skovhede 721e497e69 Fixed nullability warnings 2025-05-23 11:46:37 +02:00
Carl Johnsen 4d8d1a80d1 Updated an inner call of FilesetVolumeWriter to use the new async database methods 2025-05-22 06:01:22 +02:00
Carl Johnsen 67c17871f9 Reintroduced CreateTemporaryFileset helper function for instantiating inner class of LocalPurgeDatabase 2025-05-22 06:00:01 +02:00
Carl Johnsen d45e977d53 Found more factory construction inconsistencies 2025-05-21 08:47:24 +02:00
Carl Johnsen d11b4e58e7 Reworked the factory construction chains to forward an instantiated object where applicable 2025-05-21 07:24:36 +02:00
Carl Johnsen 9776e8ba33 Found inconsintensies in how the purge and delete databases are constructed now, through the create methods compared to the previous constructors. 2025-05-20 21:41:47 +02:00
Carl Johnsen 6a5214f72d Restructered SQL queries in LocalPurgeDatabase 2025-05-20 16:27:33 +02:00
Carl Johnsen a720a69291 Made LocalPurgeDatabase async 2025-05-20 16:15:37 +02:00
Carl Johnsen 5f65c877d9 Removed FormatInvariant as it's now handled by the extension methods 2025-05-20 16:03:12 +02:00
Carl Johnsen 1ddce07d0f Purged IDb from LocalPurgeDatabase 2025-05-20 15:59:07 +02:00
Carl Johnsen 2e570a5862 Changed LocalPurgeDatabase to use factory construction 2025-05-20 15:54:23 +02:00
Kenneth Skovhede fe866ceb9f Implemented support for repairing the database when only parts of the source data is available.
This repair will leave the database in a still-broken state, but if this is run prior to purge-broken-files, less data will be lost.

Also updated the purge-broken-files operation to keep files and directories in the set, if they are only missing metadata.
2025-05-09 11:12:29 +02:00
Kenneth Skovhede 0a7a1cd689 Added option to set the SQLite page cache
This adds an extra option to allow setting the SQLite page cache size as a regular option.

Prior to this commit it was only possible to set the SQLite page cache size via environment variables.

The option to use environment variables is preserved, and as options from the environment variable are applied after the new setting, environment variables take precedence.

The default value for the new option is to use 1% of the system memory for the page cache. For the restore process, a connection per worker may be made which defaults to half the number of cores, so the maximum amount of memory is 1% * half the CPU cores.

This is just the upper limit, and SQLite may choose not to use all of it.

This fixes #6178
2025-04-22 14:26:46 +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 7b948a2f1d Fixed issue with SQLite bindings not supporting arrays.
Added helper class to wrap values in a temporary table if they exceeed the maximum number of parameters.
2025-04-02 23:26:20 +02:00
Kenneth Skovhede d7ccfa378d Added LocalPurgeDatabase 2025-04-02 16:20:12 +02: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 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 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Kenneth Hsu 13e1f0dac6 Remove unused Database members. 2020-03-14 16:45:08 -07:00
Kenneth Hsu afab61a05b Use pattern matching to simplify casts. 2019-10-19 10:15:38 -07:00
Kenneth Hsu 2f29df5c7e Fix incorrect comment. 2019-09-29 09:52:35 -07:00
Kenneth Hsu 9333517950 Fix query used by purge operation for case-sensitive fileystems.
The table we are inserting into should contain the files that are to be
deleted, not the files that are to be kept.

This fixes issue #3927.
2019-09-29 09:52:35 -07:00
BlueBlock 23e08811ca modify to pass the actual IsFullBackup state
changed here because the method was refactored
2019-09-10 12:55:29 -04:00
BlueBlock f6075a26d7 carry isFullBackup value over to new replacement filesets created by purge 2019-09-01 13:13:45 -04:00
BlueBlock 7984e474da fix unittest
IsFullBackup should not be added since it apple to Fileset and not FilesetEntry
2019-08-16 00:25:25 -04:00
BlueBlock 08e2c18185 add handling of a partial backup
- add backup state to DB table 'fileset' (job database upgrade to version 10)
- modify the Restore page dropdown to display if a backup is "partial"
- modify retention logic to remove partial backups only when the next recent full-backup has been removed
2019-08-05 20:14:05 -04:00
Kenneth Skovhede cbc18970d5 Re-applied the path-storage fix as the merge failed somehow 2018-06-14 10:12:24 +02:00
Kenneth Hsu 20f2f37806 Remove unnecessary calls to String.Format. 2018-06-02 12:02:55 -07:00
Kenneth Hsu f12858e6a5 Mark fields that shouldn't be reassigned as readonly.
This makes it explicit at compile-time that these fields should not be
reassigned outside the constructor.
2018-05-25 10:04:52 -07:00
Kenneth Skovhede 842fd96543 Implemented a new logging system that is more transparent and allows a more granular way of picking log messages.
Added ID's to each log message and each exception to allow later introduction of a Knowledgebase service that explains each error in more detail.
2018-03-15 09:12:34 +01:00
Kenneth Skovhede a029890409 Implemented better default error messsages 2017-01-09 11:35:38 +01:00
Kenneth Skovhede 1108d51d7f Implemented a new new list-broken-files and purge-broken-files command for the commandline to assist with handling remote file loss. 2017-01-05 16:46:01 +01:00
Kenneth Skovhede 4bf4871427 Added commandline operation to purge select files from filesets.
This fixes #1009.
This paves the way for #1337.
2016-12-29 22:41:13 +01:00