File tree Expand file tree Collapse file tree 1 file changed +30
-9
lines changed
Expand file tree Collapse file tree 1 file changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -604,15 +604,6 @@ func (r resultRowsAffected) RowsAffected() (int64, error) {
604604 return int64 (r ), nil
605605}
606606
607- type rows struct {
608- ctx context.Context
609- * stmt
610- names []string
611- types []string
612- nulls []bool
613- scans []scantype
614- }
615-
616607type scantype byte
617608
618609const (
@@ -648,10 +639,20 @@ func scanFromDecl(decl string) scantype {
648639 return _ANY
649640}
650641
642+ type rows struct {
643+ ctx context.Context
644+ * stmt
645+ names []string
646+ types []string
647+ nulls []bool
648+ scans []scantype
649+ }
650+
651651var (
652652 // Ensure these interfaces are implemented:
653653 _ driver.RowsColumnTypeDatabaseTypeName = & rows {}
654654 _ driver.RowsColumnTypeNullable = & rows {}
655+ // _ driver.RowsColumnScanner = &rows{}
655656)
656657
657658func (r * rows ) Close () error {
@@ -830,3 +831,23 @@ func (r *rows) Next(dest []driver.Value) error {
830831 }
831832 return nil
832833}
834+
835+ func (r * rows ) ScanColumn (dest any , index int ) error {
836+ // notest // Go 1.26
837+ var ptr * time.Time
838+ switch d := dest .(type ) {
839+ case * time.Time :
840+ ptr = d
841+ case * sql.NullTime :
842+ ptr = & d .Time
843+ case * sql.Null [time.Time ]:
844+ ptr = & d .V
845+ default :
846+ return driver .ErrSkip
847+ }
848+ if t := r .Stmt .ColumnTime (index , r .tmRead ); ! t .IsZero () {
849+ * ptr = t
850+ return nil
851+ }
852+ return driver .ErrSkip
853+ }
You can’t perform that action at this time.
0 commit comments