Skip to content

feat: pglite extensions && pgvector#16

Merged
wey-gu merged 9 commits intomainfrom
pg_lite_extensions_pg_vector
Jun 14, 2025
Merged

feat: pglite extensions && pgvector#16
wey-gu merged 9 commits intomainfrom
pg_lite_extensions_pg_vector

Conversation

@wey-gu
Copy link
Owner

@wey-gu wey-gu commented Jun 14, 2025

4. PostgreSQL Extensions

py-pglite supports a growing number of PostgreSQL extensions.

1. Register the Extension:
Add the extension's details to py_pglite/extensions.py.

# py_pglite/extensions.py
SUPPORTED_EXTENSIONS = {
    "pgvector": {"module": "@electric-sql/pglite/vector", "name": "vector"},
    "new_extension": {"module": "npm-package-name", "name": "js_export_name"},
}

2. Add Optional Dependencies:
Add any necessary Python client libraries to pyproject.toml under the [project.optional-dependencies] section.

# pyproject.toml
[project.optional-dependencies]
extensions = [
    "pgvector>=0.4.1",
    "numpy>=1.0.0",
    "new-python-dependency>=1.0.0",
]

3. Add a Test:
Create a new test file in tests/ to validate the extension's functionality. Use the @pytest.mark.extensions marker.

# tests/test_new_extension.py
import pytest

@pytest.mark.extensions
def test_new_extension_feature():
    # ...

@wey-gu wey-gu mentioned this pull request Jun 14, 2025
13 tasks
@codecov
Copy link

codecov bot commented Jun 14, 2025

Codecov Report

Attention: Patch coverage is 61.22449% with 19 lines in your changes missing coverage. Please review.

Project coverage is 24.51%. Comparing base (8d762c5) to head (0c16eac).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
py_pglite/utils.py 38.46% 8 Missing ⚠️
py_pglite/config.py 50.00% 5 Missing ⚠️
py_pglite/manager.py 83.33% 4 Missing ⚠️
py_pglite/__init__.py 0.00% 1 Missing ⚠️
py_pglite/extensions.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
+ Coverage   23.81%   24.51%   +0.70%     
==========================================
  Files          17       18       +1     
  Lines        1306     1354      +48     
==========================================
+ Hits          311      332      +21     
- Misses        995     1022      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wey-gu wey-gu force-pushed the pg_lite_extensions_pg_vector branch from 1a267c0 to 0c16eac Compare June 14, 2025 15:18
@wey-gu wey-gu merged commit ad32c19 into main Jun 14, 2025
8 checks passed
@wey-gu wey-gu deleted the pg_lite_extensions_pg_vector branch June 14, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments