SQL Editor default mode is read-only, which only supports running SELECT queries. If you attempt to run DDL or DML change queries, SQL Editor will prompt you to create a new issue to start the SQL change workflow.Workspace Admins and DBAs are allowed to execute any SQL statements in Admin Mode.The read-only mode is not available for MongoDB, but you also can execute the statements in Admin Mode.

IntelliSense

autocomplete IntelliSense depends on WebSocket. If you access Bytebase via a gateway, you need to enable WebSocket there. Here is a NGINX configuration:

http {
    server {
        ...

       location ~ ^/(v1:adminExecute|lsp) {
            proxy_pass http://bytebase.example.com;
            proxy_http_version 1.1;
            # Enables WebSocket which is required for SQL Editor autocomplete
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        }
        ...
    }
}

Run query

Click the Run button or use the shortcut key (⌘ + Enter) to run your queries in the SQL Editor. If you have multiple SQL queries separated by semicolons, SQL Editor will only run the first query for now.

Max returned row count

SQL Editor can return at most 100,000 rows. Query Row Limit

Max returned result size

The default query result size is 100 MB. You can change it under the Workspace settings. Query Result Size Limit

Export data

The exported data still respects the masking policy to mask exported columns if enforced.
If you have been granted export access, you can directly export query results in various formats. Export Data Otherwise, you can request the exported data Request Export Request Export

EXPLAIN query

Explain Query SQL Editor provides an Explain Query action to run EXPLAIN on the selected query. You can access it from right click or use the shortcut key (⌘ + E) instead of prepending EXPLAIN manually. For PostgreSQL database, Bytebase also embeds PEV2 to visualize the plan. visualize-plan visualize-plan

Batch mode

You can batch query many databases having the same schema: batch-query-setting For each database, the query result will show up in its own tab: batch-query-result1 batch-query-result2