Skip to content

Specific usage

Install the GitHub Copilot extension

  1. Install GitHub Copilot from the VS Code Marketplace.

  2. Install the Db2 for IBM i extension from the VS Code Marketplace.

  3. Connect to your IBM i system using the Code for IBM i extension.

  4. Once connected, the @db2i chat participant is available in the chat window. You can ask questions about your database, and get help with writing SQL queries.

Examples

Once GitHub Copilot is installed, you can ask questions about your database using the @db2i chat participant. Here are some examples:

Example 1: Summarize the columns in the EMPLOYEE table

This is a simple example to show how you can ask questions about the structure of your database. You can ask the chat participant to summarize the columns in a table.

alt text

Example 2: Ask to find out what objects are related to employee?

This example shows how you can ask the chat participant to find out what objects are related to the employee table. The chat participant will return a list of related objects, including the department table.

It will tell you if it can’t get the related objects or if there are none.

alt text

Example 3: Try out a follow up question.

The screenshots that after the participant has responsed, it will sometimes offer some additional follow up questions. Simply clicking on one of these will ask the question to the chat participant.

alt text


Example 4: Using our ‘Run SQL statement’ tool to summarize information.

This example shows how you can use the Run SQL statement tool to ask information about the data in your system. Before the tool will run any SQL statement, it will ask you to confirm that you want to run the SQL statement. This is a safety feature to prevent you from running SQL statements that could modify your data.

To use the tool, you can either reference it by tagging #result in your request, or by using the paperclip icon to attach Run SQL statement.

alt text

It will then take the result set of the statement and summarize the information based on your request.

alt text