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: columns.go
    path of file: ./repos/corteza/server/store/adapters/rdbms/drivers
    
    the code of the file until where you have to start completion: package drivers

import (
	"database/sql"
	"encoding/json"
	"fmt"
	"github.com/cortezaproject/corteza/server/pkg/dal"
	"github.com/cortezaproject/corteza/server/pkg/errors"
	"github.com/spf13/cast"
	"github.com/valyala/fastjson"
)

type (
	Column interface {
		Name() string
		Attribute() *dal.Attribute
		IsPrimaryKey() bool
		Encode(dal.ValueGetter) (any, error)
		Decode(any, dal.ValueSetter) e
    
func (c *SimpleJsonDocColumn) Decode(raw any, r dal.ValueSetter) (err error) {
	rawJson, is := raw.(*sql.RawBytes)
	if !is {
		return fmt.Errorf("incompatible input value type (%T), expecting *sql.RawBytes", raw)
	}

	if len(*rawJson) == 0 {
		// gracefully handle empty strings as valid input
		return
	}

	var (
		root, auxvv *fastjson.Value
		vv          []*fastjson.Value
		v           string
		obj         *fastjson.Object
	)

	if root, err = fastjson.ParseBytes(*rawJson); err != nil {
		return
	}

	if root.Type() == fastjson.TypeNull {
		// ignore NULL
		return
	}

	if root.Type() != fastjson.TypeObject {
		return errors.InvalidData("expecting valid JSON object for record-values")
	}

	if obj, err = root.Object(); err != nil {
		return
	}

	for _, attr := range c.attributes {
		auxvv = obj.Get(attr.Ident)
		if auxvv == nil {
			// no values for the attribute
			continue
		}

		if auxvv.Type() == fastjson.TypeNull {
			// ignore NULL
			return
		}

		if auxvv.Type() != fastjson.TypeArray {
			return errors.InvalidData("expecting valid JSON array for record-values at key %s, got %s", attr.Ident, root.Type())
		}

		if vv, err = auxvv.Array(); err != nil {
			return
		}

		for pos, val := range vv {
			switch val.Type() {
			case fastjson.TypeString:
				v = string(val.GetStringBytes())
			default:
				v = val.String()
			}

			switch attr.Type.(type) {
			case *dal.TypeBoolean:
				// for backward compatibility reasons
				// we need to cast true bool values to "1"
				// and use "" for other (false) values
				if cast.ToBool(v) {
					v = "1"
				} else {
					v = ""
				}
			}

			if err = r.SetValue(attr.Ident, uint(pos), v); err != nil {
				return
			}

			if !attr.MultiValue {
				// model attribute supports storing of single values only.
				break
			}
		}
	}

	return
}