The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.
vsql_branch makes a named copy of a database on the same server, so you can
run a migration or a test suite against the copy, reset it to match the source
again, and drop it when you are done. A branch is an ordinary database, so any
MySQL client or driver connects to it the same way it connects to the source.Branches in the vsql_branch extension work differently from how branches in
the VillageSQL managed database service will work when it launches. A
vsql_branch branch is one database on your own server, and you reach it
through the same connection. A VillageSQL managed database service branch will
be a separate server that copies every database of its source, and it has its
own connection endpoint.
This extension declares preview capabilities, so
vsql_allow_preview_extensions must be ON. Start the server with
--vsql_allow_preview_extensions=ON, or run
SET PERSIST vsql_allow_preview_extensions = ON.
Install
vsql_branch is not bundled with the server, so build it from the repository
first. The build needs the Rust toolchain and cargo-vsql
(cargo install cargo-vsql). Point VillageSQL_BUILD_DIR at your server build
tree and run, from the repository:
cargo vsql install builds the extension and copies vsql_branch.veb into the
server’s lib/veb directory. Then install it, and turn on the background worker
that copies, resets, and drops branches:
Until the worker runs, every function except mcp_tools fails:
ERROR 3200 (HY000): VDF error in function 'list_branches': vsql_branch: the vsql_branch worker is not running. Run SET PERSIST vsql_branch.worker_enabled = ON
UNINSTALL EXTENSION vsql_branch deletes the persisted
vsql_branch.worker_enabled value, so run the SET PERSIST again after you
install the extension again.
What it adds
Every function except mcp_tools takes one JSON string and returns a JSON
string. SQL NULL counts as {}.
Function
Arguments
Returns
create_branch(json)
name, src_branch_id, and optionally mode
The new branch and an operation_id
list_branches(json)
none, so pass NULL
{"items": [...]}, one entry per branch
describe_branch(json)
branch_id
One branch
reset_branch(json)
branch_id
An operation
delete_branch(json)
branch_id
An operation
get_connection_string(json)
branch_id, and optionally user
{"connection_string": "mysql://..."}
get_operation(json)
operation_id
An operation
mcp_tools()
The branch functions as Model Context Protocol tools
name is the branch name and the name of the new database: 1 to 64
characters from A-Z, a-z, 0-9, and _. src_branch_id is the source database,
which can be any database except the system databases. mode is
schema-only, the default, which copies every table, view, and trigger without
their rows, or data, which copies the rows too. branch_id is the branch name.A SQL function cannot run DDL, so create_branch, reset_branch, and
delete_branch queue the work and return at once. Call get_operation until
its state is succeeded or failed.
Example
Start from a source database:
CREATE DATABASE shop;CREATE TABLE shop.customers (id INT PRIMARY KEY, name VARCHAR(100) NOT NULL);CREATE TABLE shop.orders ( id INT PRIMARY KEY, customer_id INT NOT NULL, total DECIMAL(10,2) NOT NULL, FOREIGN KEY (customer_id) REFERENCES shop.customers (id));INSERT INTO shop.customers VALUES (1, 'Ada'), (2, 'Grace');INSERT INTO shop.orders VALUES (10, 1, 25.00), (11, 2, 40.00), (12, 1, 12.50);
Copy it, rows included, into a branch named shop_test. The copy takes a
moment, so wait before you check the operation, and check it again while its
state is pending or running:
SET @r = vsql_branch.create_branch('{"name":"shop_test","src_branch_id":"shop","mode":"data"}');DO SLEEP(1);SELECT vsql_branch.get_operation( JSON_OBJECT('operation_id', JSON_VALUE(@r, '$.operation_id'))) AS op\G
DELETE FROM shop_test.orders WHERE customer_id = 1;SELECT (SELECT COUNT(*) FROM shop.orders) AS source_orders, (SELECT COUNT(*) FROM shop_test.orders) AS branch_orders;
Reset the branch to match the source again. reset_branch returns the
operation itself, so read its id:
SET @r = vsql_branch.reset_branch('{"branch_id":"shop_test"}');DO SLEEP(1);SELECT JSON_VALUE(vsql_branch.get_operation( JSON_OBJECT('operation_id', JSON_VALUE(@r, '$.id'))), '$.state') AS state;SELECT COUNT(*) FROM shop_test.orders;
+-----------+| state |+-----------+| succeeded |+-----------++----------+| COUNT(*) |+----------+| 3 |+----------+
A branch takes one operation at a time, so wait for one to succeed before you
start the next on the same branch. List the branches with JSON_TABLE:
+-----------+------+--------+| name | mode | status |+-----------+------+--------+| shop_test | data | active |+-----------+------+--------+
Drop the branch, check that the operation finished, and drop the source
database:
SET @r = vsql_branch.delete_branch('{"branch_id":"shop_test"}');DO SLEEP(1);SELECT JSON_VALUE(vsql_branch.get_operation( JSON_OBJECT('operation_id', JSON_VALUE(@r, '$.id'))), '$.state') AS state;DROP DATABASE shop;
+-----------+| state |+-----------+| succeeded |+-----------+
Limits
Every account can call the functions, including an account that has only
USAGE. The worker runs its SQL without checking the caller’s privileges, so
such an account can copy any database that is not a system database and reset
or drop any branch. Install the extension only on a server whose accounts you
trust with that.
delete_branch drops the database of any row in the table
vsql_branches.branches. An account that can write that table can add
a row for any database that is not a system database, and after the next
restart the worker drops that database on request. Grant write access to
vsql_branches.branches only to accounts you trust with that.
Stored procedures, stored functions, and events are not copied. Tables,
views, and triggers are, and the worker changes every name of the source
database in a view or trigger to the branch, including text inside a string
literal, such as 'see shop.items'.
In data mode, writes to the source tables wait while the worker copies
their files, and the worker fails the operation if it waits more than 30
seconds for a lock. The tables of a data branch can come from different
moments, so branch an idle source when the tables must agree.
Operations live in memory, so a restart forgets them.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"VillageSQL Docs","description":"Documentation for VillageSQL, a drop-in replacement for MySQL that offers extensions.","colors":{"primary":"#9500BF","light":"#CC66FF","dark":"#1F062A"},"logo":{"light":"https://mintcdn.com/villagesql/ER5Fb1fv5K0c6u26/images/logo-light.svg?fit=max\u0026auto=format\u0026n=ER5Fb1fv5K0c6u26\u0026q=85\u0026s=984aeecbb83c7ff4d729220dc5b295ba","dark":"https://mintcdn.com/villagesql/ER5Fb1fv5K0c6u26/images/logo-dark.svg?fit=max\u0026auto=format\u0026n=ER5Fb1fv5K0c6u26\u0026q=85\u0026s=7c54878160d03b398facdce3c68e8f53","href":"https://villagesql.com"},"favicon":"https://mintcdn.com/villagesql/dJP528IM9EMOJWSW/images/favicon.png?fit=max\u0026auto=format\u0026n=dJP528IM9EMOJWSW\u0026q=85\u0026s=dcd56233103a4ed589abde42130b2a1d","background":{"color":{"dark":"#1F062A"}},"navbar":{"links":[{"icon":"github","href":"https://github.com/villagesql/villagesql-server","label":"GitHub"},{"icon":"discord","href":"https://discord.gg/KSr6whd3Fr","label":"Discord"}]},"footer":{"socials":{"github":"https://github.com/villagesql/villagesql-server","discord":"https://discord.gg/KSr6whd3Fr","linkedin":"https://www.linkedin.com/company/villagesql"}},"seo":{"metatags":{"og:type":"website","og:site_name":"VillageSQL Docs"},"indexing":"all"},"fonts":{"heading":{"family":"Space Grotesk"}},"styling":{"eyebrows":"breadcrumbs","latex":true},"errors":{"404":{"redirect":false,"title":"This is not the village you are looking for (Error 404)","description":"It looks like you got lost looking for the village. Please go back to the [documentation site](https://villagesql.com/docs) to find what you need."}},"contextual":{"options":["copy","view","claude","chatgpt","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"languages":[{"language":"en","default":true,"href":""},{"language":"ja","href":"ja"},{"language":"ko","href":"ko"},{"language":"zh","href":"zh"},{"language":"pt-BR","href":"pt-BR"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"villagesql","hasAudioNarration":false,"actualSubdomain":"villagesql","customDomains":["villagesql.com"],"gitSource":{"type":"github","owner":"villagesql","repo":"villagesql-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6b10c3b89ffae5051c40607d"},"feedback":{"thumbs":true,"issues":true,"edits":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b13389d9e976889bba3cb67","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"en","tag":"Guides","count":144},{"language":"ja","tag":"ガイド","count":144},{"language":"ko","tag":"가이드","count":144},{"language":"pt-BR","tag":"Guias","count":144},{"language":"zh","tag":"指南","count":144},{"language":"en","tag":"MySQL Tutorial","count":46},{"language":"ja","tag":"MySQL Tutorial","count":46},{"language":"ko","tag":"MySQL Tutorial","count":46},{"language":"pt-BR","tag":"MySQL Tutorial","count":46},{"language":"zh","tag":"MySQL Tutorial","count":46},{"language":"en","tag":"Extensions","count":45},{"language":"ja","tag":"拡張機能","count":42},{"language":"ko","tag":"확장 기능","count":42},{"language":"pt-BR","tag":"Extensões","count":42},{"language":"zh","tag":"扩展","count":42},{"language":"en","tag":"Server","count":28},{"language":"en","tag":"Dev releases","count":28},{"language":"en","tag":"Extension Catalog","count":27},{"language":"en","tag":"Available Extensions","count":27},{"language":"ja","tag":"拡張機能カタログ","count":24},{"language":"ja","tag":"利用可能な拡張機能","count":24},{"language":"ko","tag":"확장 기능 카탈로그","count":24},{"language":"ko","tag":"사용 가능한 확장 기능","count":24},{"language":"pt-BR","tag":"Catálogo de Extensões","count":24},{"language":"pt-BR","tag":"Extensões Disponíveis","count":24},{"language":"zh","tag":"扩展目录","count":24},{"language":"zh","tag":"可用扩展","count":24},{"language":"en","tag":"Operate MySQL","count":21},{"language":"ja","tag":"MySQL の運用","count":21},{"language":"ko","tag":"MySQL 운영","count":21},{"language":"pt-BR","tag":"Opere o MySQL","count":21},{"language":"zh","tag":"运维 MySQL","count":21},{"language":"en","tag":"Write Queries","count":20},{"language":"ja","tag":"クエリの作成","count":20},{"language":"ko","tag":"쿼리 작성","count":20},{"language":"pt-BR","tag":"Escreva Consultas","count":20},{"language":"zh","tag":"编写查询","count":20},{"language":"ja","tag":"拡張機能の作成","count":17},{"language":"en","tag":"Install and Run Server","count":16},{"language":"ja","tag":"データの保存","count":16},{"language":"ko","tag":"데이터 저장","count":16},{"language":"pt-BR","tag":"Armazene Dados","count":16},{"language":"zh","tag":"存储数据","count":16},{"language":"ko","tag":"확장 기능 빌드","count":15},{"language":"pt-BR","tag":"Criar uma Extensão","count":15},{"language":"zh","tag":"构建扩展","count":15},{"language":"ja","tag":"C++ SDK","count":14},{"language":"ko","tag":"C++ SDK","count":14},{"language":"pt-BR","tag":"SDK C++","count":14},{"language":"zh","tag":"C++ SDK","count":14}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"help@villagesql.com","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".nav-dropdown-products-selector-trigger{order:1!important}.hidden.lg\\:flex.items-center.gap-x-2{order:2!important}#navbar,#sidebar,#mobile-nav,#table-of-contents{font-family:var(--font-family-headings-custom)}body{font-family:Arial, sans-serif}button.nav-tabs-item>div.font-medium{color:rgb(var(--gray-800))}html.dark button.nav-tabs-item>div.font-medium{color:rgb(var(--gray-200))}img.nav-logo{height:2.5rem!important;width:auto!important}img[src$=\"/images/pelican.svg\"]{width:1.5rem!important;height:1.5rem!important;margin:-0.25rem}@media (min-width: 1024px){li.navbar-link>a{font-size:0;gap:0;padding:0.5rem}li.navbar-link>a svg{height:1.25rem;width:1.25rem}}[data-callout-type=\"tip\"],[data-callout-type=\"note\"],[data-callout-type=\"info\"]{border-color:#CC66FF!important;background-color:rgb(204 102 255 / 0.08)!important}[data-callout-type=\"warning\"]{border:2px solid #B500BA!important;background-color:#FFFFFF!important}[data-callout-type] [data-component-part=\"callout-content\"]{color:#1F062A!important}[data-callout-type] [data-component-part=\"callout-icon\"] svg{color:#9500BF!important}[data-callout-type=\"warning\"] [data-component-part=\"callout-icon\"] svg{color:#630080!important}html.dark [data-callout-type=\"tip\"],html.dark [data-callout-type=\"note\"],html.dark [data-callout-type=\"info\"]{border-color:#630080!important;background-color:rgb(204 102 255 / 0.08)!important}html.dark [data-callout-type=\"warning\"]{border-color:#B500BA!important;background-color:transparent!important}html.dark [data-callout-type] [data-component-part=\"callout-content\"]{color:#FFFFFF!important}html.dark [data-callout-type] [data-component-part=\"callout-icon\"] svg{color:#CC66FF!important}.agent-setup #ask-assistant-code-block-button{display:none}html.dark .code-block [class*=\"dark:bg-codeblock\"]{background-color:#1F062A!important}html.dark .code-block [class=\"print:hidden\"]{background-image:linear-gradient(to right, rgb(31 6 42 / 0) 0px, rgb(31 6 42 / 0.2) 10px,\n rgb(31 6 42 / 0.5) 25px, rgb(31 6 42 / 0.8) 35px, rgb(31 6 42) 45px)!important}.chat-assistant-floating-input{display:none!important}"}]}
{"page":{"pagePath":"en/extensions/vsql-branch","slug":"/en/extensions/vsql-branch","pageMetadata":{"title":"vsql_branch extension for MySQL","sidebarTitle":"vsql_branch","description":"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.","keywords":"mysql database branching, mysql copy database, mysql test database copy, mysql branch database, vsql_branch","audience":"villagesql-user","href":"/en/extensions/vsql-branch"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`vsql_branch`}),` makes a named copy of a database on the same server, so you can\nrun a migration or a test suite against the copy, reset it to match the source\nagain, and drop it when you are done. A branch is an ordinary database, so any\nMySQL client or driver connects to it the same way it connects to the source.`]}),`\n`,_jsxs(_components.p,{children:[`Branches in the `,_jsx(_components.code,{children:`vsql_branch`}),` extension work differently from how branches in\nthe VillageSQL managed database service will work when it launches. A\n`,_jsx(_components.code,{children:`vsql_branch`}),` branch is one database on your own server, and you reach it\nthrough the same connection. A VillageSQL managed database service branch will\nbe a separate server that copies every database of its source, and it has its\nown connection endpoint.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{}),_jsx(_components.th,{})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Maintainer`})}),_jsx(_components.td,{children:`VillageSQL`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Source and full documentation`})}),_jsx(_components.td,{children:_jsx(_components.a,{href:`https://github.com/villagesql/vsql-branch`,children:`villagesql/vsql-branch`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`License`})}),_jsx(_components.td,{children:`GPL-2.0`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Written in`})}),_jsx(_components.td,{children:`Rust`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Capability`})}),_jsx(_components.td,{children:`Preview`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`This extension declares preview capabilities, so\n`,_jsx(_components.code,{children:`vsql_allow_preview_extensions`}),` must be `,_jsx(_components.code,{children:`ON`}),`. Start the server with\n`,_jsx(_components.code,{children:`--vsql_allow_preview_extensions=ON`}),`, or run\n`,_jsx(_components.code,{children:`SET PERSIST vsql_allow_preview_extensions = ON`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`vsql_branch`}),` is not bundled with the server, so build it from the repository\nfirst. The build needs the Rust toolchain and `,_jsx(_components.code,{children:`cargo-vsql`}),`\n(`,_jsx(_components.code,{children:`cargo install cargo-vsql`}),`). Point `,_jsx(_components.code,{children:`VillageSQL_BUILD_DIR`}),` at your server build\ntree and run, from the repository:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` VillageSQL_BUILD_DIR`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$HOME`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`villagesql`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cargo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` vsql`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`cargo vsql install`}),` builds the extension and copies `,_jsx(_components.code,{children:`vsql_branch.veb`}),` into the\nserver’s `,_jsx(_components.code,{children:`lib/veb`}),` directory. Then install it, and turn on the background worker\nthat copies, resets, and drops branches:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`INSTALL EXTENSION vsql_branch;`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` PERSIST `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`worker_enabled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Until the worker runs, every function except `,_jsx(_components.code,{children:`mcp_tools`}),` fails:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ERROR 3200 (HY000): VDF error in function 'list_branches': vsql_branch: the vsql_branch worker is not running. Run SET PERSIST vsql_branch.worker_enabled = ON`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`UNINSTALL EXTENSION vsql_branch`}),` deletes the persisted\n`,_jsx(_components.code,{children:`vsql_branch.worker_enabled`}),` value, so run the `,_jsx(_components.code,{children:`SET PERSIST`}),` again after you\ninstall the extension again.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-it-adds`,children:`What it adds`}),`\n`,_jsxs(_components.p,{children:[`Every function except `,_jsx(_components.code,{children:`mcp_tools`}),` takes one JSON string and returns a JSON\nstring. SQL `,_jsx(_components.code,{children:`NULL`}),` counts as `,_jsx(_components.code,{children:`{}`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Function`}),_jsx(_components.th,{children:`Arguments`}),_jsx(_components.th,{children:`Returns`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`create_branch(json)`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`src_branch_id`}),`, and optionally `,_jsx(_components.code,{children:`mode`})]}),_jsxs(_components.td,{children:[`The new branch and an `,_jsx(_components.code,{children:`operation_id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`list_branches(json)`})}),_jsxs(_components.td,{children:[`none, so pass `,_jsx(_components.code,{children:`NULL`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{\"items\": [...]}`}),`, one entry per branch`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`describe_branch(json)`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`branch_id`})}),_jsx(_components.td,{children:`One branch`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`reset_branch(json)`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`branch_id`})}),_jsx(_components.td,{children:`An operation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`delete_branch(json)`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`branch_id`})}),_jsx(_components.td,{children:`An operation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`get_connection_string(json)`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`branch_id`}),`, and optionally `,_jsx(_components.code,{children:`user`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{\"connection_string\": \"mysql://...\"}`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`get_operation(json)`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`operation_id`})}),_jsx(_components.td,{children:`An operation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mcp_tools()`})}),_jsx(_components.td,{}),_jsx(_components.td,{children:`The branch functions as Model Context Protocol tools`})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`name`}),` is the branch name and the name of the new database: 1 to 64\ncharacters from A-Z, a-z, 0-9, and `,_jsx(_components.code,{children:`_`}),`. `,_jsx(_components.code,{children:`src_branch_id`}),` is the source database,\nwhich can be any database except the system databases. `,_jsx(_components.code,{children:`mode`}),` is\n`,_jsx(_components.code,{children:`schema-only`}),`, the default, which copies every table, view, and trigger without\ntheir rows, or `,_jsx(_components.code,{children:`data`}),`, which copies the rows too. `,_jsx(_components.code,{children:`branch_id`}),` is the branch name.`]}),`\n`,_jsxs(_components.p,{children:[`A SQL function cannot run DDL, so `,_jsx(_components.code,{children:`create_branch`}),`, `,_jsx(_components.code,{children:`reset_branch`}),`, and\n`,_jsx(_components.code,{children:`delete_branch`}),` queue the work and return at once. Call `,_jsx(_components.code,{children:`get_operation`}),` until\nits `,_jsx(_components.code,{children:`state`}),` is `,_jsx(_components.code,{children:`succeeded`}),` or `,_jsx(_components.code,{children:`failed`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(_components.p,{children:`Start from a source database:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TABLE`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.customers (id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`INT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` PRIMARY KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` VARCHAR`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`NOT NULL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TABLE`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.orders (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`INT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` PRIMARY KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` customer_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`INT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` NOT NULL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` total `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DECIMAL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`NOT NULL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FOREIGN KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (customer_id) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`REFERENCES`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`customers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (id)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`INSERT INTO`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`customers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` VALUES`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Ada'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Grace'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`INSERT INTO`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`orders`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` VALUES`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`25`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`00`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`11`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`40`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`00`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Copy it, rows included, into a branch named `,_jsx(_components.code,{children:`shop_test`}),`. The copy takes a\nmoment, so wait before you check the operation, and check it again while its\n`,_jsx(_components.code,{children:`state`}),` is `,_jsx(_components.code,{children:`pending`}),` or `,_jsx(_components.code,{children:`running`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` @r `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`create_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{\"name\":\"shop_test\",\"src_branch_id\":\"shop\",\"mode\":\"data\"}'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`DO SLEEP(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`get_operation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` JSON_OBJECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'operation_id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`JSON_VALUE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(@r, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'$.operation_id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` op\\\\G`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`*************************** 1. row ***************************`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`op: {\"branch_id\":\"shop_test\",\"created_at\":\"2026-12-04T19:12:43Z\",\"failure_message\":null,\"id\":\"op_1a242791fba0004\",\"state\":\"succeeded\",\"type\":\"branch_create\",\"updated_at\":\"2026-12-04T19:12:44Z\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Change the branch. The source does not change:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DELETE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` shop_test`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`orders`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` customer_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`orders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` source_orders,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` shop_test`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`orders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` branch_orders;`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+---------------+---------------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| source_orders | branch_orders |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+---------------+---------------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| 3 | 1 |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+---------------+---------------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Reset the branch to match the source again. `,_jsx(_components.code,{children:`reset_branch`}),` returns the\noperation itself, so read its `,_jsx(_components.code,{children:`id`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` @r `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`reset_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{\"branch_id\":\"shop_test\"}'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`DO SLEEP(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` JSON_VALUE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`get_operation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` JSON_OBJECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'operation_id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`JSON_VALUE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(@r, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'$.id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))), `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'$.state'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` state`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` shop_test`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`orders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{numberOfLines:`12`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| state |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| succeeded |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| COUNT(*) |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| 3 |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`A branch takes one operation at a time, so wait for one to succeed before you\nstart the next on the same branch. List the branches with `,_jsx(_components.code,{children:`JSON_TABLE`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, mode, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`status`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JSON_TABLE(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`list_branches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`NULL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'$.items[*]'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COLUMNS (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` VARCHAR`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`64`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`PATH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '$.name'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` mode `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`VARCHAR`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`16`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`PATH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '$.mode'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` VARCHAR`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`16`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`PATH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '$.status'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` b;`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+------+--------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| name | mode | status |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+------+--------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| shop_test | data | active |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+------+--------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Drop the branch, check that the operation finished, and drop the source\ndatabase:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` @r `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`delete_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{\"branch_id\":\"shop_test\"}'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`DO SLEEP(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` JSON_VALUE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`vsql_branch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`get_operation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` JSON_OBJECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'operation_id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`JSON_VALUE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(@r, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'$.id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))), `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'$.state'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` state`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DROP`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` shop;`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| state |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`| succeeded |`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`+-----------+`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Every account can call the functions, including an account that has only\n`,_jsx(_components.code,{children:`USAGE`}),`. The worker runs its SQL without checking the caller’s privileges, so\nsuch an account can copy any database that is not a system database and reset\nor drop any branch. Install the extension only on a server whose accounts you\ntrust with that.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`delete_branch`}),` drops the database of any row in the table\n`,_jsx(_components.code,{children:`vsql_branches.branches`}),`. An account that can write that table can add\na row for any database that is not a system database, and after the next\nrestart the worker drops that database on request. Grant write access to\n`,_jsx(_components.code,{children:`vsql_branches.branches`}),` only to accounts you trust with that.`]}),`\n`,_jsxs(_components.li,{children:[`Stored procedures, stored functions, and events are not copied. Tables,\nviews, and triggers are, and the worker changes every name of the source\ndatabase in a view or trigger to the branch, including text inside a string\nliteral, such as `,_jsx(_components.code,{children:`'see shop.items'`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`In `,_jsx(_components.code,{children:`data`}),` mode, writes to the source tables wait while the worker copies\ntheir files, and the worker fails the operation if it waits more than 30\nseconds for a lock. The tables of a data branch can come from different\nmoments, so branch an idle source when the tables must agree.`]}),`\n`,_jsx(_components.li,{children:`Operations live in memory, so a restart forgets them.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/en/extensions/managing`,children:`Managing extensions`}),` — how extension settings are read and written`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/en/extensions/build/preview-capabilities`,children:`Preview capabilities`}),` — what the preview flag turns on and what it promises`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/en/extensions/catalog`,children:`Available extensions`}),` — the full catalog`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://github.com/villagesql/vsql-branch`,children:`villagesql/vsql-branch`}),` — source, build instructions, and the known limitations`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"vsql_branch extension for MySQL","sidebarTitle":"vsql_branch","description":"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.","keywords":"mysql database branching, mysql copy database, mysql test database copy, mysql branch database, vsql_branch","audience":"villagesql-user","href":"/en/extensions/vsql-branch"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"What it adds","slug":"what-it-adds","depth":2,"children":[]},{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"Limits","slug":"limits","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/villagesql/2202b5e0d18501d7/consent-loader.js"],"subdomain":"villagesql","siteName":"VillageSQL Docs","title":"vsql_branch extension for MySQL - VillageSQL Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/extensions/vsql-branch","matchLevel":0},"ja":{"href":"/ja","matchLevel":4},"ko":{"href":"/ko","matchLevel":4},"zh":{"href":"/zh","matchLevel":4},"pt-BR":{"href":"/pt-BR","matchLevel":4}}},"lastModified":"2026-12-04T22:03:54.735Z","originalFileLocation":"en/extensions/vsql-branch.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.\">\u003cmeta data-mint-head name=\"application-name\" content=\"VillageSQL Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"vsql_branch extension for MySQL - VillageSQL Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"VillageSQL Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://villagesql.com/docs/en/extensions/vsql-branch\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://villagesql.mintlify.site/docs/_mintlify/api/og/v2?division=Available+Extensions\u0026amp;title=vsql_branch+extension+for+MySQL\u0026amp;description=The+vsql_branch+extension+copies+a+MySQL+database+into+a+branch+on+the+same+server%2C+with+or+without+its+rows%2C+so+you+can+test+a+migration+on+the+copy%2C+reset+it%2C\u0026amp;theme=665425dfd3eb4b80afb93c77\u0026amp;signature=19d228c17983478a6e649c4992937e0bdbfac8b3ee48ca32daf2187294571b48\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"vsql_branch extension for MySQL - VillageSQL Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://villagesql.mintlify.site/docs/_mintlify/api/og/v2?division=Available+Extensions\u0026amp;title=vsql_branch+extension+for+MySQL\u0026amp;description=The+vsql_branch+extension+copies+a+MySQL+database+into+a+branch+on+the+same+server%2C+with+or+without+its+rows%2C+so+you+can+test+a+migration+on+the+copy%2C+reset+it%2C\u0026amp;theme=665425dfd3eb4b80afb93c77\u0026amp;signature=19d228c17983478a6e649c4992937e0bdbfac8b3ee48ca32daf2187294571b48\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/villagesql/LyGu9hbDVoyQmlU_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"VillageSQL Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#9500BF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://villagesql.com/docs/en/extensions/vsql-branch\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/en/extensions/vsql-branch.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://villagesql.com/#organization\",\"name\":\"VillageSQL Docs\",\"url\":\"https://villagesql.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/villagesql/ER5Fb1fv5K0c6u26/images/logo-light.svg?fit=max\u0026auto=format\u0026n=ER5Fb1fv5K0c6u26\u0026q=85\u0026s=984aeecbb83c7ff4d729220dc5b295ba\"}},{\"@type\":\"WebSite\",\"@id\":\"https://villagesql.com/docs#website\",\"name\":\"VillageSQL Docs\",\"url\":\"https://villagesql.com/docs\",\"publisher\":{\"@id\":\"https://villagesql.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://villagesql.com/docs/en/extensions/vsql-branch#webpage\",\"url\":\"https://villagesql.com/docs/en/extensions/vsql-branch\",\"name\":\"vsql_branch extension for MySQL\",\"description\":\"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.\",\"dateModified\":\"2026-12-04T22:03:54.735Z\",\"isPartOf\":{\"@id\":\"https://villagesql.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://villagesql.com/docs/en/extensions/vsql-branch#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://villagesql.com/docs/en/extensions/vsql-branch#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Extension Catalog\",\"item\":\"https://villagesql.com/docs/en/extensions/vsql-ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Available Extensions\",\"item\":\"https://villagesql.com/docs/en/extensions/catalog\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"vsql_branch extension for MySQL\",\"item\":\"https://villagesql.com/docs/en/extensions/vsql-branch\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://villagesql.com/docs/en/extensions/vsql-branch#article\",\"headline\":\"vsql_branch extension for MySQL\",\"name\":\"vsql_branch extension for MySQL\",\"description\":\"The vsql_branch extension copies a MySQL database into a branch on the same server, with or without its rows, so you can test a migration on the copy, reset it, and drop it.\",\"url\":\"https://villagesql.com/docs/en/extensions/vsql-branch\",\"mainEntityOfPage\":{\"@id\":\"https://villagesql.com/docs/en/extensions/vsql-branch#webpage\"},\"dateModified\":\"2026-12-04T22:03:54.735Z\",\"publisher\":{\"@id\":\"https://villagesql.com/#organization\"},\"isPartOf\":{\"@id\":\"https://villagesql.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"VillageSQL Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"VillageSQL Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/en/extensions/vsql-branch.md","siteName":"VillageSQL Docs","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":""}]},{"tab":"Extensions","groups":[{"group":"Install and Run Extensions","pages":[{"title":"Installing Extensions","href":"/en/extensions/install"},{"title":"Uninstalling Extensions","href":"/en/extensions/uninstall"},{"title":"Managing Extensions","href":"/en/extensions/managing"}]},{"group":"Extension Catalog","pages":[{"group":"Available Extensions","root":{"title":"Available Extensions","href":"/en/extensions/catalog"},"expanded":false,"pages":[{"title":"vsql_ai extension for MySQL","sidebarTitle":"vsql_ai","href":"/en/extensions/vsql-ai"},{"title":"vsql_boolean extension for MySQL","sidebarTitle":"vsql_boolean","description":"The vsql_boolean extension adds a STRICTBOOL column type to MySQL that stores one byte, accepts true/false, yes/no, and on/off, and rejects anything else.","href":"/en/extensions/vsql-boolean"},{"title":"vsql_branch extension for MySQL","sidebarTitle":"vsql_branch","href":"/en/extensions/vsql-branch"},{"title":"vsql_crypto extension for MySQL","sidebarTitle":"vsql_crypto","description":"The vsql_crypto extension brings the pgcrypto function set to MySQL: hashing, HMAC signatures, AES encryption, password hashing, and secure random data.","href":"/en/extensions/vsql-crypto"},{"title":"vsql_cube extension for MySQL","sidebarTitle":"vsql_cube","href":"/en/extensions/vsql-cube"},{"title":"vsql_currency extension for MySQL","sidebarTitle":"vsql_currency","href":"/en/extensions/vsql-currency"},{"title":"vsql_duckdb extension for MySQL","sidebarTitle":"vsql_duckdb","href":"/en/extensions/vsql-duckdb"},{"title":"vsql_fuzzystrmatch extension for MySQL","sidebarTitle":"vsql_fuzzystrmatch","href":"/en/extensions/vsql-fuzzystrmatch"},{"title":"vsql_http extension for MySQL","sidebarTitle":"vsql_http","href":"/en/extensions/vsql-http"},{"title":"vsql_mcp extension for MySQL","sidebarTitle":"vsql_mcp","href":"/en/extensions/vsql-mcp"},{"title":"vsql_network_address extension for MySQL","sidebarTitle":"vsql_network_address","href":"/en/extensions/vsql-network-address"},{"title":"vsql_oauth2 extension for MySQL","sidebarTitle":"vsql_oauth2","href":"/en/extensions/vsql-oauth2"},{"title":"vsql_rest extension for MySQL","sidebarTitle":"vsql_rest","href":"/en/extensions/vsql-rest"},{"title":"vsql_stat_ch extension for MySQL","sidebarTitle":"vsql_stat_ch","href":"/en/extensions/vsql-stat-ch"},{"title":"vsql_textsearch extension for MySQL","sidebarTitle":"vsql_textsearch","href":"/en/extensions/vsql-textsearch"},{"title":"vsql_trgm extension for MySQL","sidebarTitle":"vsql_trgm","href":"/en/extensions/vsql-trgm"},{"title":"vsql_uuid extension for MySQL","sidebarTitle":"vsql_uuid","href":"/en/extensions/vsql-uuid"},{"title":"prometheus_exporter extension for MySQL","sidebarTitle":"prometheus_exporter","href":"/en/extensions/prometheus-exporter"},{"title":"vsql_address_standardizer extension for MySQL","sidebarTitle":"vsql_address_standardizer","href":"/en/extensions/vsql-address-standardizer"},{"title":"vsql_hll extension for MySQL","sidebarTitle":"vsql_hll","href":"/en/extensions/vsql-hll"},{"title":"vsql_luhn extension for MySQL","sidebarTitle":"vsql_luhn","href":"/en/extensions/vsql-luhn"},{"title":"vsql_nanoid extension for MySQL","sidebarTitle":"vsql_nanoid","href":"/en/extensions/vsql-nanoid"},{"title":"vsql_pgjwt extension for MySQL","sidebarTitle":"vsql_pgjwt","href":"/en/extensions/vsql-pgjwt"},{"title":"vsql_slugify extension for MySQL","sidebarTitle":"vsql_slugify","href":"/en/extensions/vsql-slugify"},{"title":"vsql_statistics extension for MySQL","sidebarTitle":"vsql_statistics","href":"/en/extensions/vsql-statistics"},{"title":"vsql_complex extension for MySQL","sidebarTitle":"vsql_complex","href":"/en/extensions/vsql-complex"}]}]},{"group":"Build an Extension","pages":[{"title":"Creating Extensions in C++","href":"/en/extensions/build/create"},{"title":"Creating Extensions in Rust","href":"/en/extensions/build/rust-sdk"},{"title":"MySQL Extensions, Plugins, and Components","sidebarTitle":"Extensions or Plugins and Components","href":"/en/extensions/build/extensions-or-plugins"},{"title":"Extension Architecture","href":"/en/extensions/build/architecture"},{"title":"How Extensions and the ABI Behave","href":"/en/extensions/build/extension-abi-behavior"},{"title":"VEF Coverage Compared to PostgreSQL","href":"/en/extensions/build/postgresql-hooks"},{"group":"Preview Capabilities","root":{"title":"Preview Capabilities","href":"/en/extensions/build/preview-capabilities"},"expanded":false,"pages":[{"title":"Authentication Methods","href":"/en/extensions/build/preview-auth"},{"title":"Keyring Access and MySQL Services","href":"/en/extensions/build/preview-keyring-services"},{"title":"Status, System, and Session Variables","href":"/en/extensions/build/preview-server-variables"},{"title":"Thread Worker and SQL Query","href":"/en/extensions/build/preview-background-sql"},{"title":"Column Storage","href":"/en/extensions/build/preview-column-storage"},{"title":"Custom Indexes","href":"/en/extensions/build/custom-indexes"},{"title":"Statement Events","href":"/en/extensions/build/preview-statement-events"}]},{"title":"Older Protocols","href":"/en/extensions/build/older-protocols"}]}]},{"tab":"Server","menu":[{"item":"MySQL 8.4","icon":"database","pages":[{"title":"MySQL 8.4","href":"/en/8.4/stable/introduction"}]},{"item":"Percona Server 8.4","icon":"database","pages":[{"title":"Percona Server 8.4","href":"/en/8.4/stable/percona"}]},{"item":"MySQL 9.7","icon":"database","pages":[{"title":"MySQL 9.7","href":"/en/9.7/stable/introduction"}]},{"item":"Dev releases","icon":"flask","pages":[{"title":"Dev releases","href":"/en/dev-releases"}]},{"item":"Past releases","icon":"clock-rotate-left","pages":[{"title":"Past releases","href":"/en/past-releases"}]}],"pages":[{"title":"Server","href":"/en/8.4/stable/introduction"}]},{"tab":"Reference","menu":[{"item":"C++ SDK","icon":"code","pages":[{"title":"C++ SDK","href":"/en/sdk/cpp/extension-api-reference"}]},{"item":"Rust SDK","icon":"rust","pages":[{"title":"Rust SDK","href":"/en/sdk/rust/api-reference"}]}],"pages":[{"title":"Reference","href":"/en/sdk/cpp/extension-api-reference"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/en/tutorial"}]},{"tab":"Resources","menu":[{"item":"villagesql.com","icon":"https://mintlify.s3.us-west-1.amazonaws.com/villagesql/images/pelican.svg","href":"https://villagesql.com"},{"item":"GitHub","icon":"github","href":"https://github.com/villagesql/villagesql-server"},{"item":"Issues","icon":"bug","href":"https://github.com/villagesql/villagesql-server/issues"},{"item":"Discord","icon":"discord","href":"https://discord.gg/KSr6whd3Fr"},{"item":"Blog","icon":"newspaper","href":"https://villagesql.com/blog"},{"item":"Contribute to the Server","icon":"code-pull-request","href":"https://github.com/villagesql/villagesql-server/blob/main/CONTRIBUTING.md"},{"item":"Contribute to the Docs","icon":"pen-nib","href":"https://github.com/villagesql/villagesql-docs/blob/main/CONTRIBUTING.md"}]}]},{"language":"ja","pages":[{"title":"ja","href":"/ja"}]},{"language":"ko","pages":[{"title":"ko","href":"/ko"}]},{"language":"zh","pages":[{"title":"zh","href":"/zh"}]},{"language":"pt-BR","pages":[{"title":"pt-BR","href":"/pt-BR"}]}]},"basePath":"","title":"vsql_branch extension for MySQL - VillageSQL Docs","deploymentId":"dpl_BsHU5ynwUyfZMwoLvGC66duJuw65","buildId":"dpl_BsHU5ynwUyfZMwoLvGC66duJuw65","dynamics":[],"chunks":[]}