C# Class Azavea.Open.DAO.PostgreSQL.PostgreSqlDescriptor

This class is a ConnectionDescriptor implementation for using FastDAO to communicate with a PostGreSQL / PostGIS database. Thought it is named "PostGreSqlDescriptor", it supports spatial queries and data if you have PostGIS installed.
Inheritance: Azavea.Open.DAO.SQL.AbstractSqlConnectionDescriptor, ITransactionalConnectionDescriptor
Afficher le fichier Open project: azavea/net-dao-postgresql Class Usage Examples

Méthodes publiques

Свойство Type Description
DEFAULT_ENCODING string
DEFAULT_PORT string

Méthodes publiques

Méthode Description
BeginTransaction ( ) : ITransaction

Begins the transaction. Returns a transaction object that you should use for operations you wish to be part of the transaction. NOTE: You MUST call Commit or Rollback on the returned ITransaction when you are done.

CaseInsensitiveLikeOperator ( ) : string
ColumnAliasPrefix ( ) : string
ColumnAliasSuffix ( ) : string
CreateDataAccessLayer ( ) : IDaLayer
CreateNewAdapter ( IDbCommand cmd ) : DbDataAdapter
CreateNewConnection ( ) : DbConnection
HasCaseInsensitiveLikeOperator ( ) : bool
MakeConnectionString ( string server, string port, string database, string user, string password, string encoding ) : string

Assembles a PostGreSQL/PostGIS connection string that can be used to get a database connection. All the parameters are optional for the purposes of this method, although obviously it would be possible to create a useless connection string if you leave out important parameters.

MakeModulusClause ( string columnName ) : SqlClauseWithValue
MakeSequenceValueQuery ( string sequenceName ) : string
NeedAsForColumnAliases ( ) : bool
NeedToAliasColumns ( ) : bool
PostgreSqlDescriptor ( Config config, string component, ConnectionInfoDecryptionDelegate decryptionDelegate ) : System

This constructor reads all the appropriate values from our standard config file in the normal format.

PostgreSqlDescriptor ( string server, string port, string database, string user, string password, string encoding ) : System

Constructor that lets you pass everything as parameters rather than requiring a config.

SetParametersOnCommand ( IDbCommand cmd, IEnumerable parameters ) : void
TableAliasPrefix ( ) : string
TableAliasSuffix ( ) : string
ToCleanString ( ) : string
ToCompleteString ( ) : string
UsePooling ( ) : bool

Method Details

BeginTransaction() public méthode

Begins the transaction. Returns a transaction object that you should use for operations you wish to be part of the transaction. NOTE: You MUST call Commit or Rollback on the returned ITransaction when you are done.
public BeginTransaction ( ) : ITransaction
Résultat ITransaction

CaseInsensitiveLikeOperator() public méthode

public CaseInsensitiveLikeOperator ( ) : string
Résultat string

ColumnAliasPrefix() public méthode

public ColumnAliasPrefix ( ) : string
Résultat string

ColumnAliasSuffix() public méthode

public ColumnAliasSuffix ( ) : string
Résultat string

CreateDataAccessLayer() public méthode

public CreateDataAccessLayer ( ) : IDaLayer
Résultat IDaLayer

CreateNewAdapter() public méthode

public CreateNewAdapter ( IDbCommand cmd ) : DbDataAdapter
cmd IDbCommand
Résultat System.Data.Common.DbDataAdapter

CreateNewConnection() public méthode

public CreateNewConnection ( ) : DbConnection
Résultat System.Data.Common.DbConnection

HasCaseInsensitiveLikeOperator() public méthode

public HasCaseInsensitiveLikeOperator ( ) : bool
Résultat bool

MakeConnectionString() public static méthode

Assembles a PostGreSQL/PostGIS connection string that can be used to get a database connection. All the parameters are optional for the purposes of this method, although obviously it would be possible to create a useless connection string if you leave out important parameters.
public static MakeConnectionString ( string server, string port, string database, string user, string password, string encoding ) : string
server string Server name that is hosting the database
port string Port number on the server to use, if you don't know then use DEFAULT_PORT.
database string Database name, if necessary to specify
user string User name to use when accessing the db
password string Password for above user, in plain text.
encoding string String encoding to use, if you don't know then use DEFAULT_ENCODING.
Résultat string

MakeModulusClause() public méthode

public MakeModulusClause ( string columnName ) : SqlClauseWithValue
columnName string
Résultat Azavea.Open.DAO.SQL.SqlClauseWithValue

MakeSequenceValueQuery() public méthode

public MakeSequenceValueQuery ( string sequenceName ) : string
sequenceName string
Résultat string

NeedAsForColumnAliases() public méthode

public NeedAsForColumnAliases ( ) : bool
Résultat bool

NeedToAliasColumns() public méthode

public NeedToAliasColumns ( ) : bool
Résultat bool

PostgreSqlDescriptor() public méthode

This constructor reads all the appropriate values from our standard config file in the normal format.
public PostgreSqlDescriptor ( Config config, string component, ConnectionInfoDecryptionDelegate decryptionDelegate ) : System
config Azavea.Open.Common.Config Config to get params from.
component string Section of the config XML to look in for db params.
decryptionDelegate ConnectionInfoDecryptionDelegate Delegate to call to decrypt password fields. /// May be null if passwords are in plain text.
Résultat System

PostgreSqlDescriptor() public méthode

Constructor that lets you pass everything as parameters rather than requiring a config.
public PostgreSqlDescriptor ( string server, string port, string database, string user, string password, string encoding ) : System
server string Server name or IP. May not be null.
port string Port number on the server. Null means use the default.
database string Database name on that server. May not be null.
user string Database user name, may be null.
password string Plain text password for the user. /// May be null.
encoding string String encoding to use. Null means use the default (unicode).
Résultat System

SetParametersOnCommand() public méthode

public SetParametersOnCommand ( IDbCommand cmd, IEnumerable parameters ) : void
cmd IDbCommand
parameters IEnumerable
Résultat void

TableAliasPrefix() public méthode

public TableAliasPrefix ( ) : string
Résultat string

TableAliasSuffix() public méthode

public TableAliasSuffix ( ) : string
Résultat string

ToCleanString() public méthode

public ToCleanString ( ) : string
Résultat string

ToCompleteString() public méthode

public ToCompleteString ( ) : string
Résultat string

UsePooling() public méthode

public UsePooling ( ) : bool
Résultat bool

Property Details

DEFAULT_ENCODING public_oe static_oe property

This is the "usual" character encoding that PostGreSQL uses. Unless you know your instance is using a different encoding, this is the one you should use.
public static string DEFAULT_ENCODING
Résultat string

DEFAULT_PORT public_oe static_oe property

This is the "usual" port that PostGreSQL runs on. Unless you know your instance is running on a different port, this is the one you should use.
public static string DEFAULT_PORT
Résultat string