Class BasicBulkCopy
- Namespace
- LinqToDB.Internal.DataProvider
- Assembly
- linq2db.dll
public class BasicBulkCopy
- Inheritance
-
objectBasicBulkCopy
- Derived
- Extension Methods
Properties
CastAllRowsParametersOnUnionAll
protected virtual bool CastAllRowsParametersOnUnionAll { get; }
Property Value
CastFirstRowLiteralOnUnionAll
protected virtual bool CastFirstRowLiteralOnUnionAll { get; }
Property Value
CastFirstRowParametersOnUnionAll
protected virtual bool CastFirstRowParametersOnUnionAll { get; }
Property Value
MaxMultipleRows
protected virtual int? MaxMultipleRows { get; }
Property Value
- int?
MaxParameters
protected virtual int MaxParameters { get; }
Property Value
MaxSqlLength
protected virtual int MaxSqlLength { get; }
Property Value
MultipleRowsConvertToParameter
protected virtual Func<DataOptions, DbDataType, object?, bool>? MultipleRowsConvertToParameter { get; }
Property Value
- Func<DataOptions, DbDataType, object, bool>
Methods
BulkCopyAsync<T>(BulkCopyType, ITable<T>, DataOptions, IAsyncEnumerable<T>, CancellationToken)
public virtual Task<BulkCopyRowsCopied> BulkCopyAsync<T>(BulkCopyType bulkCopyType, ITable<T> table, DataOptions options, IAsyncEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
bulkCopyTypeBulkCopyTypetableITable<T>optionsDataOptionssourceIAsyncEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
BulkCopyAsync<T>(BulkCopyType, ITable<T>, DataOptions, IEnumerable<T>, CancellationToken)
public virtual Task<BulkCopyRowsCopied> BulkCopyAsync<T>(BulkCopyType bulkCopyType, ITable<T> table, DataOptions options, IEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
bulkCopyTypeBulkCopyTypetableITable<T>optionsDataOptionssourceIEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
BulkCopy<T>(BulkCopyType, ITable<T>, DataOptions, IEnumerable<T>)
public virtual BulkCopyRowsCopied BulkCopy<T>(BulkCopyType bulkCopyType, ITable<T> table, DataOptions options, IEnumerable<T> source) where T : notnull
Parameters
bulkCopyTypeBulkCopyTypetableITable<T>optionsDataOptionssourceIEnumerable<T>
Returns
Type Parameters
T
CastLiteral(ColumnDescriptor)
protected virtual bool CastLiteral(ColumnDescriptor column)
Parameters
columnColumnDescriptor
Returns
GetInsertInto(MultipleRowsHelper)
Returns the INSERT INTO {tableName} fragment used at the start of bulk INSERT statements in MultipleRows bulk copy mode.
Override in provider-specific bulk copy classes to inject directives between INSERT and INTO, such as OR IGNORE.
protected virtual string GetInsertInto(MultipleRowsHelper helper)
Parameters
helperMultipleRowsHelper
Returns
GetMultipleRowsSuffix(BulkCopyOptions)
Returns an optional SQL suffix appended after the INSERT ... VALUES statement in MultipleRows bulk copy mode.
Override in provider-specific bulk copy classes to append clauses such as ON CONFLICT DO NOTHING.
protected virtual string? GetMultipleRowsSuffix(BulkCopyOptions options)
Parameters
optionsBulkCopyOptions
Returns
GetTableName<T>(ISqlBuilder, BulkCopyOptions, ITable<T>, bool)
protected static string GetTableName<T>(ISqlBuilder sqlBuilder, BulkCopyOptions options, ITable<T> table, bool escaped = true) where T : notnull
Parameters
sqlBuilderISqlBuilderoptionsBulkCopyOptionstableITable<T>escapedbool
Returns
Type Parameters
T
MultipleRowsCopy1(MultipleRowsHelper, IEnumerable)
protected BulkCopyRowsCopied MultipleRowsCopy1(MultipleRowsHelper helper, IEnumerable source)
Parameters
helperMultipleRowsHelpersourceIEnumerable
Returns
MultipleRowsCopy1Async(MultipleRowsHelper, IEnumerable, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy1Async(MultipleRowsHelper helper, IEnumerable source, CancellationToken cancellationToken)
Parameters
helperMultipleRowsHelpersourceIEnumerablecancellationTokenCancellationToken
Returns
MultipleRowsCopy1Async<T>(ITable<T>, DataOptions, IAsyncEnumerable<T>, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy1Async<T>(ITable<T> table, DataOptions options, IAsyncEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIAsyncEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopy1Async<T>(ITable<T>, DataOptions, IEnumerable<T>, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy1Async<T>(ITable<T> table, DataOptions options, IEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopy1Async<T>(MultipleRowsHelper, IAsyncEnumerable<T>, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy1Async<T>(MultipleRowsHelper helper, IAsyncEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
helperMultipleRowsHelpersourceIAsyncEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopy1<T>(ITable<T>, DataOptions, IEnumerable<T>)
protected BulkCopyRowsCopied MultipleRowsCopy1<T>(ITable<T> table, DataOptions options, IEnumerable<T> source) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>
Returns
Type Parameters
T
MultipleRowsCopy2(MultipleRowsHelper, IEnumerable, string)
protected BulkCopyRowsCopied MultipleRowsCopy2(MultipleRowsHelper helper, IEnumerable source, string from)
Parameters
helperMultipleRowsHelpersourceIEnumerablefromstring
Returns
MultipleRowsCopy2Async(MultipleRowsHelper, IEnumerable, string, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy2Async(MultipleRowsHelper helper, IEnumerable source, string from, CancellationToken cancellationToken)
Parameters
helperMultipleRowsHelpersourceIEnumerablefromstringcancellationTokenCancellationToken
Returns
MultipleRowsCopy2Async<T>(ITable<T>, DataOptions, IAsyncEnumerable<T>, string, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy2Async<T>(ITable<T> table, DataOptions options, IAsyncEnumerable<T> source, string from, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIAsyncEnumerable<T>fromstringcancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopy2Async<T>(ITable<T>, DataOptions, IEnumerable<T>, string, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy2Async<T>(ITable<T> table, DataOptions options, IEnumerable<T> source, string from, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>fromstringcancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopy2Async<T>(MultipleRowsHelper, IAsyncEnumerable<T>, string, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy2Async<T>(MultipleRowsHelper helper, IAsyncEnumerable<T> source, string from, CancellationToken cancellationToken) where T : notnull
Parameters
helperMultipleRowsHelpersourceIAsyncEnumerable<T>fromstringcancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopy2<T>(ITable<T>, DataOptions, IEnumerable<T>, string)
protected BulkCopyRowsCopied MultipleRowsCopy2<T>(ITable<T> table, DataOptions options, IEnumerable<T> source, string from) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>fromstring
Returns
Type Parameters
T
MultipleRowsCopy3(MultipleRowsHelper, IEnumerable, string)
protected BulkCopyRowsCopied MultipleRowsCopy3(MultipleRowsHelper helper, IEnumerable source, string from)
Parameters
helperMultipleRowsHelpersourceIEnumerablefromstring
Returns
MultipleRowsCopy3Async(MultipleRowsHelper, IEnumerable, string, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy3Async(MultipleRowsHelper helper, IEnumerable source, string from, CancellationToken cancellationToken)
Parameters
helperMultipleRowsHelpersourceIEnumerablefromstringcancellationTokenCancellationToken
Returns
MultipleRowsCopy3Async<T>(MultipleRowsHelper, IAsyncEnumerable<T>, string, CancellationToken)
protected Task<BulkCopyRowsCopied> MultipleRowsCopy3Async<T>(MultipleRowsHelper helper, IAsyncEnumerable<T> source, string from, CancellationToken cancellationToken) where T : notnull
Parameters
helperMultipleRowsHelpersourceIAsyncEnumerable<T>fromstringcancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopyAsync<T>(ITable<T>, DataOptions, IAsyncEnumerable<T>, CancellationToken)
protected virtual Task<BulkCopyRowsCopied> MultipleRowsCopyAsync<T>(ITable<T> table, DataOptions options, IAsyncEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIAsyncEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopyAsync<T>(ITable<T>, DataOptions, IEnumerable<T>, CancellationToken)
protected virtual Task<BulkCopyRowsCopied> MultipleRowsCopyAsync<T>(ITable<T> table, DataOptions options, IEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
MultipleRowsCopyHelper(MultipleRowsHelper, IEnumerable, string?, Action<MultipleRowsHelper>, Action<MultipleRowsHelper, object, string?>, Action<MultipleRowsHelper>, int, int)
protected static BulkCopyRowsCopied MultipleRowsCopyHelper(MultipleRowsHelper helper, IEnumerable source, string? from, Action<MultipleRowsHelper> prepFunction, Action<MultipleRowsHelper, object, string?> addFunction, Action<MultipleRowsHelper> finishFunction, int maxParameters, int maxSqlLength)
Parameters
helperMultipleRowsHelpersourceIEnumerablefromstringprepFunctionAction<MultipleRowsHelper>addFunctionAction<MultipleRowsHelper, object, string>finishFunctionAction<MultipleRowsHelper>maxParametersintmaxSqlLengthint
Returns
MultipleRowsCopyHelperAsync(MultipleRowsHelper, IEnumerable, string?, Action<MultipleRowsHelper>, Action<MultipleRowsHelper, object, string?>, Action<MultipleRowsHelper>, CancellationToken, int, int)
protected static Task<BulkCopyRowsCopied> MultipleRowsCopyHelperAsync(MultipleRowsHelper helper, IEnumerable source, string? from, Action<MultipleRowsHelper> prepFunction, Action<MultipleRowsHelper, object, string?> addFunction, Action<MultipleRowsHelper> finishFunction, CancellationToken cancellationToken, int maxParameters, int maxSqlLength)
Parameters
helperMultipleRowsHelpersourceIEnumerablefromstringprepFunctionAction<MultipleRowsHelper>addFunctionAction<MultipleRowsHelper, object, string>finishFunctionAction<MultipleRowsHelper>cancellationTokenCancellationTokenmaxParametersintmaxSqlLengthint
Returns
MultipleRowsCopyHelperAsync<T>(MultipleRowsHelper, IAsyncEnumerable<T>, string?, Action<MultipleRowsHelper>, Action<MultipleRowsHelper, object, string?>, Action<MultipleRowsHelper>, CancellationToken, int, int)
protected static Task<BulkCopyRowsCopied> MultipleRowsCopyHelperAsync<T>(MultipleRowsHelper helper, IAsyncEnumerable<T> source, string? from, Action<MultipleRowsHelper> prepFunction, Action<MultipleRowsHelper, object, string?> addFunction, Action<MultipleRowsHelper> finishFunction, CancellationToken cancellationToken, int maxParameters, int maxSqlLength)
Parameters
helperMultipleRowsHelpersourceIAsyncEnumerable<T>fromstringprepFunctionAction<MultipleRowsHelper>addFunctionAction<MultipleRowsHelper, object, string>finishFunctionAction<MultipleRowsHelper>cancellationTokenCancellationTokenmaxParametersintmaxSqlLengthint
Returns
Type Parameters
T
MultipleRowsCopy<T>(ITable<T>, DataOptions, IEnumerable<T>)
protected virtual BulkCopyRowsCopied MultipleRowsCopy<T>(ITable<T> table, DataOptions options, IEnumerable<T> source) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>
Returns
Type Parameters
T
ProviderSpecificCopyAsync<T>(ITable<T>, DataOptions, IAsyncEnumerable<T>, CancellationToken)
protected virtual Task<BulkCopyRowsCopied> ProviderSpecificCopyAsync<T>(ITable<T> table, DataOptions options, IAsyncEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIAsyncEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
ProviderSpecificCopyAsync<T>(ITable<T>, DataOptions, IEnumerable<T>, CancellationToken)
protected virtual Task<BulkCopyRowsCopied> ProviderSpecificCopyAsync<T>(ITable<T> table, DataOptions options, IEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
ProviderSpecificCopy<T>(ITable<T>, DataOptions, IEnumerable<T>)
protected virtual BulkCopyRowsCopied ProviderSpecificCopy<T>(ITable<T> table, DataOptions options, IEnumerable<T> source) where T : notnull
Parameters
tableITable<T>optionsDataOptionssourceIEnumerable<T>
Returns
Type Parameters
T
RowByRowCopyAsync<T>(ITable<T>, DataOptions, IAsyncEnumerable<T>, CancellationToken)
protected virtual Task<BulkCopyRowsCopied> RowByRowCopyAsync<T>(ITable<T> table, DataOptions dataOptions, IAsyncEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>dataOptionsDataOptionssourceIAsyncEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
RowByRowCopyAsync<T>(ITable<T>, DataOptions, IEnumerable<T>, CancellationToken)
protected virtual Task<BulkCopyRowsCopied> RowByRowCopyAsync<T>(ITable<T> table, DataOptions dataOptions, IEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
tableITable<T>dataOptionsDataOptionssourceIEnumerable<T>cancellationTokenCancellationToken
Returns
Type Parameters
T
RowByRowCopy<T>(ITable<T>, DataOptions, IEnumerable<T>)
protected BulkCopyRowsCopied RowByRowCopy<T>(ITable<T> table, DataOptions dataOptions, IEnumerable<T> source) where T : notnull
Parameters
tableITable<T>dataOptionsDataOptionssourceIEnumerable<T>
Returns
Type Parameters
T
TraceAction(DataConnection, Func<string>, Func<int>)
protected void TraceAction(DataConnection dataConnection, Func<string> commandText, Func<int> action)
Parameters
dataConnectionDataConnectioncommandTextFunc<string>actionFunc<int>
TraceActionAsync(DataConnection, Func<string>, Func<Task<int>>)
protected Task TraceActionAsync(DataConnection dataConnection, Func<string> commandText, Func<Task<int>> action)