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: run.go
    path of file: ./repos/prisma-client-go/generator
    
    the code of the file until where you have to start completion: // Package generator acts as a prisma generator
package generator

import (
	"bytes"
	"embed"
	"fmt"
	"go/format"
	"os"
	"path"
	"str
    
func generateClient(input *Root) error {
	var buf bytes.Buffer

	// manually define the order of the templates for consistent output
	files := []string{
		"_header",
		"client",
		"enums",
		"errors",
		"fields",
		"mock",
		"models",
		"query",
		"actions/actions",
		"actions/create",
		"actions/find",
		"actions/transaction",
		"actions/upsert",
	}

	var templates []*template.Template
	for _, file := range files {
		t, err := template.ParseFS(templateFS, "templates/"+file+".gotpl")
		if err != nil {
			return fmt.Errorf("could not parse template fs: %w", err)
		}
		templates = append(templates, t)
	}

	// Then process all remaining templates
	for _, tpl := range templates {
		buf.Write([]byte(fmt.Sprintf("// --- template %s ---\n", tpl.Name())))

		if err := tpl.Execute(&buf, input); err != nil {
			return fmt.Errorf("could not write template file %s: %w", tpl.Name(), err)
		}

		if _, err := format.Source(buf.Bytes()); err != nil {
			return fmt.Errorf("could not format source %s from file %s %s: %w", buf.String(), tpl.Name(), input.SchemaPath, err)
		}
	}

	formatted, err := format.Source(buf.Bytes())
	if err != nil {
		return fmt.Errorf("could not format final source: %w", err)
	}

	output := input.Generator.Output.Value

	if strings.HasSuffix(output, ".go") {
		return fmt.Errorf("generator output should be a directory")
	}

	if err := os.MkdirAll(output, os.ModePerm); err != nil {
		return fmt.Errorf("could not run MkdirAll on path %s: %w", output, err)
	}

	// TODO make this configurable
	outFile := path.Join(output, "db_gen.go")
	if err := os.WriteFile(outFile, formatted, 0644); err != nil {
		return fmt.Errorf("could not write template data to file writer %s: %w", outFile, err)
	}

	return nil
}