You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: access_key.go
    path of file: ./repos/infra/internal/server/data
    
    the code of the file until where you have to start completion: package data

import (
	"crypto/sha256"
	"crypto/subtle"
	"fmt"
	"strings"
	"time"

	"github.com/infrahq/infra/internal/generate"
	"github.com/infrahq/infra/internal/logging"
	"github.com/infrahq/infra/internal/server/data/querybuilder"
	"github.com/infrahq/infra/internal/server/models"
	"github.com/infrahq/infra/uid"
)

type accessKeyTable models.AccessKey

func (a accessKeyTable) Table() string {
	return "access_keys"
}

func (a accessKeyTable) Columns() []string {
	return []string{"created_at", "deleted_at", "expires_at", "inactivity_extension", "inactivity_timeout", "i
    
func GetAccessKey(tx ReadTxn, opts GetAccessKeysOptions) (*models.AccessKey, error) {
	accessKey := &accessKeyTable{}
	query := querybuilder.New("SELECT")
	query.B(columnsForSelect(accessKey))
	query.B(", identities.name")
	query.B("FROM access_keys INNER JOIN identities")
	query.B("ON access_keys.issued_for_id = identities.id")
	query.B("WHERE access_keys.deleted_at is null")
	query.B("AND access_keys.organization_id = ?", tx.OrganizationID())

	switch {
	case opts.ByID != 0:
		query.B("AND access_keys.id = ?", opts.ByID)
	case opts.ByName != "" && opts.IssuedForID != 0:
		query.B("AND access_keys.name = ?", opts.ByName)
		query.B("AND access_keys.issued_for_id = ?", opts.IssuedForID)
	default:
		return nil, fmt.Errorf("either an ID, or name and issued_for_id are required")
	}

	fields := append(accessKey.ScanFields(), &accessKey.IssuedForName)
	err := tx.QueryRow(query.String(), query.Args...).Scan(fields...)
	if err != nil {
		return nil, handleError(err)
	}
	return (*models.AccessKey)(accessKey), nil
}