@@ -403,6 +403,10 @@ func informixInterpolate(query string, args ...interface{}) (string, error) {
403403 return mysqlLikeInterpolate (Informix , query , args ... )
404404}
405405
406+ func dorisInterpolate (query string , args ... interface {}) (string , error ) {
407+ return mysqlLikeInterpolate (Doris , query , args ... )
408+ }
409+
406410// oraclelInterpolate parses query and replace all ":*" with encoded args.
407411// If there are more ":*" than len(args), returns ErrMissingArgs.
408412// Otherwise, if there are less ":*" than len(args), the redundant args are omitted.
@@ -590,7 +594,7 @@ func encodeValue(buf []byte, arg interface{}, flavor Flavor) ([]byte, error) {
590594 v = v .Add (500 * time .Nanosecond )
591595
592596 switch flavor {
593- case MySQL :
597+ case MySQL , ClickHouse , Informix , Doris :
594598 buf = append (buf , v .Format ("'2006-01-02 15:04:05.999999'" )... )
595599
596600 case PostgreSQL :
@@ -605,20 +609,13 @@ func encodeValue(buf []byte, arg interface{}, flavor Flavor) ([]byte, error) {
605609 case CQL :
606610 buf = append (buf , v .Format ("'2006-01-02 15:04:05.999999Z0700'" )... )
607611
608- case ClickHouse :
609- buf = append (buf , v .Format ("'2006-01-02 15:04:05.999999'" )... )
610-
611612 case Presto :
612613 buf = append (buf , v .Format ("'2006-01-02 15:04:05.000'" )... )
613614
614615 case Oracle :
615616 buf = append (buf , "to_timestamp('" ... )
616617 buf = append (buf , v .Format ("2006-01-02 15:04:05.999999" )... )
617618 buf = append (buf , "', 'YYYY-MM-DD HH24:MI:SS.FF')" ... )
618-
619- case Informix :
620- buf = append (buf , v .Format ("'2006-01-02 15:04:05.999999'" )... )
621-
622619 }
623620
624621 case fmt.Stringer :
@@ -741,6 +738,7 @@ func encodeValue(buf []byte, arg interface{}, flavor Flavor) ([]byte, error) {
741738 buf = append (buf , "hextoraw('" ... )
742739 buf = appendHex (buf , data )
743740 buf = append (buf , "')" ... )
741+
744742 default :
745743 return nil , ErrInterpolateUnsupportedArgs
746744 }
0 commit comments