Skip to content

EnsureAsync Method ​

Definition ​

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Task EnsureAsync(IDatabaseSession session, IEnumerable<string> extensions, string schema = null, CancellationToken cancellationToken = null) ​

csharp
Task EnsureAsync(IDatabaseSession session, IEnumerable<string> extensions, string schema = null, CancellationToken cancellationToken = null)

Creates the target schema if needed, installs each extension into that schema, relocates already-installed extensions when they live elsewhere, then reloads Npgsql types.

Parameters ​

NameDescription
cancellationTokenToken used to cancel ensure work.
extensionsExtension names to ensure (for example citext, vector).
schemaTarget schema. When or whitespace, uses ExtensionsSchema when present on the session, otherwise DefaultSchemaName.
sessionOpen PostgreSQL session (IPostgresMetadataProvider).