C# Class ConfigurationSetupUtility.PostgresSetup

This class is used to aid in the manipulation of a PostgreSQL DB connection string as well as executing scripts and storing the data required for PostgreSQL DB setup.
Exibir arquivo Open project: GridProtectionAlliance/substationSBG

Public Methods

Method Description
CreateLogin ( string loginName ) : void
CreateLogin ( string loginName, string password ) : void
ExecuteScript ( IDbConnection connection, string fileName ) : void

Executes a database script using the given connection.

ExecuteScript ( string fileName ) : void

Executes a database script as the admin user.

ExecuteStatement ( IDbConnection connection, string statement ) : void

Executes the given statement using the given connection.

ExecuteStatement ( string statement ) : void

Executes the given statement as the admin user.

GrantDatabaseAccess ( string loginName ) : void
OpenAdminConnection ( IDbConnection &connection ) : void

Opens a connection as the admin user.

OpenConnection ( IDbConnection &connection ) : void

Opens a connection as the schema user.

Private Methods

Method Description
OpenConnection ( IDbConnection &connection, string connectionString ) : void

Method Details

CreateLogin() public method

public CreateLogin ( string loginName ) : void
loginName string
return void

CreateLogin() public method

public CreateLogin ( string loginName, string password ) : void
loginName string
password string
return void

ExecuteScript() public method

Executes a database script using the given connection.
public ExecuteScript ( IDbConnection connection, string fileName ) : void
connection IDbConnection The connection to be used to execute the script.
fileName string The path to the script to be executed.
return void

ExecuteScript() public method

Executes a database script as the admin user.
public ExecuteScript ( string fileName ) : void
fileName string The path to the script to be executed.
return void

ExecuteStatement() public method

Executes the given statement using the given connection.
public ExecuteStatement ( IDbConnection connection, string statement ) : void
connection IDbConnection The connection used to execute the statement.
statement string The statement to be executed.
return void

ExecuteStatement() public method

Executes the given statement as the admin user.
public ExecuteStatement ( string statement ) : void
statement string The statement to be executed.
return void

GrantDatabaseAccess() public method

public GrantDatabaseAccess ( string loginName ) : void
loginName string
return void

OpenAdminConnection() public method

Opens a connection as the admin user.
public OpenAdminConnection ( IDbConnection &connection ) : void
connection IDbConnection The connection object to be created and opened.
return void

OpenConnection() public method

Opens a connection as the schema user.
public OpenConnection ( IDbConnection &connection ) : void
connection IDbConnection The connection object to be created and opened.
return void