Skip to content

PgQualifiedNameBuilder

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Builds an exact sequence of PostgreSQL name components for native operator lookup.

public sealed class PgQualifiedNameBuilder : IReadOnlyList<string>, IReadOnlyCollection<string>, IEnumerable<string>, IEnumerable

Components are unquoted catalog identifiers, never parsed, split, trimmed or case-folded. The managed builder is reusable and needs no backend until lookup. It is not thread-safe.

Inheritance: object

Implements: IReadOnlyList<string>, IReadOnlyCollection<string>, IEnumerable<string>, IEnumerable

public PgQualifiedNameBuilder()

Appends one exact name component without interpreting SQL quoting or punctuation.

public PgQualifiedNameBuilder Add(string value)

Parameters:

value — string

The component, including an empty string if desired.

Returns: PgQualifiedNameBuilder

This builder for fluent construction.

Exceptions:

Enumerates components in insertion order.

public IEnumerator<string> GetEnumerator()

Returns: IEnumerator<string>

The component enumerator.

Resolves an operator with exactly the supplied argument type OIDs using PostgreSQL’s current namespace rules.

public uint GetOperatorOid(uint leftTypeOid, uint rightTypeOid)

Parameters:

leftTypeOid — uint

The left argument type, or zero for a prefix operator.

rightTypeOid — uint

The right argument type; zero permits legacy postfix lookup where the server supports it.

Returns: uint

The current operator OID, or zero when the exact operator or explicit schema is absent.

One component follows search_path, two specify schema and operator, and three also specify the current database. PostgreSQL reports invalid name counts, foreign databases and schema permission errors as PgException. Lookup does not coerce argument types, consume this builder, cache OIDs, or retain native storage.

Gets the number of name components.

public int Count { get; }

Value: int

Gets one exact component in insertion order.

public string this[int index] { get; }

Parameters:

index — int

The zero-based component index.

Value: string

The component.