TiDB
TiDB is its own database type in QueryDesk. It speaks the MySQL protocol, so the schema sync, the table structure view, data protection and peer reviews work as they do on MySQL. QueryDesk is tested against TiDB 8.5.
Connect a cluster
Add the database as in Connect a database, with these values:
| Field | Value |
|---|---|
| Database type | TiDB |
| Port | 4000, TiDB's default. |
| Database name | The database to query, for example test. |
TiDB Cloud
The cluster's Connect dialog in the TiDB Cloud console gives a mysql:// connection string. Choose TiDB as the database type first, then paste the string under Update with connection string on the database's settings page and click Apply. The database keeps the TiDB type. TiDB Cloud requires TLS, so turn on Encryption if the string didn't. Its user names have a prefix, such as 2abc.root; enter the whole name.
Click Test Connection under the credential to check the connection.
What works differently
- AI read-only runs an AI query in a read-only stale-read transaction one second in the past (
AS OF TIMESTAMP NOW(6) - INTERVAL 1 SECOND), which is always rolled back, so it doesn't see writes from the last second. TiDB refuses a plain read-only transaction, and refuses any write in a stale-read one. - TiDB-only syntax that the MySQL parser doesn't read, such as
BATCH ... DELETE,SPLIT TABLEorAS OF TIMESTAMPin a query, is read as a write, and data protection refuses it. So does aSHOWthat prints column values, such asSHOW TABLE ... REGIONSorSHOW STATS_TOPN.