py-pglite


Namepy-pglite JSON
Version 0.5.1 PyPI version JSON
download
home_pageNone
SummaryPython testing library for PGlite - in-memory PostgreSQL for tests
upload_time2025-09-05 01:00:31
maintainerNone
docs_urlNone
authorWey Gu
requires_python>=3.10
licenseNone
keywords testing postgresql pglite database pytest sqlalchemy sqlmodel django pytest-django
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py-pglite

<img src="https://github.com/user-attachments/assets/3c6ef886-5075-4d82-a180-a6b1dafe792b" alt="py-pglite Logo" width="60" align="left" style="margin-right: 16px;"/>

**A Pythonic interface for PGlite - the instant, zero-config PostgreSQL.** ⚡️

`py-pglite` brings the magic of [PGlite](https://github.com/electric-sql/pglite) to Python with a high-level, developer-friendly API. Real PostgreSQL, instant testing.

`pip install py-pglite`

<br clear="all"/>

```python
def test_users(pglite_session):
    user = User(name="Alice")
    pglite_session.add(user)
    pglite_session.commit()
    assert user.id == 1  # It's real PostgreSQL!
```

**That's it.** No Docker, no setup, no config files. Real PostgreSQL, instant testing.

[![CI](https://github.com/wey-gu/py-pglite/actions/workflows/ci.yml/badge.svg)](https://github.com/wey-gu/py-pglite/actions/workflows/ci.yml) [![PyPI](https://badge.fury.io/py/py-pglite.svg)](https://badge.fury.io/py/py-pglite) [![Python](https://img.shields.io/pypi/pyversions/py-pglite.svg)](https://pypi.org/project/py-pglite/)

[![License](https://img.shields.io/pypi/l/py-pglite.svg)](https://github.com/wey-gu/py-pglite/blob/main/LICENSE) [![MyPy](https://img.shields.io/badge/type_checked-mypy-informational.svg)](https://mypy.readthedocs.io/en/stable/introduction.html) [![Ruff](https://img.shields.io/badge/style-ruff-blue?logo=ruff&logoColor=white)](https://github.com/astral-sh/ruff) [![codecov](https://codecov.io/github/wey-gu/py-pglite/graph/badge.svg?token=VQHDHT5LIM)](https://codecov.io/github/wey-gu/py-pglite)

---

## **Why py-pglite?**

```python
# ❌ Traditional testing
def test_old_way():
    # 1. Install PostgreSQL
    # 2. Configure connection
    # 3. Manage test databases
    # 4. Handle cleanup
    # 5. Docker containers...
    pass

# ✅ py-pglite way
def test_new_way(pglite_session):
    User.objects.create(name="Alice")  # Just works!
```

**The magic:**

- 🎯 **Zero config** - No setup, no Docker, no servers
- ⚡ **Instant** - 2-3s startup vs 30-60s Docker
- 🔄 **Isolated** - Fresh database per test
- 🐘 **Real PostgreSQL** - JSON, arrays, window functions
- 🚀 **Any client** - SQLAlchemy, Django, psycopg, asyncpg

---

## **Install**

```bash
# Core (framework-agnostic)
pip install py-pglite

# With your stack
pip install py-pglite[sqlalchemy]  # SQLAlchemy + SQLModel
pip install py-pglite[django]      # Django + pytest-django
pip install py-pglite[asyncpg]     # Pure async client
pip install py-pglite[all]         # Everything

# Extra Features
pip install py-pglite[extensions]  # pglite extensions, like pgvector, fuzzystrmatch etc.
```

---

## **Quick Start**

### **SQLAlchemy** (Zero imports needed)

```python
def test_sqlalchemy_just_works(pglite_session):
    user = User(name="Alice", email="alice@test.com")
    pglite_session.add(user)
    pglite_session.commit()

    assert user.id is not None
    assert User.query.count() == 1  # Real PostgreSQL!
```

### **Django**

**🔹 Lightweight/Socket** (Minimal setup)

```python
def test_django_socket_pattern(configured_django):
    Post.objects.create(title="Hello", content="World")
    assert Post.objects.count() == 1  # Real PostgreSQL via socket!
```

**🔸 Full Integration/Backend** (Enhanced features)

```python
def test_django_backend_pattern(django_pglite_db):
    Post.objects.create(title="Hello", content="World", metadata={"tags": ["test"]})
    assert Post.objects.count() == 1  # Custom backend with JSON support!
```

**Choose your pattern:**

- **Lightweight**: Fast, minimal dependencies, standard PostgreSQL backend
- **Full Integration**: Advanced features, custom backend, enhanced JSON support

👉 [**See Django patterns guide**](examples/testing-patterns/django/) for detailed examples and migration guide.

### **Any PostgreSQL client**

```python
def test_any_client_works(pglite_manager):
    # Extract connection details
    engine = pglite_manager.get_engine()
    host, port, database = str(engine.url.host), engine.url.port, engine.url.database

    # Use with any PostgreSQL client
    # conn = psycopg.connect(host=host, port=port, dbname=database)
    # engine = create_async_engine(f"postgresql+asyncpg://{host}:{port}/{database}")

# For asyncpg specifically, use TCP mode with proper configuration:
async def test_asyncpg_works(pglite_tcp_manager):
    config = pglite_tcp_manager.config
    conn = await asyncpg.connect(
        host=config.tcp_host,
        port=config.tcp_port,
        user="postgres",
        password="postgres",
        database="postgres",
        ssl=False,
        server_settings={}  # CRITICAL: Required for PGlite compatibility
    )
    result = await conn.fetchval("SELECT 1")
    await conn.close()
```

---

## **Examples**

### **FastAPI + SQLModel**

```python
from fastapi.testclient import TestClient

def test_api_endpoint(client: TestClient):
    response = client.post("/users/", json={"name": "Alice"})
    assert response.status_code == 201

    response = client.get("/users/")
    assert len(response.json()) == 1
```

### **PostgreSQL Features**

```python
def test_postgresql_power(pglite_session):
    pglite_session.execute(text("""
        CREATE TABLE analytics (
            data JSONB,
            tags TEXT[],
            created TIMESTAMP DEFAULT NOW()
        )
    """))

    pglite_session.execute(text("""
        INSERT INTO analytics (data, tags) VALUES
        ('{"clicks": 100}', ARRAY['web', 'mobile'])
    """))

    result = pglite_session.execute(text("""
        SELECT data->>'clicks' as clicks,
               array_length(tags, 1) as tag_count
        FROM analytics
        WHERE data->>'clicks' > '50'
    """)).fetchone()

    assert result.clicks == '100'
```

### **PostgreSQL Extensions**

`py-pglite` supports PostgreSQL extensions, allowing you to test advanced features like vector similarity search for AI/RAG applications.

### **🚀 `pgvector` for RAG Applications**

Enable `pgvector` to test vector embeddings and similarity search directly in your test suite.

**1. Install with the `[extensions]` extra:**

```bash
pip install 'py-pglite[extensions]'
```

**2. Enable `pgvector` in the configuration:**

```python
from py_pglite import PGliteConfig, PGliteManager
from pgvector.psycopg import register_vector
import psycopg
import numpy as np

# Enable the extension
config = PGliteConfig(extensions=["pgvector"])

with PGliteManager(config=config) as db:
    with psycopg.connect(db.get_dsn(), autocommit=True) as conn:
        # Create the extension and register the type
        conn.execute("CREATE EXTENSION IF NOT EXISTS vector")
        register_vector(conn)

        # Create a table and insert a vector
        conn.execute("CREATE TABLE items (embedding vector(3))")
        conn.execute("INSERT INTO items (embedding) VALUES (%s)", (np.array([1, 2, 3]),))

        # Perform a similarity search
        result = conn.execute("SELECT * FROM items ORDER BY embedding <-> %s LIMIT 1", (np.array([1, 1, 1]),)).fetchone()
        assert np.array_equal(result[0], np.array([1, 2, 3]))
```

`py-pglite` can support many other extensions available in the underlying [PGlite extensions](https://pglite.dev/extensions/) ♥️.

---

## **Advanced**

<details>
<summary><strong>🔧 Production Configuration</strong></summary>

```python
from py_pglite import PGliteConfig
from py_pglite.sqlalchemy import SQLAlchemyPGliteManager

config = PGliteConfig(
    timeout=60,                    # Extended timeout for CI/CD
    log_level="INFO",              # Balanced logging
    cleanup_on_exit=True,          # Automatic cleanup
    work_dir=Path("./test-data")   # Custom directory
)

with SQLAlchemyPGliteManager(config) as manager:
    engine = manager.get_engine(
        pool_recycle=3600,         # Connection recycling
        echo=False                 # SQL logging
    )
```

</details>

<details>
<summary><strong>🌐 Socket Modes (Unix vs TCP)</strong></summary>

py-pglite supports both Unix domain sockets (default) and TCP sockets for different use cases:

### Unix Socket Mode (Default)

```python
# Default configuration - uses Unix domain socket for best performance
from py_pglite import PGliteManager

with PGliteManager() as db:
    # Connection via Unix socket - fastest for local testing
    dsn = db.get_dsn()  # host=/tmp/... dbname=postgres
```

### TCP Socket Mode

```python
from py_pglite import PGliteConfig, PGliteManager

# Enable TCP mode for any TCP-only clients
config = PGliteConfig(
    use_tcp=True,
    tcp_host="127.0.0.1",  # Default: localhost only
    tcp_port=5432,         # Default: PostgreSQL standard port
    extensions=["pgvector"]
)

with PGliteManager(config) as db:
    # Now compatible with any TCP-only clients
    uri = db.get_psycopg_uri()
    # postgresql://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable
```

**When to use TCP mode:**

- Any TCP-only clients (doesn't support Unix sockets)
- Cloud-native testing environments
- Docker containers with network isolation
- Testing network-based database tools
- **Required for asyncpg**: asyncpg only works in TCP mode

**Important notes:**

- PGlite Socket supports only **one active connection** at a time
- SSL is not supported - always use `sslmode=disable`
- Unix sockets are faster for local testing (default)
- TCP mode binds to localhost by default for security
- **asyncpg requires `server_settings={}` to prevent hanging**

</details>

<details>
<summary><strong>🔄 Client Compatibility</strong></summary>

```python
# py-pglite provides a REAL PostgreSQL server - any client works!

with SQLAlchemyPGliteManager() as manager:
    engine = manager.get_engine()
    url = engine.url

    # Extract connection details for any PostgreSQL client
    host, port, database = str(url.host), url.port, url.database

    # Examples for different clients:
    # psycopg:  psycopg.connect(host=host, port=port, dbname=database)
    # Django:   Uses custom py-pglite backend automatically

# asyncpg requires TCP mode and specific configuration:
config = PGliteConfig(use_tcp=True)
with PGliteManager(config) as manager:
    conn = await asyncpg.connect(
        host=config.tcp_host,
        port=config.tcp_port,
        user="postgres",
        password="postgres",
        database="postgres",
        ssl=False,
        server_settings={}  # Required for PGlite compatibility
    )
```

**Installation Matrix:**

| Client | Install | Use Case |
|--------|---------|----------|
| `[sqlalchemy]` | SQLAlchemy + SQLModel | ORM, modern Python |
| `[django]` | Django + pytest-django | Django projects |
| `[psycopg]` | psycopg (sync/async) | Raw SQL, custom |
| `[asyncpg]` | Pure async client | High-performance async |
| `[all]` | Everything | Full compatibility |

</details>

<details>
<summary><strong>🎯 Framework Isolation</strong></summary>

```bash
# Perfect isolation - no framework bleeding
pytest -m sqlalchemy -p no:django     # Pure SQLAlchemy
pytest -m django -p no:sqlalchemy     # Pure Django
pytest tests/sqlalchemy/              # Directory isolation
```

</details>

---

**Built for developers who want PostgreSQL testing without the complexity.**

🎯 [Examples](examples/) • 📚 [Contributing](CONTRIBUTING.md) • 🐛 [Issues](https://github.com/wey-gu/py-pglite/issues)

---

*py-pglite: Because testing should be simple.* ⚡

Powered by the 🚀 amazing and ♥️ beloved [PGlite](https://github.com/electric-sql/pglite).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py-pglite",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "testing, postgresql, pglite, database, pytest, sqlalchemy, sqlmodel, django, pytest-django",
    "author": "Wey Gu",
    "author_email": "Wey Gu <weyl.gu@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/61/4e/e776753820547923bb44e67ae825c8d94fc6863887a072a1bdcb62712b0d/py_pglite-0.5.1.tar.gz",
    "platform": null,
    "description": "# py-pglite\n\n<img src=\"https://github.com/user-attachments/assets/3c6ef886-5075-4d82-a180-a6b1dafe792b\" alt=\"py-pglite Logo\" width=\"60\" align=\"left\" style=\"margin-right: 16px;\"/>\n\n**A Pythonic interface for PGlite - the instant, zero-config PostgreSQL.** \u26a1\ufe0f\n\n`py-pglite` brings the magic of [PGlite](https://github.com/electric-sql/pglite) to Python with a high-level, developer-friendly API. Real PostgreSQL, instant testing.\n\n`pip install py-pglite`\n\n<br clear=\"all\"/>\n\n```python\ndef test_users(pglite_session):\n    user = User(name=\"Alice\")\n    pglite_session.add(user)\n    pglite_session.commit()\n    assert user.id == 1  # It's real PostgreSQL!\n```\n\n**That's it.** No Docker, no setup, no config files. Real PostgreSQL, instant testing.\n\n[![CI](https://github.com/wey-gu/py-pglite/actions/workflows/ci.yml/badge.svg)](https://github.com/wey-gu/py-pglite/actions/workflows/ci.yml) [![PyPI](https://badge.fury.io/py/py-pglite.svg)](https://badge.fury.io/py/py-pglite) [![Python](https://img.shields.io/pypi/pyversions/py-pglite.svg)](https://pypi.org/project/py-pglite/)\n\n[![License](https://img.shields.io/pypi/l/py-pglite.svg)](https://github.com/wey-gu/py-pglite/blob/main/LICENSE) [![MyPy](https://img.shields.io/badge/type_checked-mypy-informational.svg)](https://mypy.readthedocs.io/en/stable/introduction.html) [![Ruff](https://img.shields.io/badge/style-ruff-blue?logo=ruff&logoColor=white)](https://github.com/astral-sh/ruff) [![codecov](https://codecov.io/github/wey-gu/py-pglite/graph/badge.svg?token=VQHDHT5LIM)](https://codecov.io/github/wey-gu/py-pglite)\n\n---\n\n## **Why py-pglite?**\n\n```python\n# \u274c Traditional testing\ndef test_old_way():\n    # 1. Install PostgreSQL\n    # 2. Configure connection\n    # 3. Manage test databases\n    # 4. Handle cleanup\n    # 5. Docker containers...\n    pass\n\n# \u2705 py-pglite way\ndef test_new_way(pglite_session):\n    User.objects.create(name=\"Alice\")  # Just works!\n```\n\n**The magic:**\n\n- \ud83c\udfaf **Zero config** - No setup, no Docker, no servers\n- \u26a1 **Instant** - 2-3s startup vs 30-60s Docker\n- \ud83d\udd04 **Isolated** - Fresh database per test\n- \ud83d\udc18 **Real PostgreSQL** - JSON, arrays, window functions\n- \ud83d\ude80 **Any client** - SQLAlchemy, Django, psycopg, asyncpg\n\n---\n\n## **Install**\n\n```bash\n# Core (framework-agnostic)\npip install py-pglite\n\n# With your stack\npip install py-pglite[sqlalchemy]  # SQLAlchemy + SQLModel\npip install py-pglite[django]      # Django + pytest-django\npip install py-pglite[asyncpg]     # Pure async client\npip install py-pglite[all]         # Everything\n\n# Extra Features\npip install py-pglite[extensions]  # pglite extensions, like pgvector, fuzzystrmatch etc.\n```\n\n---\n\n## **Quick Start**\n\n### **SQLAlchemy** (Zero imports needed)\n\n```python\ndef test_sqlalchemy_just_works(pglite_session):\n    user = User(name=\"Alice\", email=\"alice@test.com\")\n    pglite_session.add(user)\n    pglite_session.commit()\n\n    assert user.id is not None\n    assert User.query.count() == 1  # Real PostgreSQL!\n```\n\n### **Django**\n\n**\ud83d\udd39 Lightweight/Socket** (Minimal setup)\n\n```python\ndef test_django_socket_pattern(configured_django):\n    Post.objects.create(title=\"Hello\", content=\"World\")\n    assert Post.objects.count() == 1  # Real PostgreSQL via socket!\n```\n\n**\ud83d\udd38 Full Integration/Backend** (Enhanced features)\n\n```python\ndef test_django_backend_pattern(django_pglite_db):\n    Post.objects.create(title=\"Hello\", content=\"World\", metadata={\"tags\": [\"test\"]})\n    assert Post.objects.count() == 1  # Custom backend with JSON support!\n```\n\n**Choose your pattern:**\n\n- **Lightweight**: Fast, minimal dependencies, standard PostgreSQL backend\n- **Full Integration**: Advanced features, custom backend, enhanced JSON support\n\n\ud83d\udc49 [**See Django patterns guide**](examples/testing-patterns/django/) for detailed examples and migration guide.\n\n### **Any PostgreSQL client**\n\n```python\ndef test_any_client_works(pglite_manager):\n    # Extract connection details\n    engine = pglite_manager.get_engine()\n    host, port, database = str(engine.url.host), engine.url.port, engine.url.database\n\n    # Use with any PostgreSQL client\n    # conn = psycopg.connect(host=host, port=port, dbname=database)\n    # engine = create_async_engine(f\"postgresql+asyncpg://{host}:{port}/{database}\")\n\n# For asyncpg specifically, use TCP mode with proper configuration:\nasync def test_asyncpg_works(pglite_tcp_manager):\n    config = pglite_tcp_manager.config\n    conn = await asyncpg.connect(\n        host=config.tcp_host,\n        port=config.tcp_port,\n        user=\"postgres\",\n        password=\"postgres\",\n        database=\"postgres\",\n        ssl=False,\n        server_settings={}  # CRITICAL: Required for PGlite compatibility\n    )\n    result = await conn.fetchval(\"SELECT 1\")\n    await conn.close()\n```\n\n---\n\n## **Examples**\n\n### **FastAPI + SQLModel**\n\n```python\nfrom fastapi.testclient import TestClient\n\ndef test_api_endpoint(client: TestClient):\n    response = client.post(\"/users/\", json={\"name\": \"Alice\"})\n    assert response.status_code == 201\n\n    response = client.get(\"/users/\")\n    assert len(response.json()) == 1\n```\n\n### **PostgreSQL Features**\n\n```python\ndef test_postgresql_power(pglite_session):\n    pglite_session.execute(text(\"\"\"\n        CREATE TABLE analytics (\n            data JSONB,\n            tags TEXT[],\n            created TIMESTAMP DEFAULT NOW()\n        )\n    \"\"\"))\n\n    pglite_session.execute(text(\"\"\"\n        INSERT INTO analytics (data, tags) VALUES\n        ('{\"clicks\": 100}', ARRAY['web', 'mobile'])\n    \"\"\"))\n\n    result = pglite_session.execute(text(\"\"\"\n        SELECT data->>'clicks' as clicks,\n               array_length(tags, 1) as tag_count\n        FROM analytics\n        WHERE data->>'clicks' > '50'\n    \"\"\")).fetchone()\n\n    assert result.clicks == '100'\n```\n\n### **PostgreSQL Extensions**\n\n`py-pglite` supports PostgreSQL extensions, allowing you to test advanced features like vector similarity search for AI/RAG applications.\n\n### **\ud83d\ude80 `pgvector` for RAG Applications**\n\nEnable `pgvector` to test vector embeddings and similarity search directly in your test suite.\n\n**1. Install with the `[extensions]` extra:**\n\n```bash\npip install 'py-pglite[extensions]'\n```\n\n**2. Enable `pgvector` in the configuration:**\n\n```python\nfrom py_pglite import PGliteConfig, PGliteManager\nfrom pgvector.psycopg import register_vector\nimport psycopg\nimport numpy as np\n\n# Enable the extension\nconfig = PGliteConfig(extensions=[\"pgvector\"])\n\nwith PGliteManager(config=config) as db:\n    with psycopg.connect(db.get_dsn(), autocommit=True) as conn:\n        # Create the extension and register the type\n        conn.execute(\"CREATE EXTENSION IF NOT EXISTS vector\")\n        register_vector(conn)\n\n        # Create a table and insert a vector\n        conn.execute(\"CREATE TABLE items (embedding vector(3))\")\n        conn.execute(\"INSERT INTO items (embedding) VALUES (%s)\", (np.array([1, 2, 3]),))\n\n        # Perform a similarity search\n        result = conn.execute(\"SELECT * FROM items ORDER BY embedding <-> %s LIMIT 1\", (np.array([1, 1, 1]),)).fetchone()\n        assert np.array_equal(result[0], np.array([1, 2, 3]))\n```\n\n`py-pglite` can support many other extensions available in the underlying [PGlite extensions](https://pglite.dev/extensions/) \u2665\ufe0f.\n\n---\n\n## **Advanced**\n\n<details>\n<summary><strong>\ud83d\udd27 Production Configuration</strong></summary>\n\n```python\nfrom py_pglite import PGliteConfig\nfrom py_pglite.sqlalchemy import SQLAlchemyPGliteManager\n\nconfig = PGliteConfig(\n    timeout=60,                    # Extended timeout for CI/CD\n    log_level=\"INFO\",              # Balanced logging\n    cleanup_on_exit=True,          # Automatic cleanup\n    work_dir=Path(\"./test-data\")   # Custom directory\n)\n\nwith SQLAlchemyPGliteManager(config) as manager:\n    engine = manager.get_engine(\n        pool_recycle=3600,         # Connection recycling\n        echo=False                 # SQL logging\n    )\n```\n\n</details>\n\n<details>\n<summary><strong>\ud83c\udf10 Socket Modes (Unix vs TCP)</strong></summary>\n\npy-pglite supports both Unix domain sockets (default) and TCP sockets for different use cases:\n\n### Unix Socket Mode (Default)\n\n```python\n# Default configuration - uses Unix domain socket for best performance\nfrom py_pglite import PGliteManager\n\nwith PGliteManager() as db:\n    # Connection via Unix socket - fastest for local testing\n    dsn = db.get_dsn()  # host=/tmp/... dbname=postgres\n```\n\n### TCP Socket Mode\n\n```python\nfrom py_pglite import PGliteConfig, PGliteManager\n\n# Enable TCP mode for any TCP-only clients\nconfig = PGliteConfig(\n    use_tcp=True,\n    tcp_host=\"127.0.0.1\",  # Default: localhost only\n    tcp_port=5432,         # Default: PostgreSQL standard port\n    extensions=[\"pgvector\"]\n)\n\nwith PGliteManager(config) as db:\n    # Now compatible with any TCP-only clients\n    uri = db.get_psycopg_uri()\n    # postgresql://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable\n```\n\n**When to use TCP mode:**\n\n- Any TCP-only clients (doesn't support Unix sockets)\n- Cloud-native testing environments\n- Docker containers with network isolation\n- Testing network-based database tools\n- **Required for asyncpg**: asyncpg only works in TCP mode\n\n**Important notes:**\n\n- PGlite Socket supports only **one active connection** at a time\n- SSL is not supported - always use `sslmode=disable`\n- Unix sockets are faster for local testing (default)\n- TCP mode binds to localhost by default for security\n- **asyncpg requires `server_settings={}` to prevent hanging**\n\n</details>\n\n<details>\n<summary><strong>\ud83d\udd04 Client Compatibility</strong></summary>\n\n```python\n# py-pglite provides a REAL PostgreSQL server - any client works!\n\nwith SQLAlchemyPGliteManager() as manager:\n    engine = manager.get_engine()\n    url = engine.url\n\n    # Extract connection details for any PostgreSQL client\n    host, port, database = str(url.host), url.port, url.database\n\n    # Examples for different clients:\n    # psycopg:  psycopg.connect(host=host, port=port, dbname=database)\n    # Django:   Uses custom py-pglite backend automatically\n\n# asyncpg requires TCP mode and specific configuration:\nconfig = PGliteConfig(use_tcp=True)\nwith PGliteManager(config) as manager:\n    conn = await asyncpg.connect(\n        host=config.tcp_host,\n        port=config.tcp_port,\n        user=\"postgres\",\n        password=\"postgres\",\n        database=\"postgres\",\n        ssl=False,\n        server_settings={}  # Required for PGlite compatibility\n    )\n```\n\n**Installation Matrix:**\n\n| Client | Install | Use Case |\n|--------|---------|----------|\n| `[sqlalchemy]` | SQLAlchemy + SQLModel | ORM, modern Python |\n| `[django]` | Django + pytest-django | Django projects |\n| `[psycopg]` | psycopg (sync/async) | Raw SQL, custom |\n| `[asyncpg]` | Pure async client | High-performance async |\n| `[all]` | Everything | Full compatibility |\n\n</details>\n\n<details>\n<summary><strong>\ud83c\udfaf Framework Isolation</strong></summary>\n\n```bash\n# Perfect isolation - no framework bleeding\npytest -m sqlalchemy -p no:django     # Pure SQLAlchemy\npytest -m django -p no:sqlalchemy     # Pure Django\npytest tests/sqlalchemy/              # Directory isolation\n```\n\n</details>\n\n---\n\n**Built for developers who want PostgreSQL testing without the complexity.**\n\n\ud83c\udfaf [Examples](examples/) \u2022 \ud83d\udcda [Contributing](CONTRIBUTING.md) \u2022 \ud83d\udc1b [Issues](https://github.com/wey-gu/py-pglite/issues)\n\n---\n\n*py-pglite: Because testing should be simple.* \u26a1\n\nPowered by the \ud83d\ude80 amazing and \u2665\ufe0f beloved [PGlite](https://github.com/electric-sql/pglite).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python testing library for PGlite - in-memory PostgreSQL for tests",
    "version": "0.5.1",
    "project_urls": {
        "Documentation": "https://github.com/wey-gu/py-pglite#readme",
        "Homepage": "https://github.com/wey-gu/py-pglite",
        "Issues": "https://github.com/wey-gu/py-pglite/issues",
        "Repository": "https://github.com/wey-gu/py-pglite"
    },
    "split_keywords": [
        "testing",
        " postgresql",
        " pglite",
        " database",
        " pytest",
        " sqlalchemy",
        " sqlmodel",
        " django",
        " pytest-django"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8c1bb378ba62449bf9bdf101580615feca98a6ad37c5010cb96815ae1eeb8fc5",
                "md5": "e4d602e00de79eebd86cb02b61db5616",
                "sha256": "d484b5beb7d6aefa4d3b2149e406c75be9b3c77a328dfc8739f0feb2892664c6"
            },
            "downloads": -1,
            "filename": "py_pglite-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e4d602e00de79eebd86cb02b61db5616",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 41342,
            "upload_time": "2025-09-05T01:00:30",
            "upload_time_iso_8601": "2025-09-05T01:00:30.469889Z",
            "url": "https://files.pythonhosted.org/packages/8c/1b/b378ba62449bf9bdf101580615feca98a6ad37c5010cb96815ae1eeb8fc5/py_pglite-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "614ee776753820547923bb44e67ae825c8d94fc6863887a072a1bdcb62712b0d",
                "md5": "f6a6822fe609d24e3f75219ed3099f2f",
                "sha256": "6489073f15406e6558e4bdb0539b08c4005a565d2df4c9d99a9c37c3af2dcc43"
            },
            "downloads": -1,
            "filename": "py_pglite-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f6a6822fe609d24e3f75219ed3099f2f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 31849,
            "upload_time": "2025-09-05T01:00:31",
            "upload_time_iso_8601": "2025-09-05T01:00:31.851655Z",
            "url": "https://files.pythonhosted.org/packages/61/4e/e776753820547923bb44e67ae825c8d94fc6863887a072a1bdcb62712b0d/py_pglite-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-05 01:00:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wey-gu",
    "github_project": "py-pglite#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "py-pglite"
}
        
Elapsed time: 1.71417s