Table of Contents

Class PostgreSqlHelpers

Namespace
LfrlAnvil.PostgreSql.Internal
Assembly
LfrlAnvil.PostgreSql.dll

Contains various PostgreSQL helpers.

public static class PostgreSqlHelpers
Inheritance
PostgreSqlHelpers
Inherited Members

Fields

ByteaMarker

public const string ByteaMarker = "\\x"

Field Value

string

ByteaTypeCast

public const string ByteaTypeCast = "::BYTEA"

Field Value

string

DateFormatQuoted

public const string DateFormatQuoted = "DATE\\'yyyy-MM-dd\\'"

Field Value

string

DefaultVersionHistoryName

Default version history table name.

public static readonly SqlSchemaObjectName DefaultVersionHistoryName

Field Value

SqlSchemaObjectName

EmptyByteaLiteral

public const string EmptyByteaLiteral = "'\\x'::BYTEA"

Field Value

string

TimeFormatQuoted

public const string TimeFormatQuoted = "TI\\ME\\'HH:mm:ss.ffffff\\'"

Field Value

string

TimestampFormatQuoted

public const string TimestampFormatQuoted = "TI\\MESTA\\MP\\'yyyy-MM-dd HH:mm:ss.ffffff\\'"

Field Value

string

TimestampTzFormatQuoted

public const string TimestampTzFormatQuoted = "TI\\MESTA\\MPTZ\\'yyyy-MM-dd HH:mm:ss.ffffff\\'"

Field Value

string

UpsertExcludedRecordSetName

public const string UpsertExcludedRecordSetName = "EXCLUDED"

Field Value

string

Methods

ExtendConnectionString(ReadOnlyArray<SqlConnectionStringEntry>, string)

Extends the provided collection of SqlConnectionStringEntry instances with a partial connection string, potentially overriding entries with their IsMutable equal to true.

[Pure]
public static string ExtendConnectionString(ReadOnlyArray<SqlConnectionStringEntry> entries, string options)

Parameters

entries ReadOnlyArray<SqlConnectionStringEntry>

Connection string entries to extend.

options string

Connection string options to apply to the extended collection.

Returns

string

New connection string.

ExtractConnectionStringEntries(NpgsqlConnectionStringBuilder)

Extracts a collection of SqlConnectionStringEntry instances from the provided Npgsql.NpgsqlConnectionStringBuilder.

[Pure]
public static SqlConnectionStringEntry[] ExtractConnectionStringEntries(NpgsqlConnectionStringBuilder builder)

Parameters

builder NpgsqlConnectionStringBuilder

Source connection string builder.

Returns

SqlConnectionStringEntry[]

New collection of SqlConnectionStringEntry instances.

GetDbLiteral(bool)

Converts value to a DB literal.

[Pure]
public static string GetDbLiteral(bool value)

Parameters

value bool

Value to convert.

Returns

string

string representation of the provided value.

GetDbLiteral(Guid)

Converts value to a DB literal.

[Pure]
public static string GetDbLiteral(Guid value)

Parameters

value Guid

Value to convert.

Returns

string

string representation of the provided value.

GetDbLiteral(ReadOnlySpan<byte>)

Converts value to a DB literal.

[Pure]
public static string GetDbLiteral(ReadOnlySpan<byte> value)

Parameters

value ReadOnlySpan<byte>

Value to convert.

Returns

string

string representation of the provided value.

IsMutableConnectionStringKey(string)

Specifies whether or not the provided key of a connection string entry is considered to be mutable.

[Pure]
public static bool IsMutableConnectionStringKey(string key)

Parameters

key string

Key to check.

Returns

bool

true when key is mutable, otherwise false.

Remarks

Mutable connection string entries can be changed in the ExtendConnectionString(ReadOnlyArray<SqlConnectionStringEntry>, string) method invocation.