vibesql-python-bindings
Python bindings for VibeSQL SQL database engine.
Overview
This crate provides Python bindings following DB-API 2.0 conventions, allowing VibeSQL to be used from Python applications for testing, benchmarking, and integration.
Features
- DB-API 2.0 Compliant: Standard Python database interface
- Type Conversions: Automatic conversion between Python and SQL types
- Connection Pooling: Efficient connection management
- Cursor Support: Full cursor API with fetchone/fetchmany/fetchall
- Performance Profiling: Built-in profiling utilities for benchmarking
- Native Speed: Zero-copy access to Rust implementation
Installation
Usage
# Create a connection
=
# Get a cursor
=
# Execute DDL
# Insert data
# Query data
=
# [(2, 'Bob')]
# Close connection
Context Manager Support
=
Building
Note: Python bindings are excluded from the default workspace build to avoid requiring Python development headers. To build the Python bindings, you need Python 3.8+ and development headers installed.
Prerequisites
macOS:
# Python 3.8+ should already include development headers
Ubuntu/Debian:
Fedora/RHEL:
Building the Package
# 1. Install maturin (Python packaging tool for Rust)
# 2. Navigate to the Python bindings directory
# 3. Build and install for local development (recommended for testing)
# 4. Or build a wheel for distribution
# Wheel will be in: target/wheels/vibesql-0.1.0-*.whl
# 5. Install the wheel
Quick Build Script
From the repository root:
This script will:
- Check for Python development headers
- Install maturin if needed
- Build the wheel in release mode
- Show installation instructions
Building with Cargo (Advanced)
If you need to build as part of the workspace:
# From repository root
Note: This only builds the Rust library, not the Python package. Use maturin for the full Python package.
Documentation
License
This project is licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.