Execute executes a SQL statement.
(ctx context.Context, statement string, _ db.ExecuteOptions)
| 92 | |
| 93 | // Execute executes a SQL statement. |
| 94 | func (d *Driver) Execute(ctx context.Context, statement string, _ db.ExecuteOptions) (int64, error) { |
| 95 | q := d.client.Query(statement) |
| 96 | q.DefaultDatasetID = d.databaseName |
| 97 | job, err := q.Run(ctx) |
| 98 | if err != nil { |
| 99 | return 0, err |
| 100 | } |
| 101 | status, err := job.Wait(ctx) |
| 102 | if err != nil { |
| 103 | return 0, err |
| 104 | } |
| 105 | if err := status.Err(); err != nil { |
| 106 | return 0, err |
| 107 | } |
| 108 | return 0, nil |
| 109 | } |
| 110 | |
| 111 | // QueryConn queries a SQL statement in a given connection. |
| 112 | func (d *Driver) QueryConn(ctx context.Context, _ *sql.Conn, statement string, queryContext db.QueryContext) ([]*v1pb.QueryResult, error) { |
nothing calls this directly
no test coverage detected