Skip to main content

SQL Console for Redis-Compatible Databases

Use the NineData SQL Console to manage Redis-compatible databases, run Redis commands, inspect keys, edit key values, and review command execution results.

Background

Redis is an in-memory data structure store commonly used for caching, queues, and real-time analytics. Managing Redis data safely often requires command knowledge and operational experience.

NineData SQL Console helps you manage Redis databases more easily. View and edit Redis data, and create, delete, rename, or update Redis keys.

Features

NineData SQL Console provides several features that help you manage Redis-compatible data sources.

FeatureDescription
AI intelligent assistanceConverts short natural-language requests into Redis commands.
Visual managementSupports visual operations such as accessing and viewing data, creating, deleting, renaming, and modifying the expiration time of keys, and adding, deleting, and modifying the content of keys.
EditorProvides a command-line mode that supports powerful Redis commands and options to meet various needs. The Redis commands supported by the editor are listed in the appendix.
Workspace recoveryAfter an unexpected browser exit or host failure, sign in to the NineData console and open SQL Console again. NineData restores previously opened data sources and executed commands because the workspace state is saved in the cloud.
Execution historyHistory records commands executed by the current account in the NineData console. Search by data source, execution time, command keyword, or other fields, then copy and rerun commands from history.
SQL specification checkIn organization modeOrganization mode supports assigning roles and resource permissions to users in the same organization. It is suitable for team collaboration, data security, and productivity management., NineData checks every command executed in SQL Console against the SQL development policy configured by Administrator. Commands that do not comply with the policy are blocked.

Use cases

Use SQL Console for Redis-compatible databases to:

  • Developers: Manage and edit Redis data during application development.
  • Database administrators: Add, edit, and delete Redis data from a visual interface.
  • Operations teams: Monitor and analyze Redis database status to find and resolve issues quickly.

Limitations

  • Displaying the size of a Key is only supported in Redis version 4.0.0 and above.
  • Managing Keys of Stream type is only supported in Redis version 5.0.0 and above.

Before you begin

  • The target database has been added to NineData. For instructions, see Manage data sources.

  • The data source must be Redis (version 3.0.0 or higher) or PegaDB.

  • In the organizational mode (DevOps Enterprise), you must have read-only, DML, or DDL permissions on the target data source.

    tip

    Read-only permission only supports query operations.

  • In the commercial versions (DevOps Pro, DevOps Enterprise), make sure your monthly or yearly subscription has not expired. An expired subscription may prevent you from using the Database DevOps service. Check the remaining quota and expiration date in the NineData Console header.

    check_quota

