Members on this page
Meshline.Sdk
Meshline.Storage
MeshlineDatabase Class
Creates or upgrades the SDK's SQLite database through EF Core migrations.
public static class MeshlineDatabase
Inheritance System.Object → MeshlineDatabase
Methods
MeshlineDatabase.MigrateAsync(DatabaseOptions, CancellationToken) Method
Creates or upgrades the SQLite database by applying all pending SDK migrations.
public static System.Threading.Tasks.Task MigrateAsync(Meshline.Storage.DatabaseOptions databaseOptions, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
Parameters
databaseOptions DatabaseOptions
The SQLite database configuration; create its parent directory and apply migrations before initialization.
cancellationToken System.Threading.CancellationToken
A token that can cancel the operation.
Returns
System.Threading.Tasks.Task
A task that completes when the operation finishes.
Exceptions
System.OperationCanceledException
The operation observes cancellation of cancellationToken.
Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.
System.ArgumentNullException
The database options are null.
System.InvalidOperationException
The current EF Core model differs from its migration snapshot or the migration cannot be applied to the current database state.
Remarks
Create the database's parent directory before calling this method. Applications invoke migrations explicitly; component initialization does not perform schema upgrades automatically.