func (b Bool) MarshalText() ([]byte, error) {
	if b {
		return []byte("true"), nil
	}
	return []byte("false"), nil
}
MarshalText converts the bool to a human readable representation, that is
also compatible with the JSON format.
package sqlutil  
import (
	"database/sql/driver"
	"fmt"
	"html/template"
	"strconv"
	"strings"
	"github.com/teamwork/utils/sliceutil"
)
type IntList []int64
func (l IntList) Value() (driver.Value, error) {
	return sliceutil.JoinInt(l), nil
}
func (l *IntList) Scan(v interface{}) error {
	if v == nil {
		return nil
	}
	ints := []int64{}
	for _, i := range strings.Split(fmt.Sprintf("%s", v), ",") {
		i = strings.TrimSpace(i)
		if i == "" {
			continue
		}
		in, err := strconv.ParseInt(i, 10, 64)
		if err != nil {
			return err
		}
		ints = append(ints, in)
	}
	*l = ints
	return nil
}
type StringList []string
func (l StringList) Value() (driver.Value, error) {
	return strings.Join(sliceutil.FilterString(l, sliceutil.FilterStringEmpty), ","), nil
}
func (l *StringList) Scan(v interface{}) error {
	if v == nil {
		return nil
	}
	strs := []string{}
	for _, s := range strings.Split(fmt.Sprintf("%s", v), ",") {
		s = strings.TrimSpace(s)
		if s == "" {
			continue
		}
		strs = append(strs, s)
	}
	*l = strs
	return nil
}
type Bool bool
func (b *Bool) Scan(src interface{}) error {
	if b == nil {
		return fmt.Errorf("boolean not initialized")
	}
	switch v := src.(type) {
	case int64:
		*b = v != 0
	case float64:
		*b = v != 0
	case bool:
		*b = Bool(v)
	case []byte, string:
		var text string
		if raw, ok := v.([]byte); ok {
			if len(raw) == 1 {
				if raw[0] == 0x1 {
					*b = true
					return nil
				} else if raw[0] == 0x0 {
					*b = false
					return nil
				}
			}
			text = string(raw)
		} else {
			text = v.(string)
		}
		text = strings.TrimSpace(strings.ToLower(text))
		switch text {
		case "true", "1":
			*b = true
		case "false", "0":
			*b = false
		default:
			return fmt.Errorf("invalid value '%s'", text)
		}
	case nil:
		*b = false
	default:
		return fmt.Errorf("unsupported format %T", src)
	}
	return nil
}
func (b Bool) Value() (driver.Value, error) {
	return bool(b), nil
}