The TextSQL function provided in the database-related components is a feature that can generate SQL statements from Japanese input into the prompt to get the data you want using the ChatGPT function of OpenAI. In order to use the TextSQL function, you need to obtain the API Key and OrganizationId from OpenAI in advance. Please check here on how to get them.
Please get the API Key and OrganizationId from OpenAI. Then, set the properties in each database-related component so that you can correctly connect to the database.
2. Selecting a Table in Text2SQL
When you press the Text2SQL button, the Text2SQL panel will open.
3. Generating SQL Statements from Prompts
When the Text2SQL panel opens, if you can connect to the database correctly, the tables will be displayed in a list, so select the table you want to use.
When you press the Next button, the prompt input panel will be displayed.
Enter the data you want to get in Japanese in the prompt. When you press the Generate button, the generated SQL statement will be displayed in GENERATED SQL.
When you press the Test Query button, a panel for executing SQL and getting data will be displayed.
When you press the Accept button, the generated SQL statement will be copied to the SQL property of the component.
Need more help with this?
Join our slack community for help