/// <summary> /// Clones a new DbConnection supported by this provider. /// </summary> /// <param name="connection">The connection to clone.</param> /// <returns>A new DbConnection.</returns> public override IDbConnection CloneDbConnection(IDbConnection connection) { if (connection == null) { throw new ArgumentNullException("connection"); } // clone the inner connection var innerConnection = GetInnerConnection(connection); var innerProvider = InsightDbProvider.For(innerConnection); var clonedInnerConnection = innerProvider.CloneDbConnection(innerConnection); var wrapper = new DbConnectionWrapper(); try { var clone = (DbConnectionWrapper)wrapper; clone.InnerConnection = (DbConnection)clonedInnerConnection; return(clone); } catch { wrapper.Dispose(); throw; } }
/// <inheritdoc/> public override InsightBulkCopyOptions GetSupportedBulkCopyOptions(IDbConnection connection) { connection = GetInnerConnection(connection); return(InsightDbProvider.For(connection).GetSupportedBulkCopyOptions(connection)); }
/// <inheritdoc/> public override void FixupParameter(IDbCommand command, IDataParameter parameter, DbType dbType, Type type, SerializationMode serializationMode) { command = GetInnerCommand(command); InsightDbProvider.For(command).FixupParameter(command, parameter, dbType, type, serializationMode); }
/// <inheritdoc/> public override CommandBehavior FixupCommandBehavior(IDbCommand command, CommandBehavior commandBehavior) { command = GetInnerCommand(command); return(InsightDbProvider.For(command).FixupCommandBehavior(command, commandBehavior)); }
/// <inheritdoc/> public override void FixupCommand(IDbCommand command) { command = GetInnerCommand(command); InsightDbProvider.For(command).FixupCommand(command); }
/// <summary> /// Derives the parameter list from a sql text command. /// </summary> /// <param name="command">The command to derive.</param> public override void DeriveParametersFromSqlText(IDbCommand command) { command = GetInnerCommand(command); InsightDbProvider.For(command).DeriveParametersFromSqlText(command); }
/// <summary> /// Derives the parameter list from a stored procedure command. /// </summary> /// <param name="command">The command to derive.</param> public override void DeriveParametersFromStoredProcedure(IDbCommand command) { command = GetInnerCommand(command); InsightDbProvider.For(command).DeriveParametersFromStoredProcedure(command); }
/// <summary> /// Derives the parameter list for a given command. /// </summary> /// <param name="command">The command to use.</param> /// <returns>The list of parameters for the command.</returns> public override IList <IDataParameter> DeriveParameters(IDbCommand command) { command = GetInnerCommand(command); return(InsightDbProvider.For(command).DeriveParameters(command)); }
/// <inheritdoc/> public override Task BulkCopyAsync(IDbConnection connection, string tableName, IDataReader reader, Action <InsightBulkCopy> configure, InsightBulkCopyOptions options, IDbTransaction transaction, CancellationToken cancellationToken) { connection = GetInnerConnection(connection); return(InsightDbProvider.For(connection).BulkCopyAsync(connection, tableName, reader, configure, options, transaction, cancellationToken)); }
/// <summary> /// Bulk copies a set of objects to the server. /// </summary> /// <param name="connection">The connection to use.</param> /// <param name="tableName">The name of the table.</param> /// <param name="reader">The reader to read objects from.</param> /// <param name="configure">A callback method to configure the bulk copy object.</param> /// <param name="options">Options for initializing the bulk copy object.</param> /// <param name="transaction">An optional transaction to participate in.</param> /// <remarks>Number of rows copied.</remarks> public override void BulkCopy(IDbConnection connection, string tableName, IDataReader reader, Action <InsightBulkCopy> configure, InsightBulkCopyOptions options, IDbTransaction transaction) { connection = GetInnerConnection(connection); InsightDbProvider.For(connection).BulkCopy(connection, tableName, reader, configure, options, transaction); }
/// <summary> /// Returns SQL that queries a table for the schema only, no rows. /// </summary> /// <param name="connection">The connection to use.</param> /// <param name="tableName">The name of the table to query.</param> /// <returns>SQL that queries a table for the schema only, no rows.</returns> public override string GetTableSchemaSql(IDbConnection connection, string tableName) { connection = GetInnerConnection(connection); return(InsightDbProvider.For(connection).GetTableSchemaSql(connection, tableName)); }
/// <summary> /// Set up a table-valued parameter to a procedure. /// </summary> /// <param name="command">The command to operate on.</param> /// <param name="parameter">The parameter to set up.</param> /// <param name="list">The list of records.</param> /// <param name="listType">The type of object in the list.</param> public override void SetupTableValuedParameter(IDbCommand command, IDataParameter parameter, IEnumerable list, Type listType) { command = GetInnerCommand(command); InsightDbProvider.For(command).SetupTableValuedParameter(command, parameter, list, listType); }
/// <summary> /// Determines if a parameter is a Table-valued parameter. /// </summary> /// <param name="command">The related command object.</param> /// <param name="parameter">The parameter to test.</param> /// <returns>True if the parameter is a table-valued parameter.</returns> public override bool IsTableValuedParameter(IDbCommand command, IDataParameter parameter) { command = GetInnerCommand(command); return(InsightDbProvider.For(command).IsTableValuedParameter(command, parameter)); }
/// <summary> /// Clones a parameter so that it can be used with another command. /// </summary> /// <param name="command">The command to use.</param> /// <param name="parameter">The parameter to clone.</param> /// <returns>The clone.</returns> public override IDataParameter CloneParameter(IDbCommand command, IDataParameter parameter) { command = GetInnerCommand(command); return(InsightDbProvider.For(command).CloneParameter(command, parameter)); }
/// <summary> /// Determines if the given column in the schema table is an XML column. /// </summary> /// <param name="command">The command associated with the reader.</param> /// <param name="schemaTable">The schema table to analyze.</param> /// <param name="index">The index of the column.</param> /// <returns>True if the column is an XML column.</returns> public override bool IsXmlColumn(IDbCommand command, DataTable schemaTable, int index) { command = GetInnerCommand(command); return(InsightDbProvider.For(command).IsXmlColumn(command, schemaTable, index)); }