avatarBerk Orbay

Summary

The author discusses the efficiency of using GitHub Copilot and ChatGPT for database operations in PostgreSQL, emphasizing the ease of overcoming syntax issues and the structured nature of SQL queries.

Abstract

The article is a continuation of a previous post, focusing on the use of GitHub Copilot and ChatGPT for database operations, specifically with PostgreSQL. The author reflects on their extensive history with various database technologies and acknowledges the common challenge of remembering syntax for queries. Despite the abundance of documentation and community support for PostgreSQL, the author prefers the immediacy of using AI tools like ChatGPT to generate boilerplate code and GitHub Copilot for autocompletion within Visual Studio Code. The author notes that SQL queries are generally well-structured, making them well-suited for assistance from language models. The conclusion is that with the help of these AI tools, managing databases at an introductory level has become more accessible, as they mitigate the issues related to syntax and systematic errors.

Opinions

  • The author views their main problem with databases as forgetting syntax, which interrupts the flow of writing queries.
  • There is an appreciation for the popularity and support available for PostgreSQL, but the author prefers the efficiency of AI tools over reading documentation and tutorials.
  • The author believes that the structured nature of SQL queries makes them particularly amenable to assistance from AI, such as ChatGPT and GitHub Copilot.
  • The author suggests that AI writing aids require some calibration but need less supervision for database-related tasks.
  • There is a positive opinion on the current state of database management for beginners, stating it has never been easier due to the support of AI tools.
Photo by Clark Van Der Beken on Unsplash

Writing Code with Github Copilot and ChatGPT Together — II (Databases)

This is a follow-up on the first post. The specific case for this post is database operations, namely PostgreSQL.

My first formal course on relational databases dates back almost 18 years. Over the years, I had to deal with a lot of “database technologies”. In addition to RDBMS, some NoSQL schemas, filesystem databases, or in-memory ones are both local and on the cloud. Even though rarely, I had to deal with “in-database” calculations, distributed processing, etc.

How to “database”?

My main problem is, I forget the syntax. Usually, I have a fairly good idea about how to write a query, but I frequently get interrupted by the little details. Therefore I get errors and I have had to reiterate a couple of times. I’m not talking about complex queries with the length of a giraffe and the innuendo of an esoteric cult.

Recently, I had to build a DB using PostgreSQL. It is one of the (even if not “the”) most popular DB technologies and it has been around for quite some time. It means plenty of documentation and lots of questions at Stackoverflow. So, everything should be ok if I take some time and read some tutorials and some of the documentation?

Bam bam bam!

But, no! I don’t have time for documentation, tutorials, etc. I just have to get what I want from the DB and I want to move on. Guess what? I can do it. I just ask ChatGPT for some boilerplate code for a Python project. I write initial comments on VS Code and Github Copilot autocompletes the rest for me. As with any writing aid, you need to calibrate a bit. But, the amount of supervision is much less compared to other tasks.

It also makes sense. SQL querying, regardless of the technology, is fairly structured. Most conventions are around for a long time and operations are well-defined. Also, the queries I used for this experiment were never complex. I also got great help when I structure my tables, defining indexes, and setting types (syntax is more volatile for this kind of operation).

Conclusion

Database management at the introductory level was never ever easier than this. It always had solid, straightforward logic but you might be tangled up by syntax or other systematic issues. Here LLMs shine the brightest.

More…

ChatGPT
Github Copilot
Postgresql
Llm
Databulls
Recommended from ReadMedium