Interface reference

  • Visual Editor

    gui

    Index
    Feature
    Description
    1SQL TabDisplays the SQL Console tab currently open for the data source. Click a tab to switch between SQL Consoles, or click X to close a SQL Console. The right-click menu supports these actions:
    • Instance Details: Open the current data source details window.
    • New Query: Open a new data source SQL console.
    • Close Tab: Close the current tab.
    2Open Data SourceSelect and open a new data source SQL console.
    3Data Source InformationDisplays the data source information for the current SQL console, including environment, IP address, and port number.
    Right-click menu:
    • Instance Details: Show detailed information of the current data source, including username, connection address, running time, and connection count, etc.
    • Refresh: Refresh the data source information.
    4Favorite|Refresh
    • Favorite: Click the favorite icon to add the current data source to My Favorites for quick access when opening a new SQL Console.
    • Refresh: Refresh the data in the current data source.
    5Database NameSwitches the Redis database.
    Right-click menu:
    • Database Details: View detailed information about the target database, including database name, default character set, database size, total number of keys, etc.
    • Create Key: Create a new key. The creation options depend on the Key Type. Follow the on-screen instructions.
    • New Query: Open a new SQL tab window.
    6Function Buttons
    • setting02: Settings
      • Results: Choose Overwrite or Append.
        • Overwrite (default): The new result set overwrites the previous execution result.
        • Append: Open new result sets in a new tab.
      • Theme: Change the SQL Console theme. Choose Light or Dark.
      • Font Size: Drag the slider to adjust the font size of SQL statements in the SQL Console. Default values:
        • Windows: 16
        • MacOS: 13
    • thread: View Threads Displays active connections on the current database server and the queries running in those connections. View Threads refresh intervals are 5, 10, 20, or 30 seconds.
    • table: Visualize Switch to visualization mode.
    • codefill: Editor Switch to editor mode.
    • expend: Full Screen Open SQL Console in full-screen browser mode. In full-screen mode, click compress Exit in the toolbar to restore the original SQL Console size.
    7SearchQuickly search for the target key by entering the key name. It supports both exact search by entering the complete key name and fuzzy search by entering partial characters with an asterisk (*) wildcard.
    8Key ListDisplays the keys in the current database, with a default load of 100 keys. To load more, scroll to the end of the list and click Load More to load another 100 keys. The Key List supports these actions:
    • Rename Key: Right-click the target key, click Rename Key, enter the new key name in the text box below New Name, and then click OK.
    • Delete Key: Right-click the target key, click Delete Key, and then click OK to delete the current key.
    • Modify TTL: Right-click the target key, click Modify TTL, enter an integer in the text box below TTL or click the UpDown button next to the text box to adjust the number up or down, the unit is in seconds, and then click OK. To remove the expiration time, delete the number in the text box and click OK.
    • Create Key: Right-click any key, click Create Key, and open the Create Key tab. Configure Key Type as required. Creation options vary by Key Type. Follow the page prompts. After configuration, click Create Key to create the key.
    • New Query: Right-click any key, click New Query, to open a new SQL tab window.
    • Refresh: Right-click any key, click Refresh, to refresh the key list.
    9Create KeyCreate a new key. Click Create Key to open the Create Key tab. Configure Key Type as required. Creation options vary by Key Type. Follow the page prompts. After configuration, click Create Key to create the key.
    Note: To close the Create Key tab, click the Close icon on the tab.
    10Key DetailsClick a key in the Key List to display its details here. For keys with data exceeding 100 records, only the first 100 records are loaded by default. Click Load More at the bottom of the page to load another 100 records.
    The Key Details area supports these actions on the key:
    • Common Operations:
      • Change Key Name: Click the edit icon to the right of the key name, enter the new key name in the text box, and then click check.
      • Refresh Key Content: Click the fresh icon to refresh the content of the key.
      • Delete Key: Click the delete icon, and then click OK to delete the current key.
      • Change Key Expiry: Click the edit icon next to TTL, enter an integer in the text box, or click the UpDown button next to the text box to adjust the number up or down. The unit is in seconds. Then click check. To remove the expiration time, delete the number in the text box and click check.
      • View Key Size (Only available in version 4.0.0 and above) and Length.
      • Change the Display Format of Key Data: Click the drop-down box to the left of the search box, which is set to Unicode by default. Select the desired display format.
      • Search Data in the Key (except for Stream type): Supports both exact and fuzzy searches. Click the search icon to view the search results.
        • Exact Search: Enter the complete field or value for an exact search.
        • Fuzzy Search: Enter a partial string with an asterisk wildcard (*) for fuzzy search.
    • Operations on Key Data: Depending on the type of key, different operations are supported. Typically, supported actions include adding, editing, and deleting data in the key. See the console for specific details.
  • Command Line Editor

    command_line

    Number
    Function
    Description
    1SQL TabDisplays the SQL Console tab currently open for the data source. Click a tab to switch between SQL Consoles, or click X to close a SQL Console. The right-click menu supports the following actions:
    • Instance Details: Open the details window for the current data source.
    • New Query: Open a new SQL console for a different data source.
    • Close Tab: Close the current tab.
    2Open Data SourceSelect and open a new SQL console for a different data source.
    3Data Source InformationDisplay information about the data source of the current SQL console, including environment, IP address, and port number.
    Right-click menu:
    • Instance Details: Show detailed information about the current data source, including username, connection address, runtime, and number of connections.
    • Refresh: Refresh the data source information.
    4Favorite|Refresh
    • Favorite: Click the favorite icon to add the current data source to My Favorites for quick access when opening a new SQL Console.
    • Refresh: Refresh the data in the current data source.
    5Database NameSwitch Redis databases or node addresses in cluster mode.
    Commands for switching node addresses in cluster mode include KEYS, SCAN, CLUSTER FLUSHSLOTS, CLUSTER MYID, CLUSTER MYSHARDID, CLUSTER ADDSLOTS, CLUSTER ADDSLOTSRANGE, CLUSTER DELSLOTS, and CLUSTER DELSLOTSRANGE. Run other commands on any node.
    Right-click menu:
    • Database Details: View detailed information about the target database, including database name, default character set, database size, total number of keys, etc.
    • Create Key: Create a new key. The creation options depend on the selected Key Type. Follow the on-screen instructions.
    • New Query: Open a new SQL console tab.
    6Function Buttons
    • execute: Execute Execute the selected Redis command.
    • Create Key: Open the Create Key tab. Choose Key Type. The available options depend on the selected Key Type. Follow the on-screen instructions, and click Create Key when finished.
    • thread: View Threads: Displays active connections on the current database server and the queries running in those connections. View Threads refresh intervals are 5, 10, 20, or 30 seconds.
    • collect: Favorite this SQL: Save all SQL statements in the current SQL Console to the SQL list for later use.
    • sqlfile: Favorites: View saved SQL statements, insert the target SQL with Insert, or use Edit and Delete.
    • sqlhistory: History View the command execution history of the target data source. Filter execution history by date or search by keyword, such as command, database number, or error message. Click Copy in the Actions column of the target execution history row to copy it to the clipboard.
    • setting02: Settings Set the display mode for the result set and the font size of the SQL console.
      • Results: Select either Overwrite or Append.
        • Overwrite (default): New result sets replace the previous execution result.
        • Append: Open new result sets in a new tab.
      • Theme: Change the SQL Console theme. Choose Light or Dark.
      • Font Size: Adjust the font size of the commands in the SQL console by dragging the slider. Default values:
        • Windows: 16
        • MacOS: 13
    • View Threads: Displays active connections on the current database server and the queries running in those connections.
    • admin: Enable Admin Mode|Disable Admin Mode Only Administrator can use this mode. When enabled, commands executed in SQL Console bypass standardization and approval flows.
    • table: Visualize Switch to visualization mode.
    • codefill: Editor Switch to editor mode.
    • expend: Full Screen Open SQL Console in full-screen browser mode. In full-screen mode, click compress in the toolbar to restore the original size of the SQL console.
    7SearchQuickly find the target key by entering the key name. Supports searching with the complete key name for precise search, or using partial characters with asterisks (*) as wildcards for fuzzy search.
    8Key ListDisplays the keys in the current database, with 100 keys loaded by default. To load more keys, scroll to the end of the list and click Load More to load another 100 keys. The Key List supports these actions:
    • Rename Key: Right-click the target key, click Rename Key, enter the new key name in the text box below New Name, and then click OK.
    • Delete Key: Right-click the target key, click Delete Key, and then click OK.
    • Modify TTL: Right-click the target key, click Modify TTL, enter an integer in the text box below TTL, or click the UpDown button to adjust the number up or down. The unit is seconds. Then click OK. To remove the expiration time, delete the number in the text box and click OK.
    • Create Key: Right-click any key, click Create Key, and open the Create Key tab. Choose Key Type. Creation options vary by the selected Key Type, so follow the on-screen prompts. Once configured, click Create Key.
    • New Query: Right-click any key, click New Query, to open a new SQL console tab.
    • Refresh: Right-click any key, click Refresh to refresh the key list.
    9Command Line WindowA window for executing Redis commands. It supports the following features:
    • Execute Redis commands: Supports executing single or multiple commands.
    • Syntax highlighting.
    • Right-click menu:
      • Execute: Execute the SQL statement at the cursor position.
      • Favorite this SQL: Save all commands in the current SQL Console to favorites for later use.
      • Favorites: View saved commands, insert the target command with Insert, or use Edit and Delete.
      • History: View the command execution history of the target data source. Filter command execution history by time period, or search by keyword, such as SQL statement, database name, or error message.
      • View Threads: Display information about active connections on the current database server and the queries running in those connections.
      • General operations: Use Cut, Copy, Paste, and Select All.
      • Select Current SQL: Select the SQL statement at the cursor position.
    10Execution Information, Result SetDisplays command execution information and result sets.
    • Execution Information: Includes execution time, executed command, execution status, execution details, and related fields.
    • Result Set: Displays the command results. Available actions:
      • Search within the result set. Supports Fuzzy and Exact.
      • Click the small arrow next to the column name to sort the result set.
      • View SQL Statement for Result Set: Hover over the target result set tab to view the SQL statement for that result set.

