<commit_before>package main

import (
	"context"
	"database/sql"
	"fmt"

	"github.com/coreos/etcd/clientv3"
	"github.com/coreos/etcd/clientv3/mirror"
)

type dbSyncer struct {
	table       string
	noOverwrite bool

	src  mirror.Syncer
	dest *sql.DB
}

func (ds *dbSyncer) sync(ctx context.Context) error {
	var (
		stmt  *sql.Stmt
		dstmt *sql.Stmt

		err error
	)

	if ds.noOverwrite {
		stmt, err = ds.dest.Prepare(fmt.Sprintf("INSERT INTO %s(key,event,value,revision) VALUES ($1,$2,$3,$4)", ds.table))
		if err != nil {
			return err<commit_msg>sync: more robust noOverwrite option<commit_after>package main

import (
	"context"
	"database/sql"
	"fmt"

	"github.com/coreos/etcd/clientv3"
	"github.com/coreos/etcd/clientv3/mirror"
)

type dbSyncer struct {
	table       string
	noOverwrite bool

	src  mirror.Syncer
	dest *sql.DB
}

func (ds *dbSyncer) sync(ctx context.Context) error {
	var (
		stmt  *sql.Stmt
		dstmt *sql.Stmt

		err error
	)

	if ds.noOverwrite {
		stmt, err = ds.dest.Prepare(fmt.Sprintf("INSERT INTO %s(key,event,value,revision) VALUES ($1,$2,$3,$4) ON CONFLICT(revision) DO NOTHING", ds.table))
		if err != nil {
			return err
{'fraction_non_alphanumeric': 0.1345486111111111, 'fraction_numerical': 0.010416666666666666, 'mean_word_length': 3.7448559670781894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7494942', 'n_tokens_mistral': 481, 'n_tokens_neox': 460, 'n_words': 101}