C# Class AliaSQL.Core.Services.Impl.QueryExecutor

Inheritance: IQueryExecutor
Exibir arquivo Open project: ClearMeasure/AliaSQL

Public Methods

Method Description
CheckDatabaseExists ( AliaSQL.Core.Model.ConnectionSettings settings ) : bool
DatabaseVersion ( AliaSQL.Core.Model.ConnectionSettings settings ) : int
ExecuteNonQuery ( AliaSQL.Core.Model.ConnectionSettings settings, string sql, bool includeDatabaseName = false ) : void

Runs queries that are not specific to a database such as Drop, Create, single user mode

ExecuteNonQueryTransactional ( AliaSQL.Core.Model.ConnectionSettings settings, string sql ) : void

Runs larger queries that may be multiline separated with GO Runs entire sql block in a single transaction that will rollback if any part of the query errors

ExecuteScalarInteger ( AliaSQL.Core.Model.ConnectionSettings settings, string sql ) : int
GetExecutedScripts ( AliaSQL.Core.Model.ConnectionSettings settings ) : List
GetExecutedTestDataScripts ( AliaSQL.Core.Model.ConnectionSettings settings ) : List
QueryExecutor ( ) : System
QueryExecutor ( IConnectionStringGenerator connectionStringGenerator ) : System
ReadFirstColumnAsStringArray ( AliaSQL.Core.Model.ConnectionSettings settings, string sql ) : string[]
ScriptSupportsTransactions ( string sql ) : bool

Some commands are not allowed inside transactions http://msdn.microsoft.com/en-us/library/ms191544.aspx

Private Methods

Method Description
SplitSqlStatements ( string sqlScript ) : IEnumerable

Method Details

CheckDatabaseExists() public method

public CheckDatabaseExists ( AliaSQL.Core.Model.ConnectionSettings settings ) : bool
settings AliaSQL.Core.Model.ConnectionSettings
return bool

DatabaseVersion() public method

public DatabaseVersion ( AliaSQL.Core.Model.ConnectionSettings settings ) : int
settings AliaSQL.Core.Model.ConnectionSettings
return int

ExecuteNonQuery() public method

Runs queries that are not specific to a database such as Drop, Create, single user mode
public ExecuteNonQuery ( AliaSQL.Core.Model.ConnectionSettings settings, string sql, bool includeDatabaseName = false ) : void
settings AliaSQL.Core.Model.ConnectionSettings
sql string
includeDatabaseName bool
return void

ExecuteNonQueryTransactional() public method

Runs larger queries that may be multiline separated with GO Runs entire sql block in a single transaction that will rollback if any part of the query errors
public ExecuteNonQueryTransactional ( AliaSQL.Core.Model.ConnectionSettings settings, string sql ) : void
settings AliaSQL.Core.Model.ConnectionSettings
sql string
return void

ExecuteScalarInteger() public method

public ExecuteScalarInteger ( AliaSQL.Core.Model.ConnectionSettings settings, string sql ) : int
settings AliaSQL.Core.Model.ConnectionSettings
sql string
return int

GetExecutedScripts() public method

public GetExecutedScripts ( AliaSQL.Core.Model.ConnectionSettings settings ) : List
settings AliaSQL.Core.Model.ConnectionSettings
return List

GetExecutedTestDataScripts() public method

public GetExecutedTestDataScripts ( AliaSQL.Core.Model.ConnectionSettings settings ) : List
settings AliaSQL.Core.Model.ConnectionSettings
return List

QueryExecutor() public method

public QueryExecutor ( ) : System
return System

QueryExecutor() public method

public QueryExecutor ( IConnectionStringGenerator connectionStringGenerator ) : System
connectionStringGenerator IConnectionStringGenerator
return System

ReadFirstColumnAsStringArray() public method

public ReadFirstColumnAsStringArray ( AliaSQL.Core.Model.ConnectionSettings settings, string sql ) : string[]
settings AliaSQL.Core.Model.ConnectionSettings
sql string
return string[]

ScriptSupportsTransactions() public method

Some commands are not allowed inside transactions http://msdn.microsoft.com/en-us/library/ms191544.aspx
public ScriptSupportsTransactions ( string sql ) : bool
sql string
return bool