You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dml.go
    path of file: ./repos/agola/internal/services/notification/db
    
    the code of the file until where you have to start completion: // Code generated by go generate; DO NOT EDIT.
package db

import (
	"encoding/json"
	"fmt"
	stdsql "database/sql"
	"time"

	"github.com/sorintlab/errors"
	sq "github.com/huandu/go-sqlbuilder"

	"agola.io/agola/internal/sqlg"
	"agola.io/agola/internal/sqlg/sql"

	types "agola.io/agola/services/notification/types"
)

var (
	runWebhookSelectColumns = func(additionalCols ...string) []string {
		columns := []string{"runwebhook.id", "runwebhook.revision", "runwebhook.creation_time", "runwebhook.update_time", "runwebhook.payload", "runwebhook.project_id"}
		columns = append(columns, additionalCols...)

		return col
    
func (d *DB) InsertRunWebhookDelivery(tx *sql.Tx, v *types.RunWebhookDelivery) error {
	if v.Revision != 0 {
		return errors.Errorf("expected revision 0 got %d", v.Revision)
	}

	if v.TxID != tx.ID() {
		return errors.Errorf("object was not created by this transaction")
	}

	v.Revision = 1

	now := time.Now()
	v.CreationTime = now
	v.UpdateTime = now

	var err error
	var nextSeq uint64

	nextSeq, err = d.nextSequence(tx, "runwebhookdelivery_sequence_seq")
	if err != nil {
		v.Revision = 0
		return errors.Wrap(err, "failed to create next sequence for runwebhookdelivery_sequence_seq")
	}
	v.Sequence = nextSeq

	switch d.DBType() {
	case sql.Postgres:
		err = d.insertRawRunWebhookDeliveryPostgres(tx, v);
	case sql.Sqlite3:
		err = d.insertRunWebhookDeliverySqlite3(tx, v);
	}

	if err != nil {
		v.Revision = 0
		return errors.Wrap(err, "failed to insert runwebhookdelivery")
	}

	return nil
}