Skip to main content

CAFE-DB

CAFE-DB is a Python package that provides tools and utilities for database testing. It is part of the CAFE (Core Automation Framework Enhancements) monorepo.

Features

CAFE-DB offers the following features:

  • Database connection: Supports connections to various databases, including MSSQL, MySQL, Oracle, Hive, Postgres, and Cassandra.
  • Query execution: Provides methods to execute SQL queries and retrieve data.
  • Result set comparison: Offers methods to compare result sets, allowing for efficient validation of database data.
  • Data-driven testing: Supports data-driven testing approaches to execute tests with different data sets.
  • Reporting: Integrates with CAFE's reporting capabilities to generate comprehensive test reports.

Getting Started

Prerequisites

  • Python 3.12 or later
  • pip 24 or later (Python package manager)

Installation

  1. Install CAFE-DB using pip:

    pip install cafex-db
    

Usage

CAFE-DB provides a set of intuitive methods and classes to facilitate database testing. Here's a basic example:

from cafex_db import database_handler

# Create a database connection
db_handler = database_handler.DatabaseHandler()
connection = db_handler.create_connection(db_type="mssql", server="dbserver", database="testdb")

# Execute a query
result_set = db_handler.execute_query(connection, "SELECT * FROM users")

# Convert the result set to a list
result_list = db_handler.resultset_to_list(result_set)

# Validate the data
assert result_list[0][1] == "John Doe"

Metadata

Release files for cafex-db 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for cafex-db 1.0.0
File Interpreter ABI Platform Actions
cafex_db-1.0.0-py3-none-any.whl Python 3 none any Details for cafex_db-1.0.0-py3-none-any.whl

Release files / cafex_db-1.0.0-py3-none-any.whl

Download URL cafex_db-1.0.0-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a16b24719592d0c612bdfd59aa3f869e59f83845ddee23d97bf48f168cf896d0
BLAKE2b-256 checksum
How to use checksums
be270098d3714ef8756f0eb9103ac2c8c37fde58af44a39a8c0711d4cb18234d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.10

Security for cafex-db 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page