robotframework-databaselibrary
Database Library for Robot Framework
What it is and what it does
This is a Robot Framework library that extends the framework with keywords for database operations, allowing test suites to connect to, query, and verify data in databases. It wraps Python database modules (like oracledb, pymysql, or psycopg2) and exposes keywords for executing SQL queries, checking row counts, validating query results, and managing multiple simultaneous database connections via aliases.
The library is designed for test automation scenarios where you need to verify database state or content as part of your test execution. It handles connection setup, query execution, and result validation through Robot Framework's keyword syntax, making it natural to use within Robot Framework test cases and keywords. You supply the database driver module separately, and the library provides the glue to use it within your tests.
Use it for:
- Verify database records after an application operation in an automated test suite.
- Check row counts or specific values in database tables as part of test assertions.
- Test data setup and teardown by executing SQL commands from Robot Framework tests.
- Validate data consistency across multiple databases in a single test run using connection aliases.
- Query and assert on database state without writing custom Python code in your test suite.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Robot Framework library that adds keywords for querying databases, verifying query results, and managing multiple database connections within automated test suites.
Yes, if you are using Robot Framework for test automation and need to query or verify databases. Install friction is low and the library is permissively licensed. Maintenance is aging (last release 213 days ago), so verify that your target database driver is supported before committing; no known vulnerabilities are present. Suitable for teams already invested in Robot Framework who want database testing without custom code.
Install
robotframework-databaselibrary on PyPI
pip
pip install robotframework-databaselibraryuv
uv add robotframework-databaselibrarypoetry
poetry add robotframework-databaselibraryInstalling robotframework-databaselibrary
Before you install
Low install friction with a pure-wheel distribution. Maintenance status is aging—last release was 213 days ago—but the repository remains active and has not been archived.
License in practice
Licensed under Apache License 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install robotframework-databaselibrary
*** Settings ***
Library DatabaseLibrary
*** Test Cases ***
Query Database
Connect To Database oracledb db_name=db db_user=user db_password=pass db_host=127.0.0.1 db_port=1521
${rows}= Query select FIRST_NAME from person
Should Be Equal ${rows}[0][0] Franz Allan
Requires a separate Python database module (e.g., oracledb, pymysql, psycopg2) to be installed separately depending on your target database.
Verify before relying
- Whether the library actively maintains compatibility with all listed database drivers (oracledb, pymysql, psycopg2, pymssql, ibm_db_dbi, pyodbc, jaydebeapi, sqlite3, teradata).
- Performance characteristics when handling large result sets or frequent queries in test suites.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8.1) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — robotframework, robotframework-assertion-engine, sqlparse |
| Maintenance | aging — 213 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 392,715/month — #7,006 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: robotframework_databaselibrary-2.4.1-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
robotframework-assertion-engineProvides a standardized assertion engine for…
permissive · top 15,000 on PyPI
robotframework-seleniumlibrarySeleniumLibrary is a Robot Framework library…
permissive · top 5,000 on PyPI
robotframework-csvlibraryCSVLibrary is a Robot Framework library that…
permissive · top 15,000 on PyPI
robotframework-fakerWraps Faker's random test data generation as…
permissive · top 15,000 on PyPI
robotframework-appiumlibraryAppiumLibrary is a Robot Framework library that…
permissive · top 15,000 on PyPI
robotframework-excellibProvides Robot Framework keywords for reading,…
permissive · top 15,000 on PyPI
robotframework-dependencylibraryDeclares and enforces dependencies between…
permissive · top 15,000 on PyPI
robotframework-imaplibrary2A Robot Framework library that connects to IMAP…
permissive · top 15,000 on PyPI
robotremoteserverHosts Robot Framework test libraries on…
permissive · top 15,000 on PyPI
robotframework-requestsRequestsLibrary wraps the Python Requests…
permissive · top 5,000 on PyPI