PublishedExtension
Namespace: Ankus.PgConfig
Assembly: Ankus.PgConfig.dll
Describes the native library, SQL scripts and control files produced by one extension publish.
public sealed class PublishedExtensionInheritance: object
Constructors
Section titled “Constructors”PublishedExtension(int, string, string, string, string)
Section titled “PublishedExtension(int, string, string, string, string)”Creates a manifest with filename-only artifact names.
public PublishedExtension(int postgresMajor, string runtimeIdentifier, string library, string control, string sql)Parameters:
postgresMajor — int
The PostgreSQL header major used to compile the extension.
runtimeIdentifier — string
The Native AOT runtime identifier.
library — string
The native library filename.
control — string
The control filename under extension/.
sql — string
The versioned SQL filename under extension/.
PublishedExtension(int, string, string, string, string, IReadOnlyList<string>)
Section titled “PublishedExtension(int, string, string, string, string, IReadOnlyList<string>)”Creates a manifest with an owned, ordered collection of extension upgrade scripts.
public PublishedExtension(int postgresMajor, string runtimeIdentifier, string library, string control, string sql, IReadOnlyList<string> upgradeScripts)Parameters:
postgresMajor — int
The PostgreSQL header major used to compile the extension.
runtimeIdentifier — string
The Native AOT runtime identifier.
library — string
The native library filename.
control — string
The control filename under extension/.
sql — string
The installation SQL filename under extension/.
upgradeScripts — IReadOnlyList<string>
Upgrade filenames in extension–old–new.sql form.
PublishedExtension(int, string, string, string, string, IReadOnlyList<string>, IReadOnlyList<string>)
Section titled “PublishedExtension(int, string, string, string, string, IReadOnlyList<string>, IReadOnlyList<string>)”Creates a manifest with owned, ordered upgrade scripts and version-specific control files.
public PublishedExtension(int postgresMajor, string runtimeIdentifier, string library, string control, string sql, IReadOnlyList<string> upgradeScripts, IReadOnlyList<string> versionControlFiles)Parameters:
postgresMajor — int
The PostgreSQL header major used to compile the extension.
runtimeIdentifier — string
The Native AOT runtime identifier.
library — string
The native library filename.
control — string
The primary control filename under extension/.
sql — string
The installation SQL filename under extension/.
upgradeScripts — IReadOnlyList<string>
Upgrade filenames in extension–old–new.sql form.
versionControlFiles — IReadOnlyList<string>
Secondary control filenames in extension–version.control form.
PublishedExtension(int, string, string, string, string, IReadOnlyList<string>, IReadOnlyList<string>, string?)
Section titled “PublishedExtension(int, string, string, string, string, IReadOnlyList<string>, IReadOnlyList<string>, string?)”Creates a manifest with a declared PostgreSQL SQL directory and a flat, owned publication payload.
public PublishedExtension(int postgresMajor, string runtimeIdentifier, string library, string control, string sql, IReadOnlyList<string> upgradeScripts, IReadOnlyList<string> versionControlFiles, string? scriptDirectory)Parameters:
postgresMajor — int
The PostgreSQL header major used to compile the extension.
runtimeIdentifier — string
The Native AOT runtime identifier.
library — string
The native library filename.
control — string
The primary control filename under extension/.
sql — string
The installation SQL filename under extension/.
upgradeScripts — IReadOnlyList<string>
Upgrade filenames in extension–old–new.sql form.
versionControlFiles — IReadOnlyList<string>
Secondary control filenames in extension–version.control form.
scriptDirectory — string
The literal primary control directory setting, or null for PostgreSQL’s default.
PublishedExtension(int, string, string, string, string, IReadOnlyList<string>, IReadOnlyList<string>, string?, IReadOnlyList<string>)
Section titled “PublishedExtension(int, string, string, string, string, IReadOnlyList<string>, IReadOnlyList<string>, string?, IReadOnlyList<string>)”Creates a manifest whose publication also contains modules that load the extension’s output plugin under other names.
public PublishedExtension(int postgresMajor, string runtimeIdentifier, string library, string control, string sql, IReadOnlyList<string> upgradeScripts, IReadOnlyList<string> versionControlFiles, string? scriptDirectory, IReadOnlyList<string> pluginLibraries)Parameters:
postgresMajor — int
The PostgreSQL header major used to compile the extension.
runtimeIdentifier — string
The Native AOT runtime identifier.
library — string
The native library filename.
control — string
The primary control filename under extension/.
sql — string
The installation SQL filename under extension/.
upgradeScripts — IReadOnlyList<string>
Upgrade filenames in extension–old–new.sql form.
versionControlFiles — IReadOnlyList<string>
Secondary control filenames in extension–version.control form.
scriptDirectory — string
The literal primary control directory setting, or null for PostgreSQL’s default.
pluginLibraries — IReadOnlyList<string>
Output plugin alias module filenames, installed beside the library.
Methods
Section titled “Methods”CompletePublish(string)
Section titled “CompletePublish(string)”Validates the complete payload, removes obsolete owned SQL, control and output plugin files, and makes the publication installable.
public void CompletePublish(string directory)Parameters:
directory — string
The directory containing the native library and extension files.
GetScriptDirectory(string, string)
Section titled “GetScriptDirectory(string, string)”Verifies the published control’s directory and returns its fully qualified PostgreSQL SQL path.
public string GetScriptDirectory(string publishDirectory, string baseDirectory)Parameters:
publishDirectory — string
The publication containing the primary control under extension/.
baseDirectory — string
The PostgreSQL shared directory, or a PostgreSQL 18+ extension search base.
Returns: string
The directory for SQL scripts and secondary controls, preserving Unix traversal components.
Exceptions:
- FormatException: The control disagrees with the manifest or uses an ambiguous rooted path.
PostgreSQL traverses Unix paths through the filesystem. Removing a directory before a parent component can change its meaning, including when that directory is a symbolic link.
Invalidate(string)
Section titled “Invalidate(string)”Invalidates a previous publication while retaining its file inventory for the next successful publish.
public static void Invalidate(string directory)Parameters:
directory — string
The publish directory.
Read(string)
Section titled “Read(string)”Reads a published manifest without reflection-based deserialization.
public static PublishedExtension Read(string directory)Parameters:
directory — string
The publish directory.
Returns: PublishedExtension
The validated manifest.
Write(string)
Section titled “Write(string)”Writes the manifest to an existing artifact directory.
public void Write(string directory)Parameters:
directory — string
The artifact directory.
Properties
Section titled “Properties”Control
Section titled “Control”Gets the control filename within the extension directory.
public string Control { get; }Value: string
Library
Section titled “Library”Gets the native library filename.
public string Library { get; }Value: string
PluginLibraries
Section titled “PluginLibraries”Gets the filenames of modules that load the extension’s output plugin under other names, installed beside the library.
public IReadOnlyList<string> PluginLibraries { get; }Value: IReadOnlyList<string>
PostgresMajor
Section titled “PostgresMajor”Gets the PostgreSQL major whose headers were used to compile this library.
public int PostgresMajor { get; }Value: int
RuntimeIdentifier
Section titled “RuntimeIdentifier”Gets the runtime identifier used by Native AOT.
public string RuntimeIdentifier { get; }Value: string
ScriptDirectory
Section titled “ScriptDirectory”Gets the literal SQL directory setting, or null when PostgreSQL uses its control file directory.
public string? ScriptDirectory { get; }Value: string
Gets the versioned SQL filename within the extension directory.
public string Sql { get; }Value: string
UpgradeScripts
Section titled “UpgradeScripts”Gets the ordered upgrade filenames within the extension directory.
public IReadOnlyList<string> UpgradeScripts { get; }Value: IReadOnlyList<string>
VersionControlFiles
Section titled “VersionControlFiles”Gets the ordered version-specific control filenames within the extension directory.
public IReadOnlyList<string> VersionControlFiles { get; }Value: IReadOnlyList<string>
Fields
Section titled “Fields”FileName
Section titled “FileName”Gets the manifest filename placed alongside a published native library.
public const string FileName = "ankus.extension.json"