Class EdgeDatabase
One physical database. Connection strings are always built through SqliteConnectionStringBuilder from this single place: Microsoft.Data.Sqlite keys its pool groups on the raw connection-string text, so two textually different but semantically identical strings fragment the pool and hold duplicate keyed handles open.
public sealed class EdgeDatabase : IEdgeDatabase, IDisposable
- Inheritance
-
EdgeDatabase
- Implements
- Inherited Members
Constructors
- EdgeDatabase(string, SqliteOptions, Func<IEdgeHost>, IEdgePaths, Func<ISqliteNativeProvider>, ILogger<EdgeDatabase>)
Creates a database over resolved options, paths, the host and the single native provider.
Properties
- IsEncrypted
True when a key or key provider is configured.
- Name
The registration name;
(default)for the unnamed database.
- Path
The absolute file path, or
:memory:.
Methods
- CheckAsync(CancellationToken)
PRAGMA quick_checkplusSELECT vec_version().
- CheckpointAsync(CancellationToken)
PRAGMA wal_checkpoint(TRUNCATE). Best effort: failures are logged, not thrown.
- Dispose()
Releases the key gate. The container owns this object's lifetime.
- ExecuteInTransactionAsync<T>(Func<SqliteConnection, SqliteTransaction, CancellationToken, Task<T>>, CancellationToken)
Runs
workinside one transaction and commits it.
- GetInfoAsync(CancellationToken)
Versions, page size, journal mode,
user_version, file size and encryption state.
- OpenConnectionAsync(CancellationToken)
Awaits startup, opens, applies the key and the per-open pragmas. The caller disposes.
- RekeyAsync(SqliteKey, CancellationToken)
Cipher builds only; throws EdgeConfigurationException otherwise.