Skip to content

Commit e22153c

Browse files
authored
Merge pull request #470 from Nirf808/fix-readme-batch-insert
Fix outdated batch insertion example in README
2 parents 1024efe + 1f7d4e7 commit e22153c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ target_link_libraries(${PROJECT_NAME} PRIVATE clickhouse-cpp-lib)
160160
## Batch Insertion
161161

162162
In addition to the `Insert` method, which inserts all the data in a block in a
163-
single call, you can use the `BeginInsert` / `InsertData` / `EndInsert`
163+
single call, you can use the `BeginInsert` / `SendInsertBlock` / `EndInsert`
164164
pattern to insert batches of data. This can be useful for managing larger data
165165
sets without inflating memory with the entire set.
166166

167167
To use it pass `BeginInsert` an `INSERT` statement ending in `VALUES` but with
168168
no actual values. Use the resulting `Block` to append batches of data, sending
169-
each to the sever with `InsertData`. Finally, call `EndInsert` (or let the
169+
each to the sever with `SendInsertBlock`. Finally, call `EndInsert` (or let the
170170
client go out of scope) to signal the server that insertion is complete.
171171
Example:
172172

@@ -186,7 +186,7 @@ col2.Append("naomi");
186186

187187
// Send those records.
188188
block.RefreshRowCount();
189-
client->InsertData(block);
189+
client->SendInsertBlock(block);
190190
block.Clear();
191191

192192
// Add another record.
@@ -195,7 +195,7 @@ col2.Append("amos");
195195

196196
// Send it and finish.
197197
block.RefreshRowCount();
198-
client->EndInsert(block);
198+
client->EndInsert();
199199
```
200200
201201
## Thread-safety

0 commit comments

Comments
 (0)