Class NpgsqlDatabaseInfo
Base class for implementations which provide information about PostgreSQL and PostgreSQL-like databases (e.g. type definitions, capabilities...).
public abstract class NpgsqlDatabaseInfo
- Inheritance
-
NpgsqlDatabaseInfo
- Inherited Members
Constructors
NpgsqlDatabaseInfo(string, int, string, Version)
Initializes the instance of NpgsqlDatabaseInfo.
protected NpgsqlDatabaseInfo(string host, int port, string databaseName, Version version)
Parameters
NpgsqlDatabaseInfo(string, int, string, Version, string)
Initializes the instance of NpgsqlDatabaseInfo.
protected NpgsqlDatabaseInfo(string host, int port, string databaseName, Version version, string serverVersion)
Parameters
Properties
HasIntegerDateTimes
Reports whether the backend uses the newer integer timestamp representation.
public virtual bool HasIntegerDateTimes { get; protected set; }
Property Value
Host
The hostname of IP address of the database.
public string Host { get; }
Property Value
Name
The database name.
public string Name { get; }
Property Value
Port
The TCP port of the database.
public int Port { get; }
Property Value
ServerVersion
The PostgreSQL version string as returned by the server_version option. Populated during loading.
public string ServerVersion { get; }
Property Value
SupportsAdvisoryLocks
Whether the backend supports advisory locks.
public virtual bool SupportsAdvisoryLocks { get; }
Property Value
SupportsCloseAll
Whether the backend supports the CLOSE ALL statement.
public virtual bool SupportsCloseAll { get; }
Property Value
SupportsDiscard
Whether the backend supports the DISCARD statement.
public virtual bool SupportsDiscard { get; }
Property Value
SupportsDiscardSequences
Whether the backend supports the DISCARD SEQUENCES statement.
public virtual bool SupportsDiscardSequences { get; }
Property Value
SupportsDiscardTemp
Whether the backend supports the DISCARD TEMP statement.
public virtual bool SupportsDiscardTemp { get; }
Property Value
SupportsEnumTypes
Whether the backend supports enum types.
public virtual bool SupportsEnumTypes { get; }
Property Value
SupportsMultirangeTypes
Whether the backend supports multirange types.
public virtual bool SupportsMultirangeTypes { get; }
Property Value
SupportsRangeTypes
Whether the backend supports range types.
public virtual bool SupportsRangeTypes { get; }
Property Value
SupportsTransactions
Whether the database supports transactions.
public virtual bool SupportsTransactions { get; protected set; }
Property Value
SupportsUnlisten
Whether the backend supports the UNLISTEN statement.
public virtual bool SupportsUnlisten { get; }
Property Value
Version
The version of the PostgreSQL database we're connected to, as reported in the "server_version" parameter. Exposed via PostgreSqlVersion.
public Version Version { get; }
Property Value
Methods
GetPostgresType(string)
public PostgresType GetPostgresType(string pgName)
Parameters
pgName
string
Returns
GetPostgresType(uint)
public PostgresType GetPostgresType(uint oid)
Parameters
oid
uint
Returns
GetTypes()
Provides all PostgreSQL types detected in this database.
protected abstract IEnumerable<PostgresType> GetTypes()
Returns
ParseServerVersion(string)
Parses a PostgreSQL server version (e.g. 10.1, 9.6.3) and returns a CLR Version.
protected static Version ParseServerVersion(string value)
Parameters
value
string
Returns
RegisterFactory(INpgsqlDatabaseInfoFactory)
Registers a new database info factory, which is used to load information about databases.
public static void RegisterFactory(INpgsqlDatabaseInfoFactory factory)
Parameters
factory
INpgsqlDatabaseInfoFactory
TryGetPostgresTypeByName(string, out PostgresType?)
public bool TryGetPostgresTypeByName(string pgName, out PostgresType? pgType)
Parameters
pgName
stringpgType
PostgresType