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: sql.go
    path of file: ./repos/rill/runtime/resolvers
    
    the code of the file until where you have to start completion: package resolvers

import (
	"context"
	"encoding/json"
	"fmt"
	"io"
	"time"

	"github.com/mitchellh/mapstructure"
	runtimev1 "github.com/rilldata/rill/proto/gen/rill/runtime/v1"
	"github.com/rilldata/rill/runtime"
	compilerv1 "github.com/rilldata/rill/runtime/compilers/rillv1"
	"github.com/rilldata/rill/runtime/drivers"
	"github.com/rilldata/rill/runtime/pkg/duckdbsql"
	"github.com/rilldata/rill/runtime/queries"
	"google.golang.org/protobuf/types/known/structpb"
)

func init() {
	runtime.RegisterResolverInitializer("SQL", newSQL)
}

type sqlResolver struct {
	sql         string
	refs        []*runtimev1.ResourceName
	olap        drivers.OLAPStore
	olapRelease func()
	priority    int
}

type sqlProps struct {
	
    
func (r *sqlResolver) ResolveExport(ctx context.Context, w io.Writer, opts *runtime.ResolverExportOptions) error {
	exportOpts := &runtime.ExportOptions{
		Format:       opts.Format,
		Priority:     r.priority,
		PreWriteHook: opts.PreWriteHook,
	}

	filename := "api_export_" + time.Now().Format("2006-01-02T15-04-05.000Z")

	switch r.olap.Dialect() {
	case drivers.DialectDuckDB:
		if opts.Format == runtimev1.ExportFormat_EXPORT_FORMAT_CSV || opts.Format == runtimev1.ExportFormat_EXPORT_FORMAT_PARQUET {
			return queries.DuckDBCopyExport(ctx, w, exportOpts, r.sql, nil, filename, r.olap, opts.Format)
		}
		return r.generalExport(ctx, w, filename, exportOpts)
	case drivers.DialectDruid, drivers.DialectClickHouse:
		return r.generalExport(ctx, w, filename, exportOpts)
	default:
		return fmt.Errorf("export not available for dialect %q", r.olap.Dialect().String())
	}
}