Commit Graph
154 Commits
Author SHA1 Message Date
Kenneth Skovhede 43d38efdd3 Fixed remaining warnings 2025-11-14 16:09:05 +01:00
Kenneth Skovhede 1ea74a3c63 Updated to .NET10 2025-11-14 15:05:39 +01:00
Kenneth Skovhede c4cd6181d7 Added explicit disabling of pooling to avoid locked files on Windows 2025-08-07 15:26:45 +02:00
Carl Johnsen 34ec5323d2 Accidentially changed the name of the environment variable for custom SQLite options 2025-07-10 15:22:28 +02:00
Kenneth Skovhede cfb1fec331 Fixed compile issue 2025-07-04 16:29:30 +02:00
Carl Johnsen f0b56c058f Removed duplicate project references in the SQLiteHelper project 2025-06-23 13:29:02 +02:00
Carl Johnsen 322e4f15e4 Implemented a lightweight parser to the CUSTOMSQLITEOPTIONS environment variable along with new default options. 2025-06-19 11:48:05 +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 baab370046 Added the final docstrings 2025-06-18 08:26:20 +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 d56e8b2f4a Removed whitespace 2025-06-11 11:58:07 +02:00
Carl Johnsen 51f2d27166 Removed unused helper methods 2025-06-11 09:01:46 +02:00
Carl Johnsen ebdddebeb1 Pragmas that change the safety level of a connection cannot be performed within a transaction 2025-06-11 09:01:12 +02:00
Carl Johnsen 51b86b06ff Made the SQLiteLoader open async again 2025-06-11 09:00:26 +02:00
Carl Johnsen 115bf269d3 Pooling ensures that a connection (and thus also filehandle) may persist even after all of the database connections have been closed, which is undesirable. 2025-05-27 05:39:31 +02:00
Carl Johnsen 9a34ace37d Microsoft.Data.Sqlite doesn't have OpenAsync(), only Open() 2025-05-23 15:49:10 +02:00
Carl Johnsen 41ebeee4f0 All transactions should be deferred 2025-05-23 11:18:03 +02:00
Carl Johnsen a37f0dda31 Merge branch 'master' into performance/mssqlite-async 2025-05-22 14:09:17 +02:00
Carl Johnsen 3c6dc24390 Named the async functions in the SQLiteLoader explicitly, and added synchronous versions. 2025-05-16 12:21:56 +02:00
Carl Johnsen 7f919b3205 Removed deprecated nuget package.
It's replaced by built-in analyzer: https://www.nuget.org/packages/Microsoft.DotNet.Analyzers.Compatibility/0.2.12-alpha
2025-05-16 12:21:24 +02:00
Carl Johnsen 7bdb948820 No need to keep the old package references 2025-05-16 12:21:24 +02:00
Carl Johnsen d1b49238bd Added TODOs 2025-05-16 11:49:57 +02:00
Carl Johnsen e4d2ee275c Small changes to use more modern C# 2025-05-16 11:49:57 +02:00
Carl Johnsen 1cfe154921 Made the SQLiteLoader async 2025-05-16 11:49:57 +02:00
Carl Johnsen a5c783760f Changed the SQLiteHelper.SQLiteLoader to use Microsoft.Data.SQLite as backend. 2025-05-16 11:49:57 +02:00
Carl Johnsen a7bfe46ca8 Removed whitespace 2025-05-16 11:49:57 +02:00
Carl Johnsen 388e849324 Converted tabs to spaces 2025-05-16 10:25:08 +02:00
Carl Johnsen 8be97bcefd Whitespace changes 2025-05-16 10:22:51 +02:00
Carl Johnsen 58db4c9753 Restructured ItemGroups 2025-05-16 10:15:31 +02:00
Carl Johnsen 04153d2c12 Removed Microsoft.DotNet.Analyzers.Compatibility from csproj's as it's deprecated. 2025-05-16 09:53:26 +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 e2df06b8f5 Guards for setting permissions
When setting the permissions, this does not crash the process if it fails, but emits a warning.
2025-03-31 16:07:50 +02:00
Kenneth Skovhede d8a15ac7ed Fixed review comments 2025-03-20 12:05:16 +01:00
Kenneth Skovhede fbe79b1ca3 Improve SQLite loading
This commit changes the way the new restore flow loads the extra database connections so these will also apply the temporary folder settings and custom pragmas.

This also changes the logic around the SQLite temporary folder. Previously, this folder would unconditionally be set to the general temporary folder, allowing only an override with a custom pragma.

No the setup checks if the system has the environment variable `SQLITE_TMPDIR` set already. If this variable is already set, it will NOT be overwritten.
Actual effects of this change depends on how SQLite internally resolves the temporary folder.
2025-03-20 10:05:10 +01:00
Kenneth Skovhede fef0431144 Honor insecure permissions.
This commit changes the logic so permissions are only set on files, if the `insecure-permissions.txt` file is not found in the folder.

Prior to this commit, new files would be locked down without condition.
2025-03-19 21:20:07 +01:00
Kenneth Skovhede f0f79418d8 Fixed logic so the permissions are always applied, unless the user specifically opts out by placing a file named insecure-permissions.txt in the data folder. 2025-02-06 17:09:18 +01:00
Kenneth Skovhede aab91eb0df Added protection to newly create data folder and databases 2025-02-06 16:56:06 +01:00
Kenneth SkovhedeandGitHub 997891525a Updated license-updater to update csproj files (#5898)
* Updated license-updater to update csproj files

* License updates
2025-01-22 21:04:19 +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
Grzegorz Łagocki 9b19bac7da Add Copyright Property to *.csproj files 2024-07-09 00:37:18 +02:00
Kenneth SkovhedeandGitHub fdc891aa36 Merge pull request #5208 from Jojo-1000/fix-sql-quotes
Fix SQL string quotes
2024-06-04 20:58:20 +02:00
Jojo-1000 a5c6c18f26 Prevent SQLite crash on MacOS. 2024-06-04 19:35:06 +02:00
Jojo-1000 930f1c8bd3 Fix most unsupported platform warnings. 2024-05-30 01:50:02 +02:00
Jojo-1000 1dc1fd83af Add SupportedOSPlatform attribute and target windows where appropriate. 2024-05-30 01:22:16 +02:00
Jojo-1000 2ecfde44f9 Disable double quoted sql string compatibility mode. 2024-05-30 00:00:49 +02:00
Kenneth Skovhede 3ebc7f7f42 Added support for win-arm64 SQLite 2024-05-26 21:24:21 +02:00
Kenneth Skovhede 1265f88cf8 Fixed disposing the read stream before moving the encrypted database.
Added more context to the default error message when decryption fails.
2024-05-08 12:48:10 +02:00
Kenneth Skovhede db8fb59577 Avoid locking the database file on Windows when looking for an encrypted header 2024-04-24 15:18:45 +02:00