C# Class SimpleMigrations.DatabaseProvider.PostgresqlDatabaseProvider

Class which can read from / write to a version table in an PostgreSQL database
PostgreSQL supports advisory locks, so these are used to guard against concurrent migrators.
Inheritance: DatabaseProviderBaseWithAdvisoryLock
ファイルを表示 Open project: canton7/SimpleMigrations

Public Methods

Method Description
AcquireAdvisoryLock ( ) : void

Acquires an advisory lock using Connection

GetCreateVersionTableSql ( ) : string

Returns SQL to create the version table

GetCurrentVersionSql ( ) : string

Returns SQL to fetch the current version from the version table

GetSetVersionSql ( ) : string

Returns SQL to update the current version in the version table

PostgresqlDatabaseProvider ( DbConnection connection ) : System.Data.Common

Initialises a new instance of the PostgresqlDatabaseProvider class

ReleaseAdvisoryLock ( ) : void

Releases the advisory lock held on Connection

Method Details

AcquireAdvisoryLock() public method

Acquires an advisory lock using Connection
public AcquireAdvisoryLock ( ) : void
return void

GetCreateVersionTableSql() public method

Returns SQL to create the version table
public GetCreateVersionTableSql ( ) : string
return string

GetCurrentVersionSql() public method

Returns SQL to fetch the current version from the version table
public GetCurrentVersionSql ( ) : string
return string

GetSetVersionSql() public method

Returns SQL to update the current version in the version table
public GetSetVersionSql ( ) : string
return string

PostgresqlDatabaseProvider() public method

Initialises a new instance of the PostgresqlDatabaseProvider class
public PostgresqlDatabaseProvider ( DbConnection connection ) : System.Data.Common
connection System.Data.Common.DbConnection Connection to use to run migrations. The caller is responsible for closing this.
return System.Data.Common

ReleaseAdvisoryLock() public method

Releases the advisory lock held on Connection
public ReleaseAdvisoryLock ( ) : void
return void