Explore Your Data with SQL Editor (Preview)



You can use the built-in SQL Editor in the TiDB Cloud console to maximize your data value.

In SQL Editor, you can write and run SQL queries against databases without a local SQL client. You can intuitively view the query results in tables or charts and easily check the query logs.

Use cases

The recommended use cases of SQL Editor are as follows:

  • Quickly test the MySQL compatibility of TiDB.
  • Easily explore the SQL features in TiDB using your own datasets.

Limitations

Access SQL Editor

  1. Go to the My TiDB page.

  2. Click the name of your TiDB Cloud Starter instance or TiDB Cloud Dedicated cluster, and then click SQL Editor in the left navigation pane.

Write and run SQL queries

In SQL Editor, you can write and run SQL queries using your own dataset.

  1. Write SQL queries.

  2. Run SQL queries.

      For macOS:

      • If you have only one query in the editor, to run it, press ⌘ + Enter or click Run.

      • If you have multiple queries in the editor, to run one or several of them sequentially, select the lines of the target queries with your cursor, and then press ⌘ + Enter or click Run.

      • To run all queries in the editor sequentially, press ⇧ + ⌘ + Enter, or select the lines of all queries with your cursor and click Run.

      For Windows or Linux:

      • If you have only one query in the editor, to run it, press Ctrl + Enter or click Run.

      • If you have multiple queries in the editor, to run one or several of them sequentially, select the lines of the target queries with your cursor, and then press Ctrl + Enter or click Run.

      • To run all queries in the editor sequentially, press Shift + Ctrl + Enter, or select the lines of all queries with your cursor and click Run.

    After running the queries, you can see the query logs and results immediately at the bottom of the page.

    Manage SQL files

    In SQL Editor, you can save your SQL queries in different SQL files and manage SQL files as follows:

    • To add a SQL file, click + on the SQL Files tab.
    • To rename a SQL file, move your cursor on the filename, click ... next to the filename, and then select Rename.
    • To delete a SQL file, move your cursor on the filename, click ... next to the filename, and then select Delete. Note that when there is only one SQL file on the SQL Files tab, you cannot delete it.

    Manage SQL Editor settings

    In SQL Editor, you can change the following settings:

    • The maximum number of rows in query results
    • Whether to show system database schemas on the Schemas tab

    To change the settings, take the following steps:

    1. In the upper-right corner of SQL Editor, click ... and select Settings.
    2. Change the settings according to your need.
    3. Click Save.

    Was this page helpful?