fix: ClickHouse insertion using native clickhouse-go/v2 API
- Replace database/sql wrapper with clickhouse.Open() and clickhouse.Conn - Use PrepareBatch + Append + Send pattern for proper batch inserts - Fix ATTEMPT_TO_READ_AFTER_EOF errors caused by empty VALUES - Add batch size logging for debugging - Update version to 1.1.5 Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@ -23,8 +23,7 @@ RUN go mod download || true
|
||||
COPY . .
|
||||
|
||||
# Run tests with coverage (fail if < 80%)
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
go test -race -coverprofile=coverage.txt -covermode=atomic ./... && \
|
||||
RUN go test -race -coverprofile=coverage.txt -covermode=atomic ./... && \
|
||||
echo "=== Coverage Report ===" && \
|
||||
go tool cover -func=coverage.txt | grep total && \
|
||||
TOTAL=$(go tool cover -func=coverage.txt | grep total | awk '{gsub(/%/, "", $3); print $3}') && \
|
||||
@ -36,8 +35,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
echo "Coverage check passed!"
|
||||
|
||||
# Build binary
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-ldflags="-w -s" \
|
||||
-o /usr/bin/logcorrelator \
|
||||
./cmd/logcorrelator
|
||||
|
||||
Reference in New Issue
Block a user