Featured image of post Getting started: IBM Bob and Db2 Developer Extension combined

Getting started: IBM Bob and Db2 Developer Extension combined

I tested the Db2 Developer Extension together with IBM Bob, the AI-powered partner for the Software Development Lifecycle. For hands-on experience, I created an analytics solution for GBFS-based mobility data.

Getting Started

Recently, IBM released the IBM Db2 Developer Extension for Visual Studio Code. It allows you to easily install a Db2 instance based on the Db2 Community Edition, catalog Db2 connections, and execute SQL statement. This could be done without the extension. The real value is syntax checking and highlighting, code completion while editing SQL statement, and more.

You can install the extension from the marketplace (see link above) or by downloading the VSIX file from the Db2 Developer Extension’s GitHub release page. Once downloaded, run the command “Extensions: Install from VSIX” and pick the VSIX file. The latter is also the way I installed the extension into IBM Bob. Bob is currently in tech preview and its product page states: “Bob is your AI software development partner that understands your intent, repo, and security standards.” Bob offers some predefined modes and personas and acts as a AI-powered partner for the entire software development lifecycle. As such, you can plan a project, code, maintain software, research documentation or features, and more. Bob is based on VS Code and, hence, you can utilize most extensions.

Db2 instance

Within the Db2 Developer Extension I tried the button “Create Db2 instance”. It is supposed to get an instance of Db2 Community Edition up and running, including Linux and MacOS environments. I heard from colleagues that it works well on their Mac. In my Fedora environment, I had to install “podman-docker” to put a Docker abstraction on top of my podman runtime. Then, I succeeded and had a(nother) Db2 instance available, including a sample and testdb database.

From specification to code

IBM Bob is - more or less - like a regular Visual Studio Code. The Bob feature is only available after signing in. Once done, I switched to the “Plan” mode and described my envisioned project “Dott mobility dashboard for Friedrichshafen”, “regularly fetch data”, “analytics dashboard with map of vehicle positions”. etc. I also provided details like “Python”, “Db2”, pointing to the GBFS (General Bikeshare Feed Specification) discovery endpoint for Friedrichshafen, “local Db2 database named testdb”, and some more. I could have provided this information in a Markdown file and pointed to it, but opted for the longer prompt.

With my input, Bob created a project plan, layed out implementation steps, proposed a directory and file structure, and asked for permission to proceed to the “Code” phase. I continued and approved each step, each access to the file system and new code. Because I had implemented similar projects before, I wanted to see as much details as possible while working on the steps in the project plan.

The following shows IBM Bob with its IDE, including one of the generated files as well as the chat window with some follow-up work to fix errors and add functionality.

IBM Bob IDE with conversation and generated code

From MVP to solution

The initial MVP (Minimal Viable Product) included a “fetcher” module to regularly retrieve data from the GBFS vehicle position API and store it in DB2 and a “web app” for the analytics dashboard. As requested, the code is written in Python, I could opt between Flask and FastAPI, data is managed in Db2 using the official IBM Db2 ibm_db Python driver, the dashboard is a browser-based application.

I had to fix the “requirements.txt” for some module names and versions. That included to move to the latest “ibm_db” driver version to benefit from Wheel support. I also had to install “libxcrypt-compat” to make up for the missing “libcrypt.so.1”. Overall, it took only an hour, end to end, to get started and have a working app.

With the fetcher running and more data coming in, I started testing the dashboard. In the log, I observed some SQL errors. I decided to ask Bob to take a look by pointing to the impacted API, providing the error message from the log, and specifying the task. It resulted in proposed code fixes which I approved and a summary of steps performed as shown below.

IBM Bob working on fixing SQL errors

Conclusions

IBM Bob and Db2 work well together, including the Db2 Developer Extension. It requires some handholding, expert knowledge, and of course some planning to get to results. The resulting dashboard for analyzing Dott vehicles in my city (see first screenshot on top) is addressing my needs. By picking technology I understand, I feel empowered to either manually or with an AI partner like IBM Bob to address software maintenance tasks, or even add new features.

If you have feedback, suggestions, or questions about this post, please reach out to me on Mastodon (@data_henrik@mastodon.social) or LinkedIn.