Skip to main content
MariaDB Logo
MariaDB actions

Schema introspection and SQL execution on MariaDB

ReadyDatabase

Overview

The MariaDB action lets AI agents read schema information and run SQL queries against a MariaDB database. Use it to answer analytical questions, explore table structures, and fetch data in natural language.
Authenticate with a database user that can only read (SELECT only). Queries that are not plain reads wait for your approval, but a read-only user is the guarantee. See Use a read-only database user.

Key Capabilities

  • Ask questions about your data in plain English
  • Run complex queries, joins, and aggregations across tables
  • Explore the database structure and relationships between tables
  • Generate reports and summaries from live data
  • Download query results as CSV when they are too large to render in chat

Available Tools


Configuration Guide

If you already have a MariaDB server, skip this step.Run a local MariaDB container:
This starts MariaDB on localhost:3306 with:
  • Username: root
  • Password: rootpass
  • Database: test_db

Option B: Install locally

Install MariaDB from the official MariaDB downloads page and follow the installer for your OS. After install, start the server and note your host, port, username, and password.

Verify the connection

Enter your password when prompted. If you reach the MariaDB [(none)]> prompt, the server is ready.
Only an admin creates the MariaDB action instance. Once created, every user in the workspace can authenticate with their own database credentials.
  1. Open the workspace menu at the bottom left of the sidebar and select Workspace settings
Open Workspace settings from profile menuOpen Workspace settings from profile menu
  1. In the sidebar, click Actions
Navigate to Actions in Workspace settings sidebarNavigate to Actions in Workspace settings sidebar

Find MariaDB and click Setup

Locate the MariaDB card in the list of available actions and click Set up.
Actions page with the MariaDB card and its Set up buttonActions page with the MariaDB card and its Set up button

Configure the instance

Fill in the action configuration form:Click Create to save.
MariaDB action configuration formMariaDB action configuration form
The admin only provides connection details (host, port, database). Username and password are entered by each user when they authenticate.
After the admin creates the action, every user must authenticate with their own MariaDB username and password before using it.

Find the MariaDB card

In Your actions (under Personal in the sidebar), locate the MariaDB card. It shows 1 inactive instance when the action is set up but not yet authenticated for your user.
MariaDB card showing 1 inactive instanceMariaDB card showing 1 inactive instance

Open the MariaDB action

Click the card to open it. The instance is listed under Non-authenticated until you sign in.
MariaDB action page with the instance and its available actionsMariaDB action page with the instance and its available actions

Enter your credentials

Open Your actions (under Personal in the sidebar), open the MariaDB action, click Authenticate, enter your MariaDB Username and Password, then click Save credentials.
Enter MariaDB username and passwordEnter MariaDB username and password
Once saved, the action status changes to Authenticated and is ready to use in agents.
Your actions page for MariaDB with the instance marked AuthenticatedYour actions page for MariaDB with the instance marked Authenticated
  1. Open the Agent Builder
  2. In the left sidebar, expand Tools
  3. Drag the MariaDB action onto the canvas
  4. Connect it to your agent
Agent builder with the MariaDB action on the canvas, connected to the agent's Toolsets inputAgent builder with the MariaDB action on the canvas, connected to the agent's Toolsets input
Ask the agent natural-language questions — it will generate SQL, run it, and return results.
Agent chat answer listing the top three customers by September spend, built from MariaDB queriesAgent chat answer listing the top three customers by September spend, built from MariaDB queries

FAQ

  • Admin creates the action instance with connection details (host, port, database).
  • Each user authenticates separately with their own MariaDB username and password.
This way, every user queries the database with their own permissions.
Yes. Use the public host and port of your MariaDB server. Make sure the server allows connections from the PipesHub deployment and that the user account has the required privileges.
Grant the minimum privileges required for your use case. For read-only analytics, SELECT on the relevant database is usually enough:
See Use a read-only database user for why.
Yes. An admin can update the instance configuration from Workspace settings > Actions. Users may need to re-authenticate after a change.

Usage Tips

How do I list all tables? Ask the agent “list all tables in the database”. How do I explore a table’s structure? Ask “show me the schema for the orders table” or “get the CREATE TABLE for customers”. How do I run a query? Describe the question in natural language, for example: “what are the top 10 customers by total order value?” — the agent will generate and run the SQL. How do I limit the scope of a query? Mention a specific table or time range in your question, e.g. “from the events table in the last 30 days”.