Class MetaDBConnection
Represents a decorator for System.Data.Common.DbConnection that wraps an underlying
DuckDB connection and intercepts command creation.
Namespace: Workspace.XBR.Xperiflow.MetaDB
Assembly: Xperiflow.dll
public class MetaDBConnection : DbConnection, IComponent, IDbConnection, IDisposable, IAsyncDisposable
Inheritance: System.Object -> System.MarshalByRefObject -> System.ComponentModel.Component -> System.Data.Common.DbConnection
Remarks
This class acts as a wrapper around an existing System.Data.Common.DbConnection,
providing additional query parsing functionality when commands are created.
Implements:
System.ComponentModel.IComponent, System.Data.IDbConnection, System.IDisposable, System.IAsyncDisposable
Properties
ConnectionString
When overridden in a derived class, gets or sets the string used to open the connection.
public override string ConnectionString { get; set; }
Database
When overridden in a derived class, gets the name of the current database after a connection is opened, or the database name specified in the connection string before the connection is opened.
public override string Database { get; }
DataSource
When overridden in a derived class, gets the name of the database server to which to connect.
public override string DataSource { get; }
ServerVersion
When overridden in a derived class, gets a string that represents the version of the server to which the object is connected.
public override string ServerVersion { get; }
State
Gets a string that describes the state of the connection.
public override ConnectionState State { get; }
Methods
ChangeDatabase(string)
When overridden in a derived class, changes the current database for an open connection.
public override void ChangeDatabase(string databaseName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | databaseName | The name of the database for the connection to use. |
Open()
When overridden in a derived class, opens a database connection with the settings specified by the System.Data.Common.DbConnection.ConnectionString.
public override void Open()
Close()
When overridden in a derived class, closes the connection to the database.
public override void Close()
BeginDbTransaction(IsolationLevel)
When overridden in a derived class, starts a database transaction.
protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
Returns
System.Data.Common.DbTransaction
An object representing the new transaction.
Parameters
| Type | Name | Description |
|---|---|---|
System.Data.IsolationLevel | isolationLevel | One of the enumeration values that specifies the isolation level for the transaction to use. |
CreateDbCommand()
Creates and returns a new database command wrapped in a Workspace.XBR.Xperiflow.MetaDB.MetaDBCommand.
protected override DbCommand CreateDbCommand()
Remarks
Instead of returning the raw command from the underlying connection, this method decorates it with Workspace.XBR.Xperiflow.MetaDB.MetaDBCommand to enable additional query parsing before execution.
Returns
System.Data.Common.DbCommand
A wrapped System.Data.Common.DbCommand instance.
Dispose(bool)
Releases the unmanaged resources used by the System.ComponentModel.Component and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Implements
System.ComponentModel.IComponentSystem.Data.IDbConnectionSystem.IDisposableSystem.IAsyncDisposable
Inherited Members
System.Data.Common.DbConnection.BeginDbTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)System.Data.Common.DbConnection.BeginTransactionSystem.Data.Common.DbConnection.BeginTransaction(System.Data.IsolationLevel)System.Data.Common.DbConnection.BeginTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)System.Data.Common.DbConnection.BeginTransactionAsync(System.Threading.CancellationToken)System.Data.Common.DbConnection.ChangeDatabaseAsync(System.String,System.Threading.CancellationToken)System.Data.Common.DbConnection.CloseAsyncSystem.Data.Common.DbConnection.CreateBatchSystem.Data.Common.DbConnection.CreateDbBatchSystem.Data.Common.DbConnection.CreateCommandSystem.Data.Common.DbConnection.DisposeAsyncSystem.Data.Common.DbConnection.EnlistTransaction(System.Transactions.Transaction)System.Data.Common.DbConnection.GetSchemaSystem.Data.Common.DbConnection.GetSchema(System.String)System.Data.Common.DbConnection.GetSchema(System.String,System.String[])System.Data.Common.DbConnection.GetSchemaAsync(System.Threading.CancellationToken)System.Data.Common.DbConnection.GetSchemaAsync(System.String,System.Threading.CancellationToken)System.Data.Common.DbConnection.GetSchemaAsync(System.String,System.String[],System.Threading.CancellationToken)System.Data.Common.DbConnection.OnStateChange(System.Data.StateChangeEventArgs)System.Data.Common.DbConnection.OpenAsyncSystem.Data.Common.DbConnection.OpenAsync(System.Threading.CancellationToken)System.Data.Common.DbConnection.ConnectionTimeoutSystem.Data.Common.DbConnection.DbProviderFactorySystem.Data.Common.DbConnection.CanCreateBatchSystem.Data.Common.DbConnection.StateChangeSystem.ComponentModel.Component.DisposeSystem.ComponentModel.Component.GetService(System.Type)System.ComponentModel.Component.ToStringSystem.ComponentModel.Component.CanRaiseEventsSystem.ComponentModel.Component.ContainerSystem.ComponentModel.Component.DesignModeSystem.ComponentModel.Component.EventsSystem.ComponentModel.Component.SiteSystem.ComponentModel.Component.DisposedSystem.MarshalByRefObject.GetLifetimeServiceSystem.MarshalByRefObject.InitializeLifetimeServiceSystem.MarshalByRefObject.MemberwiseClone(System.Boolean)System.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseCloneSystem.Object.ReferenceEquals(System.Object,System.Object)