code: func getDBVersion(tx *sql.Tx) (int, error) {
  	var version int
  	rows, err := tx.Query("SELECT version FROM version")
  	if err != nil {
  		return -1, err
  	}
  	defer rows.Close()
  	found := false
  	for rows.Next() {
  		if err := rows.Scan(&version); err != nil {
  			return -1, err
  		}
  		found = true
  		break
  	}
  	if err := rows.Err(); err != nil {
  		return -1, err
  	}
  	if !found {
  		return -1, fmt.Errorf("db version table empty")
  	}
  	return version, nil
  }
docs: // getDBVersion retrieves the current db version