Skip to main content

Python MariaDB extension

Project description

mariadb-c

mariadb-c is the C extension backend for the mariadb connector. It provides a compiled native module (mariadb_c) that the mariadb package selects automatically when installed alongside it, replacing the pure-Python implementation with a significantly faster alternative.

Relationship to mariadb

Package Description
mariadb Main connector — pure Python, works out of the box
mariadb-c C extension backend — install alongside mariadb for better performance
mariadb-binary Pre-compiled binary wheels with bundled dependencies (recommended for most users)
mariadb-pool Connection pool add-on

When mariadb-c is installed, the mariadb package detects and uses it automatically — no code changes required.

Requirements

  • Python ≥ 3.10
  • MariaDB Connector/C ≥ 3.3 (headers and library must be available at build time)

On Debian/Ubuntu:

sudo apt-get install libmariadb-dev

On RHEL/Fedora:

sudo dnf install mariadb-connector-c-devel

On macOS:

brew install mariadb-connector-c

Installation

Install mariadb together with mariadb-c to get the C-accelerated connector:

pip install mariadb[c]

Or, if you prefer pre-built binary wheels that bundle all native dependencies (no compiler needed):

pip install mariadb mariadb-binary

Usage

No API changes — import mariadb as usual:

import mariadb

conn = mariadb.connect(
    user="alice",
    password="secret",
    host="localhost",
    database="mydb",
)
cursor = conn.cursor()
cursor.execute("SELECT @@version")
print(cursor.fetchone())
conn.close()

To verify which backend is active:

import mariadb

print(mariadb.__version__)       # e.g. "2.0.0rc1-c"
print(mariadb.__version_type__)  # "c"

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mariadb_c-2.0.0rc2.tar.gz (83.2 kB view details)

Uploaded Source

File details

Details for the file mariadb_c-2.0.0rc2.tar.gz.

File metadata

  • Download URL: mariadb_c-2.0.0rc2.tar.gz
  • Upload date:
  • Size: 83.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mariadb_c-2.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 6e1ca3032175e16cb411abda39eb7c1b2a309c166ddde1cc1e11fc3a12e975d2
MD5 6e2d2d10b32d8e9b20300851cab00290
BLAKE2b-256 ad25cde2d66f38246ef3aaf916c8b779cf47211fae896e1b857cd12d666cb9f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mariadb_c-2.0.0rc2.tar.gz:

Publisher: release.yml on mariadb-corporation/mariadb-connector-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page