(ctx context.Context)
| 220 | } |
| 221 | |
| 222 | func (d *Driver) getVersion(ctx context.Context) (string, error) { |
| 223 | // https://www.cockroachlabs.com/docs/v25.1/cluster-settings#setting-version |
| 224 | query := "SHOW CLUSTER SETTING version;" |
| 225 | var version string |
| 226 | if err := d.db.QueryRowContext(ctx, query).Scan(&version); err != nil { |
| 227 | if err == sql.ErrNoRows { |
| 228 | return "", common.FormatDBErrorEmptyRowWithQuery(query) |
| 229 | } |
| 230 | return "", util.FormatErrorWithQuery(err, query) |
| 231 | } |
| 232 | return version, nil |
| 233 | } |
| 234 | |
| 235 | // Execute will execute the statement. For CREATE DATABASE statement, some types of databases such as Postgres |
| 236 | // will not use transactions to execute the statement but will still use transactions to execute the rest of statements. |
no test coverage detected