MCPcopy Create free account
hub / github.com/PostHog/duckgres / parseCopyLine

Method parseCopyLine

server/conn_copy.go:1349–1361  ·  view source on GitHub ↗

parseCopyLine parses a line of COPY input

(line, delimiter string)

Source from the content-addressed store, hash-verified

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.
1364func (c *clientConn) parseBinaryCopyAndInsert(data []byte, tableName, columnList string, cols []string, typeOIDs []int32) (int, error) {

Callers 1

TestParseCopyLineFunction · 0.95

Calls 1

ReadMethod · 0.45

Tested by 1

TestParseCopyLineFunction · 0.76