Table of Contents

Class NpgsqlTsQuery

Namespace
NpgsqlTypes
Assembly
Npgsql.dll

Represents a PostgreSQL tsquery. This is the base class for the lexeme, not, or, and, and "followed by" nodes.

public abstract class NpgsqlTsQuery : IEquatable<NpgsqlTsQuery>
Inheritance
NpgsqlTsQuery
Implements
Derived
Inherited Members

Constructors

NpgsqlTsQuery(NodeKind)

Constructs an NpgsqlTsQuery.

protected NpgsqlTsQuery(NpgsqlTsQuery.NodeKind kind)

Parameters

kind NpgsqlTsQuery.NodeKind

Properties

Kind

Node kind

public NpgsqlTsQuery.NodeKind Kind { get; }

Property Value

NpgsqlTsQuery.NodeKind

Methods

Equals(NpgsqlTsQuery?)

Returns a value indicating whether this instance and a specified NpgsqlTsQuery object represent the same value.

public abstract bool Equals(NpgsqlTsQuery? other)

Parameters

other NpgsqlTsQuery

An object to compare to this instance.

Returns

bool

true if g is equal to this instance; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Parse(string)

Parses a tsquery in PostgreSQL's text format.

[Obsolete("Client-side parsing of NpgsqlTsQuery is unreliable and cannot fully duplicate the PostgreSQL logic. Use PG functions instead (e.g. to_tsquery)")]
public static NpgsqlTsQuery Parse(string value)

Parameters

value string

Returns

NpgsqlTsQuery

ToString()

Writes the tsquery in PostgreSQL's text format.

public override string ToString()

Returns

string

Write(StringBuilder)

Writes the tsquery in PostgreSQL's text format.

public void Write(StringBuilder stringBuilder)

Parameters

stringBuilder StringBuilder

Operators

operator ==(NpgsqlTsQuery?, NpgsqlTsQuery?)

Indicates whether the values of two specified NpgsqlTsQuery objects are equal.

public static bool operator ==(NpgsqlTsQuery? left, NpgsqlTsQuery? right)

Parameters

left NpgsqlTsQuery

The first object to compare.

right NpgsqlTsQuery

The second object to compare.

Returns

bool

true if left and right are equal; otherwise, false.

operator !=(NpgsqlTsQuery?, NpgsqlTsQuery?)

Indicates whether the values of two specified NpgsqlTsQuery objects are not equal.

public static bool operator !=(NpgsqlTsQuery? left, NpgsqlTsQuery? right)

Parameters

left NpgsqlTsQuery

The first object to compare.

right NpgsqlTsQuery

The second object to compare.

Returns

bool

true if left and right are not equal; otherwise, false.