I Made ChatGPT Act as a MariaDB Database

Written by alejandroduarte | Published 2023/01/12
Tech Story Tags: artificial-intelligence | chatgpt | mariadb | ai | databases | how-to | ai-applications | database

TLDRChatGPT can be used to write code and improve databases. It can also act as a command line tool. It responds with the output of commands. For example, you can make it act as a MariaDB database.via the TL;DR App

ChatGPT is truly impressive. You can instruct it to do all sorts of things when they can be communicated in plain text. Software developers are already using it to write code or improve SQL queries, among many other things.

But ChatGPT can also act as software. For example, if you tell it the following:

Act as the MariaDB command line tool. Only reply to commands with output in one single code block. Do not write any explanations. Expect English messages in {curly brackets}. My first command is SELECT VERSION();

Then you'll get this answer:


Isn't that impressive? There. Now you have a new way to get started with MariaDB without installing anything. I mean, that was even faster than using Docker on your browser!

Let's show the available databases (or schemas):

SHOW DATABASES;

Can we create a new database?

CREATE DATABASE test;

Yes, we can! How about creating a new table and inserting data?

CREATE TABLE test.messages(content TEXT);
INSERT INTO test.messages VALUES("Hi MariaDB 👋");

Query OK, 1 row affected. It seems to be working! Let's double-check that the data is stored:

SELECT * FROM test.messages;

Hi MariaDB 👋! This is so cool! Open a new tab in your browser, and try it out to see it in action.

When you want to stop ChatGPT from acting like a MariaDB database, just tell it to do so:

{stop acting like mariadb}

Or simply:

{stop}


Written by alejandroduarte | Software Engineer - Published Author - Developer Advocate at MariaDB Corporation
Published by HackerNoon on 2023/01/12