Database Management
Última actualización:2024-09-20

Database Management

The database functionality is integrated with the Bot. This feature allows for the creation of multiple data tables and the addition of data, enabling fast entry and management of structured data. Each Bot can have multiple data tables, and each data table can add multiple pieces of data.
Currently, it only supports creating data tables and storing data on the GPTBots platform. It will soon support interfacing and accessing external databases through standardized interfaces (JDBC, RESTful, etc.), enabling data import and remote connection.

Database List

image-20241011111727631 The data table is the basic unit of the database, and each Bot can have multiple data tables. The Bot can generate SQL statements based on user queries to perform queries on single or multiple tables.

  • Data Table Name: The name of the data table. Concise, standardized, and accurate naming is very important as it can effectively improve the quality of SQL generation.
  • Data Table Description: The description information of the data table. Natural language can be used to accurately describe the data table, which can effectively improve the quality of SQL generation.
  • Number of Fields: The number of fields contained in this data table.
  • Amount of Data: The number of data entries contained in this data table.
  • Settings: You can update the description information of the data table and add or delete table fields.
  • Delete: You can delete data table (provided that the amount of data in the data table is 0).

    Once the data table name is created, it cannot be changed; however, the description information can be edited.

Create Data Table

image-20241011112119393

  1. Enter the Bot settings page and click the "Database" option.
  2. Click the "Create Data Table" button to enter the data table creation page.
  3. Add Fields: There are three ways to add.
  • Adding fields manually Enter the data table name and description, add table field information, and click the "Confirm" button to complete the creation of the data table.

    Data table naming rules: Must start with a letter, a~z/numbers and underscores, 64 characters.
    Data table description rules: Natural language, 128 characters.

  • JSON Add Table Fields image-20241114194655101

image-20241114194741596

  • AI Add Fields

image-20241114194837604

Add Fields to Data Table

Data table fields are the basic units of a data table, and each data table can contain multiple fields. Each field consists of four elements: name, description, data type, and necessity. image-20241114194916112

  • Field Name: An accurate and clear field name can effectively improve the quality of SQL generation. Naming should start with a letter, a~z/numbers and underscores, 32 characters.
  • Field Description: Accurate and clear field description information can effectively improve the quality of SQL generation. Naming can use natural language, 128 characters.
  • Data Type: The data type used to identify the information stored in the field, including string/int/float/datetime/boolean, default is string.
  • Necessity: After checking "Necessity", this field must have a value when adding data, otherwise it will be discarded.

Once the field name is created, it cannot be modified, but the field description information can be edited.
Field deletion is supported. Once a field is deleted, all values of that field will be deleted, so please proceed with caution!