Skip to content

Commit aad952e

Browse files
committed
Update bulk copy documentation.
1 parent b7bf205 commit aad952e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/content/api/mysql-bulk-copy.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ The number of seconds for the operation to complete before it times out, or `0`
5454

5555
Name of the destination table on the server.
5656

57+
`public int NotifyAfter { get; set; }`
58+
59+
If non-zero, this defines the number of rows to be processed before generating a notification event.
60+
5761
### Methods
5862

5963
`public void WriteToServer(DataTable dataTable);`
@@ -65,8 +69,30 @@ Copies all rows in the supplied `DataTable` to the destination table specified b
6569

6670
***
6771

72+
`public void WriteToServer(IEnumerable<DataRow> dataRows, int columnCount)`
73+
74+
`public async Task WriteToServerAsync(IEnumerable<DataRow> dataRows, int columnCount, CancellationToken cancellationToken = default)`
75+
76+
Copies all rows in the supplied sequence of `DataRow` objects to the destination table specified by the `DestinationTableName` property of the `MySqlBulkCopy` object. The number of columns to be read from the `DataRow` objects must be specified in advance.
77+
(This method is not available on `netstandard1.3`.)
78+
79+
***
80+
6881
`public void WriteToServer(IDataReader dataReader);`
6982

7083
`public Task WriteToServerAsync(IDataReader dataReader, CancellationToken cancellationToken = default);`
7184

7285
Copies all rows in the supplied `IDataReader` to the destination table specified by the `DestinationTableName` property of the `MySqlBulkCopy` object.
86+
87+
### Events
88+
89+
`public event MySqlRowsCopiedEventHandler RowsCopied;`
90+
91+
If `NotifyAfter` is non-zero, this event will be raised every time the number of rows specified by
92+
`NotifyAfter` have been processed, and once after all rows have been copied (but duplicate events
93+
will not be raised).
94+
95+
Receipt of a `RowsCopied` event does not imply that any rows have been sent to the server or committed.
96+
97+
The `MySqlRowsCopiedEventArgs.Abort` property can be set to `true` by the event handler to abort
98+
the copy.

0 commit comments

Comments
 (0)