Creating rqlite 7.14.0 with GitHub Copilot

rqlite is a lightweight, open-source, distributed relational database written in Go, which uses SQLite as its storage engine. 7.14.0 has been released and adds comprehensive support for Mutual TLS.

What makes this release of rqlite different is that much of the TLS support was written using GitHub Copilot.

I am quite impressed with the tool (I get free use of Copilot since I’m a maintainer of an open-source project). Initially It took a little getting used to, and I was slower when I first started out, but I quickly saw its value.

Quickly I began to think about how I could phrase my comments in the IDE to generate better code. I found it particularly effective when it came to copying code — but with small changes required — from code I had written earlier in the source file.

For example, much of the new code in release 7.14.0 involves performing a pair operations — specifically to an X.509 certificate and then to a corresponding Private Key. For example, I would need to generate the certificate and key, encode them both, write the resultant PEM data to files, and so on. I found that I only had to write one part of the pair of the operations, and Copilot would quickly suggest the second part of the pair. Here, for example, is a source file mostly written using Copilot.

Copilot also wrote some pretty useful unit tests — sometimes detecting errors in its own production code! On other occasions it did invoke functions that didn’t exist, or reversed some logic, but these mistakes were quite infrequent — and always easy to fix.

Back to Microsoft

It’s been more than 15 years since I used Microsoft development tools. This time I had to run Visual Studio Code, as it’s an easy way to run Copilot on my Linux box. I also found Visual Studio worked really nicely, is fast, and I didn’t have any hassle with setting GOPATH. It all just worked really well for Go programming and I suspect I won’t be rushing back to Sublime 3 anytime soon.

First step into a larger world

The emergence of the technology behind systems such as Copilot is impressive. I do worry about copyright, and a weaker understanding of the code I write, but early results, so far, are intriguing and powerful.

Finally, many thanks to otto-dev@ for guidance and testing during development of 7.14.0.

Leave a Reply

Your email address will not be published. Required fields are marked *