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
ByteaTypeCast
public const string ByteaTypeCast = "::BYTEA"
Field Value
DateFormatQuoted
public const string DateFormatQuoted = "DATE\\'yyyy-MM-dd\\'"
Field Value
DefaultVersionHistoryName
Default version history table name.
public static readonly SqlSchemaObjectName DefaultVersionHistoryName
Field Value
EmptyByteaLiteral
public const string EmptyByteaLiteral = "'\\x'::BYTEA"
Field Value
TimeFormatQuoted
public const string TimeFormatQuoted = "TI\\ME\\'HH:mm:ss.ffffff\\'"
Field Value
TimestampFormatQuoted
public const string TimestampFormatQuoted = "TI\\MESTA\\MP\\'yyyy-MM-dd HH:mm:ss.ffffff\\'"
Field Value
TimestampTzFormatQuoted
public const string TimestampTzFormatQuoted = "TI\\MESTA\\MPTZ\\'yyyy-MM-dd HH:mm:ss.ffffff\\'"
Field Value
UpsertExcludedRecordSetName
public const string UpsertExcludedRecordSetName = "EXCLUDED"
Field Value
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
stringConnection 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
NpgsqlConnectionStringBuilderSource 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
boolValue to convert.
Returns
GetDbLiteral(Guid)
Converts value
to a DB literal.
[Pure]
public static string GetDbLiteral(Guid value)
Parameters
value
GuidValue to convert.
Returns
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
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
stringKey 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.