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
- mariadb on PyPI: https://pypi.org/project/mariadb/
- Documentation: https://mariadb-corporation.github.io/mariadb-connector-python/
- Source code: https://github.com/mariadb-corporation/mariadb-connector-python
- Bug tracker: https://jira.mariadb.org/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e1ca3032175e16cb411abda39eb7c1b2a309c166ddde1cc1e11fc3a12e975d2
|
|
| MD5 |
6e2d2d10b32d8e9b20300851cab00290
|
|
| BLAKE2b-256 |
ad25cde2d66f38246ef3aaf916c8b779cf47211fae896e1b857cd12d666cb9f6
|
Provenance
The following attestation bundles were made for mariadb_c-2.0.0rc2.tar.gz:
Publisher:
release.yml on mariadb-corporation/mariadb-connector-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mariadb_c-2.0.0rc2.tar.gz -
Subject digest:
6e1ca3032175e16cb411abda39eb7c1b2a309c166ddde1cc1e11fc3a12e975d2 - Sigstore transparency entry: 1029939668
- Sigstore integration time:
-
Permalink:
mariadb-corporation/mariadb-connector-python@0243821280acfc6a238066025fbaf094253b7b17 -
Branch / Tag:
refs/heads/2.0 - Owner: https://github.com/mariadb-corporation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0243821280acfc6a238066025fbaf094253b7b17 -
Trigger Event:
workflow_dispatch
-
Statement type: