@@ -429,6 +429,8 @@ func (h *Handler) Execute(ctx context.Context, w io.Writer, opt metacmd.Option,
429
429
f = h .doExecSet
430
430
case metacmd .ExecWatch :
431
431
f = h .doExecWatch
432
+ case metacmd .ExecChart :
433
+ f = h .doExecChart
432
434
}
433
435
if err = drivers .WrapErr (h .u .Driver , f (ctx , w , opt , prefix , sqlstr , qtyp , bind )); err != nil {
434
436
if forceTrans {
@@ -1031,6 +1033,11 @@ func (h *Handler) doExecWatch(ctx context.Context, w io.Writer, opt metacmd.Opti
1031
1033
}
1032
1034
}
1033
1035
1036
+ // doExecChart executes a single query against the database, displaying its output as a chart.
1037
+ func (h * Handler ) doExecChart (ctx context.Context , w io.Writer , opt metacmd.Option , prefix , sqlstr string , qtyp bool , bind []interface {}) error {
1038
+ return nil
1039
+ }
1040
+
1034
1041
// doExecSingle executes a single query against the database based on its query type.
1035
1042
func (h * Handler ) doExecSingle (ctx context.Context , w io.Writer , opt metacmd.Option , prefix , sqlstr string , qtyp bool , bind []interface {}) error {
1036
1043
// exec or query
@@ -1158,12 +1165,11 @@ func (h *Handler) doQuery(ctx context.Context, w io.Writer, opt metacmd.Option,
1158
1165
case drivers .UseColumnTypes (h .u ):
1159
1166
extra = append (extra , tblfmt .WithUseColumnTypes (true ))
1160
1167
}
1161
- // wrap query with crosstab
1162
1168
resultSet := tblfmt .ResultSet (rows )
1169
+ // wrap query with crosstab
1163
1170
if opt .Exec == metacmd .ExecCrosstab {
1164
1171
var err error
1165
- resultSet , err = tblfmt .NewCrosstabView (rows , append (extra , tblfmt .WithParams (opt .Crosstab ... ))... )
1166
- if err != nil {
1172
+ if resultSet , err = tblfmt .NewCrosstabView (rows , append (extra , tblfmt .WithParams (opt .Crosstab ... ))... ); err != nil {
1167
1173
return err
1168
1174
}
1169
1175
extra = nil
0 commit comments