Apidog supports direct integration with databases, allowing you to perform CRUD operations within your API workflows. You can execute SQL queries in Pre/Post processors, assert the results, or extract data as variables for use in subsequent requests.Getting Started#
1
Add Database ProcessorNavigate to the Pre Processors or Post Processors section of your request and select Database Operation. 2
Configure OperationName the operation and select a Database Connection. 3
Enter SQL CommandInput your SQL query. You can use variables like {{variable}} within the query. 4
Extract Results (Optional)Enable Extract Result To Variable to save query results.Variable Name: Name of the variable.
JSONPath Expression: Use $[0].uid to get the uid from the first row.
5
ExecuteClick Send. Results are displayed in the Console. Apidog supports standard SQL queries but does not currently support complex operations like stored procedures via the visual interface.
Database Connections#
Supported Databases#
| Tier | Supported Databases |
|---|
| Free | MySQL, SQL Server (2014+), PostgreSQL, Oracle |
| Paid | ClickHouse, MongoDB, Redis |
Connecting to an Oracle database requires installing the Oracle Client separately. Setting Up a Connection#
1
Go to
Settings >
Database Connections.
2
Click + New at the top right.
3
Select the database type and enter connection details (Host, Port, Username, Password, Database Name).
4
(Optional) Configure
SSH Tunnel for secure connections.
Data Privacy: Database credentials (address, port, username, password) are stored locally on your client and are not synced to the cloud. Each team member must configure their own database connections.
Multi-Environment Configuration#
When working with different environments (e.g., Dev, Test, Prod), you can configure environment-specific database connections.1.
In Database Connections, create separate connections for each environment.
2.
Enable Environment Specific settings if available or simply name them clearly.
3.
When executing requests, Apidog will use the connection corresponding to the currently selected environment.
Database Access in Scripts#
For advanced logic, you can connect to databases using custom JavaScript scripts.CLI Support#
Apidog CLI supports running test scenarios with database operations. However, since database configs are local, you must export the database configuration file and place it on the machine running the CLI.