Skip to content

IConnection Interface ​

Definition ​

Interface representing a Connection to a database

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Properties ​

NameDescription
CommandHistoryCommand Execution history for this Connnection
CommandHistoryMaxSizeMaximum number of commands tracked in CommandHistory
CommandHistoryTrackingIs command history tracking enabled on this connection?
ConnectionStringConnection string used to establish the connection. Visibility is managed by Configuration.ExposeConnectionStrings
ConnectionStringHashSHA256 hash of the connection string
DatabaseTypeString representing the type of database
DiagnosticsDiagnostic level for the current Connection
GracefulReaderShutdownDetermines whether the connection should force-close open readers on close.
InTransactionReturns when the connection is in an existing TRANSACTION, otherwise
IsOpenIndicates if the connection is currently open.
LastParametersRead only array of the parameters used in the Last SQL statement
LastSQLThe most recent SQL statement executed on the connection
MaxParametersMaximum number of parameters in a single statement supported by the current database
SqlGeneratorA SqlGenerator for the currently connected database
StateCurrent state of the underlying connection to the database
UuidUnique identifier for the database connection

Methods ​

NameDescription
void BeginTransaction(TransactionIsolation level = null)Begin a new TRANSACTION
int CalculateCommitInterval(int requestedInterval, int parameterCount)Calculate the max rows we can safely commit within a single statement based on a particular database server's ability to handle parameters
bool ChangeDatabase(string database)Change to the requested database
Task<bool> ChangeDatabaseAsync(string database)Change to the requested database
bool CheckDatabaseExist(string database)Check if the specified database exist
bool Close()Close connection to the database server
Task CloseAsync()Close the connection asynchronously.
void Commit()Commit the current TRANSACTION
Task CommitAsync()Commit the current TRANSACTION
bool CreateDatabase(string database)Create a new database
bool DropDatabase(string database)Execute a DROP command for the specified database
Guid GenerateUuid()Generate a UUID byte ordered for the current connection type
string GetCollation()Returns the Collation for the current connection
string GetCollation(string database)Returns the Collation for the current connection
Task<string> GetCollationAsync()Returns the Collation for the current connection
Task<string> GetCollationAsync(string database)Returns the Collation for the current connection
Type GetParameterType()Returns Type data for the connections underlying DbParameter implementation
int GetPid()Obtain the connections Process ID
Task<int> GetPidAsync()Obtain the connections Process ID
string GetVersion()Returns version of the current database in string format
Task<string> GetVersionAsync()Returns version of the current database in string format
bool IsDisposed()Returns true/false based on if the connection has been Disposed()
bool Open()Attempt to Open connection to the Database if it is not already in an Open state
Task<bool> OpenAsync(CancellationToken cancellationToken = null)Open the connection asynchronously if not already open.
void ReleaseSavepoint(string name)Releases a stored SAVEPOINT (noop on SQL Server)
void Rollback()Rollback current TRANSACTION
Task RollbackAsync()Rollback current TRANSACTION
void RollbackTo(string name)Rollback current TRANSACTION to a named SAVEPOINT
void Savepoint(string name)Create a SAVEPOINT within the current TRANSACTION