(ctx context.Context, _ *sql.Conn, statement string, queryCtx db.QueryContext)
| 179 | } |
| 180 | |
| 181 | func (d *Driver) QueryConn(ctx context.Context, _ *sql.Conn, statement string, queryCtx db.QueryContext) ([]*v1pb.QueryResult, error) { |
| 182 | if d.db == nil { |
| 183 | return nil, errors.New("connection not initialized") |
| 184 | } |
| 185 | |
| 186 | singleSQLs, err := base.SplitMultiSQL(storepb.Engine_HIVE, statement) |
| 187 | if err != nil { |
| 188 | return nil, errors.Wrapf(err, "failed to split statements") |
| 189 | } |
| 190 | |
| 191 | var results []*v1pb.QueryResult |
| 192 | for _, singleSQL := range singleSQLs { |
| 193 | statement := util.TrimStatement(singleSQL.Text) |
| 194 | if queryCtx.Explain { |
| 195 | statement = fmt.Sprintf("EXPLAIN %s", statement) |
| 196 | } |
| 197 | |
| 198 | result, err := d.queryStatementWithLimit(ctx, statement, queryCtx.MaximumSQLResultSize) |
| 199 | if err != nil { |
| 200 | return nil, err |
| 201 | } |
| 202 | |
| 203 | results = append(results, result) |
| 204 | } |
| 205 | return results, nil |
| 206 | } |
| 207 | |
| 208 | // This function converts basic types to types that have implemented isRowValue_Kind interface. |
| 209 | func parseValueType(value any, gohiveType string) *v1pb.RowValue { |
nothing calls this directly
no test coverage detected