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: ascode.go
    path of file: ./repos/cds/engine/api/action
    
    the code of the file until where you have to start completion: package action

import (
	"context"

	"github.com/rockbears/log"

	"github.com/ovh/cds/engine/gorpmapper"
	"github.com/ovh/cds/sdk"
)

func CreateAsCodeAction(ctx context.Context, db gorpmapper.SqlExecutorWithTx) error {
	nb, err := db.SelectInt(`
        SELECT count(id)
        FROM action
        WHERE action.type = $1`, sdk.AsCodeAction)
	if err != nil {
		return sdk.WrapError(err, "unable to get ascode action")
	}

	// If the action doesn't exist, let's create
	if nb == 0 {
		log.Debug(ctx, "CreateAsC
    
func CreateAsCodeAction(ctx context.Context, db gorpmapper.SqlExecutorWithTx) error {
	nb, err := db.SelectInt(`
        SELECT count(id)
        FROM action
        WHERE action.type = $1`, sdk.AsCodeAction)
	if err != nil {
		return sdk.WrapError(err, "unable to get ascode action")
	}

	// If the action doesn't exist, let's create
	if nb == 0 {
		log.Debug(ctx, "CreateAsCodeAction> create ascode action")
		act := sdk.Action{
			Type:    sdk.AsCodeAction,
			Name:    "AsCodeAction",
			Enabled: true,
		}
		if err := Insert(db, &act); err != nil {
			return err
		}
		return nil
	}
	return nil
}