-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3057518
commit f5fbca1
Showing
4 changed files
with
96 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2023 Dolthub, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Copyright 2020 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package tree | ||
|
||
//ALTER COLLATION name REFRESH VERSION | ||
|
||
//ALTER COLLATION name RENAME TO new_name | ||
//ALTER COLLATION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER } | ||
//ALTER COLLATION name SET SCHEMA new_schema | ||
|
||
var _ Statement = &AlterConversion{} | ||
|
||
// AlterConversion represents a ALTER COLLATION statement. | ||
type AlterConversion struct { | ||
Name Name | ||
RefreshVersion bool | ||
Rename Name | ||
Owner string | ||
Schema string | ||
} | ||
|
||
// Format implements the NodeFormatter interface. | ||
func (node *AlterConversion) Format(ctx *FmtCtx) { | ||
ctx.WriteString("ALTER COLLATION ") | ||
ctx.FormatNode(&node.Name) | ||
if node.RefreshVersion { | ||
ctx.WriteString(" REFRESH VERSION") | ||
} else if node.Rename != "" { | ||
ctx.WriteString(" RENAME ") | ||
ctx.FormatNode(&node.Rename) | ||
} else if node.Owner != "" { | ||
ctx.WriteString(" OWNER TO ") | ||
ctx.FormatNameP(&node.Owner) | ||
} else if node.Schema != "" { | ||
ctx.WriteString(" SET SCHEMA ") | ||
ctx.FormatNameP(&node.Schema) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters