Appearance
IConnection Interface
Definition
Interface representing a Connection to a database
- Namespace:
JASE.Database - Assembly:
JASE.Database.dll
Properties
| Name | Description |
|---|---|
CommandHistory | Command Execution history for this Connnection |
CommandHistoryMaxSize | Maximum number of commands tracked in CommandHistory |
CommandHistoryTracking | Is command history tracking enabled on this connection? |
ConnectionString | Connection string used to establish the connection. Visibility is managed by Configuration.ExposeConnectionStrings |
ConnectionStringHash | SHA256 hash of the connection string |
DatabaseType | String representing the type of database |
Diagnostics | Diagnostic level for the current Connection |
GracefulReaderShutdown | Determines whether the connection should force-close open readers on close. |
InTransaction | Returns when the connection is in an existing TRANSACTION, otherwise |
IsOpen | Indicates if the connection is currently open. |
LastParameters | Read only array of the parameters used in the Last SQL statement |
LastSQL | The most recent SQL statement executed on the connection |
MaxParameters | Maximum number of parameters in a single statement supported by the current database |
SqlGenerator | A SqlGenerator for the currently connected database |
State | Current state of the underlying connection to the database |
Uuid | Unique identifier for the database connection |
Methods
| Name | Description |
|---|---|
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 |