ExtensionControlFile
Namespace: Ankus.PgConfig
Assembly: Ankus.PgConfig.dll
Reads and writes PostgreSQL extension control assignments without loading native code.
public static class ExtensionControlFileControl files use ASCII because PostgreSQL cannot determine their encoding. Comments, optional equals signs, quoted values, doubled quotes, backslash escapes, and last-assignment precedence follow PostgreSQL’s configuration syntax. Include directives are not supported. Parameter names and values are otherwise interpreted by the selected PostgreSQL version, not by this text codec.
Inheritance: object
Methods
Section titled “Methods”Format(IReadOnlyDictionary<string, string>)
Section titled “Format(IReadOnlyDictionary<string, string>)”Formats assignments in ordinal name order with PostgreSQL string escaping.
public static string Format(IReadOnlyDictionary<string, string> values)Parameters:
values — IReadOnlyDictionary<string, string>
The exact decoded assignments.
Returns: string
ASCII control text with LF line endings.
Exceptions:
- ArgumentNullException: The dictionary or one of its values is null.
- FormatException: A name is invalid, or a value contains non-ASCII text or NUL.
Parse(string)
Section titled “Parse(string)”Parses control text without changing its values or reading additional files.
public static IReadOnlyDictionary<string, string> Parse(string text)Parameters:
text — string
ASCII control assignments.
Returns: IReadOnlyDictionary<string, string>
The case-sensitive parameter names and decoded values.
Exceptions:
- ArgumentNullException: The text is null.
- FormatException: The text contains invalid syntax, non-ASCII text, NUL, or an include directive.
Read(string)
Section titled “Read(string)”Reads a control file and returns its immutable assignments.
public static IReadOnlyDictionary<string, string> Read(string path)Parameters:
path — string
The control file path.
Returns: IReadOnlyDictionary<string, string>
The case-sensitive parameter names and decoded values.
Exceptions:
- FormatException: The file contains invalid or unsupported control syntax.