github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/sql/sem/tree/tenant_settings.go (about)

     1  // Copyright 2022 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  package tree
    12  
    13  // AlterTenantSetClusterSetting represents an ALTER VIRTUAL CLUSTER
    14  // SET CLUSTER SETTING statement.
    15  type AlterTenantSetClusterSetting struct {
    16  	SetClusterSetting
    17  	TenantSpec *TenantSpec
    18  }
    19  
    20  // Format implements the NodeFormatter interface.
    21  func (n *AlterTenantSetClusterSetting) Format(ctx *FmtCtx) {
    22  	ctx.WriteString("ALTER VIRTUAL CLUSTER ")
    23  	ctx.FormatNode(n.TenantSpec)
    24  	ctx.WriteByte(' ')
    25  	ctx.FormatNode(&n.SetClusterSetting)
    26  }
    27  
    28  // ShowTenantClusterSetting represents a SHOW CLUSTER SETTING ... FOR VIRTUAL CLUSTER statement.
    29  type ShowTenantClusterSetting struct {
    30  	*ShowClusterSetting
    31  	TenantSpec *TenantSpec
    32  }
    33  
    34  // Format implements the NodeFormatter interface.
    35  func (node *ShowTenantClusterSetting) Format(ctx *FmtCtx) {
    36  	ctx.FormatNode(node.ShowClusterSetting)
    37  	ctx.WriteString(" FOR VIRTUAL CLUSTER ")
    38  	ctx.FormatNode(node.TenantSpec)
    39  }
    40  
    41  // ShowTenantClusterSettingList represents a SHOW CLUSTER SETTINGS FOR VIRTUAL CLUSTER statement.
    42  type ShowTenantClusterSettingList struct {
    43  	*ShowClusterSettingList
    44  	TenantSpec *TenantSpec
    45  }
    46  
    47  // Format implements the NodeFormatter interface.
    48  func (node *ShowTenantClusterSettingList) Format(ctx *FmtCtx) {
    49  	ctx.FormatNode(node.ShowClusterSettingList)
    50  	ctx.WriteString(" FOR VIRTUAL CLUSTER ")
    51  	ctx.FormatNode(node.TenantSpec)
    52  }