parseCopyLine parses a line of COPY input
(line, delimiter string)
| 1347 | var rowsAff int64 |
| 1348 | if result != nil { |
| 1349 | rowsAff, _ = result.RowsAffected() |
| 1350 | } |
| 1351 | c.logWorkerStatementFinished(workerStatement, batchStart, rowsAff, err) |
| 1352 | if err != nil { |
| 1353 | return rowCount, fmt.Errorf("batch INSERT failed at rows %d-%d: %v", start+1, start+len(batch), err) |
| 1354 | } |
| 1355 | rowCount += len(batch) |
| 1356 | } |
| 1357 | |
| 1358 | return rowCount, nil |
| 1359 | } |
| 1360 | |
| 1361 | // parseBinaryCopyAndInsert parses PostgreSQL binary COPY format data and inserts rows. |
| 1362 | // Uses the DuckDB Appender API for full-column inserts (fast path), falling back to |
| 1363 | // batched multi-row INSERT for column subsets or unsupported types. |
| 1364 | func (c *clientConn) parseBinaryCopyAndInsert(data []byte, tableName, columnList string, cols []string, typeOIDs []int32) (int, error) { |