Procedure

  1. Sign in to the NineData Console.

  2. Go to DevOps > SQL Console.

    tip

    If a data source session is still open, NineData redirects you to that data source page.

  3. Click the text box below SQL Console. The data source selector displays the data sources you have added. Select the target data source, and then click Query to go to the SQL Console.

    tip
    • If no data source exists yet, the page is empty. Click Create Datasource on the page.
    • If you have multiple data sources, enter complete or partial keywords for exact or fuzzy search. The searchable fields are as follows:

      • Data source name

      • IP address

:::

  1. After SQL Console opens, manage the Redis-compatible data source. For interface details, see Interface reference.

Result

The SQL Console opens the selected Redis-compatible data source. Switch databases, browse and edit keys, run Redis commands, inspect execution results, and review command history.

Appendix: Command List Supported by Redis Editor

KeywordSupported VersionCommand Format
BITCOUNT2.6.0BITCOUNT key [start end]
BITFIELD3.2.0BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]
BITFIELD_RO6.0.0BITFIELD_RO key [GET encoding offset [GET encoding offset ...]]
BITOP2.6.0BITOP <AND | OR | XOR | NOT> destkey key [key ...]
BITPOS2.8.7BITPOS key bit [start [end [BYTE | BIT]]]
GETBIT2.2.0GETBIT key offset
SETBIT2.2.0SETBIT key offset value