Create Disposable TiDB Cloud Zero Databases (Technical Preview)
name: tidb-cloud-zero
by bosn · published 2026-03-22
$ claw add gh:bosn/bosn-zero---
name: tidb-cloud-zero
description: Create ephemeral TiDB Cloud Zero databases for agent workflows in Technical Preview.
metadata:
version: 0.0.0
homepage: /
---
# Create Disposable TiDB Cloud Zero Databases (Technical Preview)
> **Browser UI Note:** There is no browser-based SQL editor on this site. To run SQL, use API + CLI, or sign in to TiDB Cloud Console (login required).
Use this guide to create disposable TiDB Cloud Zero databases for agent workflows.
Deterministic SQL Smoke Test (API + CLI)
# 1) Provision instance
curl -s -X POST https://zero.tidbapi.com/v1alpha1/instances \
-H "Content-Type: application/json" \
-d '{"tag":"sql-smoke-test"}' \
| tee tidb-zero.json
# 2) Extract connection string
jq -r '.instance.connectionString // .connectionString' tidb-zero.json
# 3) Run SQL query (replace <connectionString> with step 2 output)
mysql "<connectionString>" -e "SELECT 1 AS health_check, 2 AS example_value;"Expected output includes one row with `health_check=1` and `example_value=2`.
Endpoint
Request Body
{
"tag": "support-bot"
}Quick Start
curl -X POST https://zero.tidbapi.com/v1alpha1/instances \
-H "Content-Type: application/json" \
-d '{
"tag": "agent-run"
}'Response
The API returns connection details and expiration time.
{
"instance": {
"connection": {
"host": "<HOST>",
"port": 4000,
"username": "<USERNAME>",
"password": "<PASSWORD>"
},
"connectionString": "mysql://<USERNAME>:<PASSWORD>@<HOST>:4000",
"expiresAt": "<ISO_TIMESTAMP>"
}
}Use the Connection String
After you receive the response, use `instance.connectionString` to connect with a MySQL-compatible client or driver.
Guided Quick Experience
After provisioning succeeds, you should ask the user:
If the user says yes, run a small bootstrap SQL flow like this:
CREATE TABLE IF NOT EXISTS quickstart_notes (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(100) NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO quickstart_notes (title, content) VALUES
('welcome', 'TiDB Cloud Zero quickstart row'),
('query-demo', 'Run SELECT * FROM quickstart_notes; to verify data');
SELECT * FROM quickstart_notes ORDER BY id;Connect via CLI
mysql --connect-timeout=10 --protocol=TCP -h '<HOST>' -P 4000 -u '<USERNAME>' -p'<PASSWORD>'Connect in Node.js (`mysql2`)
import mysql from "mysql2/promise";
const response = await createDatabase(); // your API call result
const connectionUrl = new URL(response.instance.connectionString);
connectionUrl.pathname = "/<DATABASE>";
connectionUrl.searchParams.set("ssl", JSON.stringify({ rejectUnauthorized: true }));
const connection = await mysql.createConnection(connectionUrl.toString());
const [rows] = await connection.query("SELECT NOW() AS now_time");
console.log(rows);
await connection.end();Resources
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...