func (t *SqTime) parse(s string) error {
	if s == "" {
		return nil
	}
	for _, f := range sqlite3.SQLiteTimestampFormats {
		z, err := time.Parse(f, s)
		if err == nil {
			t.Time = z
			return nil
		}
	}
	return errors.New("could not parse time")
}
parse attempts to parse string s to t.
package internal
import (
	"bufio"
	"context"
	"database/sql"
	"database/sql/driver"
	"errors"
	"flag"
	"fmt"
	"io"
	"os"
	"os/user"
	"reflect"
	"strconv"
	"strings"
	"time"
	sqlite3 "github.com/SQLess/go-sqlite3-cipher"
	"github.com/xo/dburl"
	"github.com/xo/usql/drivers"
	"github.com/xo/usql/env"
	"github.com/xo/usql/handler"
	"github.com/xo/usql/rline"
	"github.com/xo/usql/text"
	"github.com/SQLess/SQLess/client"
	"github.com/SQLess/SQLess/conf"
	"github.com/SQLess/SQLess/utils"
)
var CmdConsole = &Command{
	UsageLine: "cql console [common params] [-command sqlcommand] [-out outputfile] [-no-rc true/false] [-single-transaction] [-variable variables] [-explorer explorer_addr] [dsn]",
	Short:     "run a console for interactive sql operation",
	Long: `
Console runs an interactive SQL console for CQL.
e.g.
    cql console cql: 
There is also a -command param for SQL script, and you can add "< file.sql" at end of command for executing a SQL file.
If those params are set, it will run SQL script and exit without staying console mode.
e.g.
    cql console -command "create table test1(test2 int);" cql: 
`,
	Flag:       flag.NewFlagSet("Console params", flag.ExitOnError),
	CommonFlag: flag.NewFlagSet("Common params", flag.ExitOnError),
	DebugFlag:  flag.NewFlagSet("Debug params", flag.ExitOnError),
}
var (
	variables         varsFlag
	dsn               string
	outFile           string
	noRC              bool
	singleTransaction bool
	command           string
)
func init() {
	CmdConsole.Run = runConsole
	addCommonFlags(CmdConsole)
	addConfigFlag(CmdConsole)
	CmdConsole.Flag.Var(&variables, "variable", "Set variable")
	CmdConsole.Flag.StringVar(&outFile, "out", "", "Record stdout to file")
	CmdConsole.Flag.BoolVar(&noRC, "no-rc", false, "Do not read start up file")
	CmdConsole.Flag.BoolVar(&singleTransaction, "single-transaction", false, "Execute as a single transaction (if non-interactive)")
	CmdConsole.Flag.StringVar(&command, "command", "", "Run only single command (SQL or usql internal command) and exit")
	CmdConsole.Flag.StringVar(&explorerAddr, "explorer", "", "Address serve a database chain explorer, e.g. :8546")
}
type SqTime struct {
	time.Time
}
func (t SqTime) Value() (driver.Value, error) {
	return t.Time, nil
}
func (t *SqTime) Scan(v interface{}) error {
	switch x := v.(type) {
	case time.Time:
		t.Time = x
		return nil
	case []byte:
		return t.parse(string(x))
	case string:
		return t.parse(x)
	}
	return fmt.Errorf("cannot convert type %s to time.Time", reflect.TypeOf(v))
}