-
Couldn't load subscription status.
- Fork 3.4k
Document branching syntax #26376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Document branching syntax #26376
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,26 @@ | ||
| # ALTER BRANCH | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```text | ||
| ALTER BRANCH source_branch IN TABLE table_name FAST FORWARD TO target_branch | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| Fast-forward the current snapshot of one branch to the latest snapshot of | ||
| another. | ||
|
|
||
| ## Examples | ||
|
|
||
| Fast-forward the `main` branch to the head of `audit` branch in the `orders` | ||
| table: | ||
|
|
||
| ```sql | ||
| ALTER BRANCH main IN TABLE orders FAST FORWARD TO audit | ||
| ``` | ||
|
|
||
| ## See also | ||
|
|
||
| - {doc}`create-branch` | ||
| - {doc}`drop-branch` |
This file contains hidden or 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,46 @@ | ||
| # CREATE BRANCH | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```text | ||
| CREATE [ OR REPLACE ] BRANCH [ IF NOT EXISTS ] branch_name | ||
| [ WITH ( property_name = expression [, ...] ) ] | ||
| IN TABLE table_name | ||
| [ FROM source_branch ] | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| Create a branch. | ||
|
|
||
| The optional `OR REPLACE` clause causes an existing branch with the | ||
| specified name to be replaced with the new branch definition. Support | ||
| for branch replacement varies across connectors. Refer to the | ||
| connector documentation for details. | ||
|
|
||
| The optional `IF NOT EXISTS` clause causes the error to be | ||
| suppressed if the branch already exists. | ||
|
|
||
| The optional `WITH` clause can be used to set properties | ||
| on the newly created branch. | ||
|
|
||
| The optional `FROM` clause can be used to set the source branch from which the | ||
| new branch is created. | ||
|
|
||
| ## Examples | ||
|
|
||
| Create a new branch `audit` in the table `orders`: | ||
|
|
||
| ```sql | ||
| CREATE BRANCH audit IN TABLE orders | ||
| ``` | ||
|
|
||
| Create a new branch `audit` in the table `orders` from the branch `dev`: | ||
|
|
||
| ```sql | ||
| CREATE BRANCH audit IN TABLE orders FROM dev | ||
| ``` | ||
|
|
||
| ## See also | ||
|
|
||
| {doc}`drop-branch` | ||
This file contains hidden or 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 hidden or 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 hidden or 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,27 @@ | ||
| # DROP BRANCH | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```text | ||
| DROP BRANCH [ IF EXISTS ] branch_name | ||
| IN TABLE table_name | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| Drops an existing branch. | ||
|
|
||
| The optional `IF EXISTS` clause causes the error to be suppressed if the branch | ||
| does not exist. | ||
|
|
||
| ## Examples | ||
|
|
||
| Drop the branch `audit` in the table `orders`: | ||
|
|
||
| ```sql | ||
| DROP BRANCH audit IN TABLE orders | ||
| ``` | ||
|
|
||
| ## See also | ||
|
|
||
| {doc}`create-branch` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,19 @@ | ||
| # SHOW BRANCHES | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```text | ||
| SHOW BRANCHES ( FROM | IN ) TABLE table_name | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| List the available branches. | ||
|
|
||
| ## Examples | ||
|
|
||
| List the branches in the table `orders`: | ||
|
|
||
| ```sql | ||
| SHOW BRANCHES IN TABLE orders | ||
| ``` |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.