func (ta *SqlPermissions) typeAndKey() (string, string) {
	if ta.Table != "" {
		return "TABLE", fmt.Sprintf("`%s`.`%s`", ta.actualDatabase(), ta.Table)
	}
	if ta.View != "" {
		return "VIEW", fmt.Sprintf("`%s`.`%s`", ta.actualDatabase(), ta.View)
	}
	if ta.Database != "" {
		return "DATABASE", ta.Database
	}
	if ta.Catalog {
		return "CATALOG", ""
	}
	if ta.AnyFile {
		return "ANY FILE", ""
	}
	if ta.AnonymousFunction {
		return "ANONYMOUS FUNCTION", ""
	}
	return "", ""
}
typeAndKey returns ACL object type and key
package access
import (
	"context"
	"fmt"
	"log"
	"strings"
	"github.com/databrickslabs/terraform-provider-databricks/common"
	"github.com/databrickslabs/terraform-provider-databricks/compute"
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
type SqlPermissions struct {
	Table                string                `json:"table,omitempty" tf:"force_new"`
	View                 string                `json:"view,omitempty" tf:"force_new"`
	Database             string                `json:"database,omitempty" tf:"force_new"`
	Catalog              bool                  `json:"catalog,omitempty" tf:"force_new"`
	AnyFile              bool                  `json:"any_file,omitempty" tf:"force_new"`
	AnonymousFunction    bool                  `json:"anonymous_function,omitempty" tf:"force_new"`
	ClusterID            string                `json:"cluster_id,omitempty" tf:"computed"`
	PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty" tf:"slice_set"`
	exec common.CommandExecutor
}
type PrivilegeAssignment struct {
	Principal  string   `json:"principal"`
	Privileges []string `json:"privileges" tf:"slice_set"`
}
func (ta *SqlPermissions) actualDatabase() string {
	if ta.Database == "" {
		return "default"
	}
	return ta.Database
}