Skip to main content

Python API for pg0 - embedded PostgreSQL

Project description

pg0 - Embedded PostgreSQL for Python

PyPI

Embedded PostgreSQL with pgvector. No installation, no Docker, no configuration.

Install

pip install pg0-embedded

Usage

from pg0 import Pg0

# Basic usage
with Pg0() as pg:
    print(pg.uri)  # postgresql://postgres:postgres@localhost:5432/postgres
    pg.execute("CREATE EXTENSION IF NOT EXISTS vector")
    pg.execute("SELECT version()")

# Custom configuration
pg = Pg0(
    name="myapp",
    port=5433,
    username="myuser",
    password="mypass",
    database="mydb",
    config={"shared_buffers": "512MB"}
)
pg.start()
pg.stop()

API

Pg0 Class

Method Description
start() Start PostgreSQL, returns InstanceInfo
stop() Stop PostgreSQL
drop() Stop and delete all data
info() Get instance info
execute(sql) Run SQL query
uri Connection URI (property)
running Check if running (property)

Module Functions

import pg0

pg0.start(name="default", port=5432, ...)  # Start instance
pg0.stop(name="default")                    # Stop instance
pg0.drop(name="default")                    # Delete instance
pg0.info(name="default")                    # Get instance info
pg0.list_instances()                        # List all instances

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

pg0_embedded-0.2.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pg0_embedded-0.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pg0_embedded-0.2.0.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.2.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pg0_embedded-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a2a3764f950b0f64cf1a14d6602e153451e9b1b2046bfb308a22d30ee211bd20
MD5 7172a04fc5a45cde64f2130a60d558c0
BLAKE2b-256 0bb9e0f8914bbb50780e99f4aae154d4101f6fa71b1c1fcb2ccb65ba8303c963

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.2.0.tar.gz:

Publisher: release-python.yml on vectorize-io/pg0

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

File details

Details for the file pg0_embedded-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pg0_embedded-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pg0_embedded-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76045e64a0a75a7f5e7900e0dd4b4bf86e055b749be5b0eee048d0224aa371db
MD5 64e3b7269a03b82a4325c87b79e0d151
BLAKE2b-256 69768e6b16d78bb3e02b3682664141b82635695f0c1455dd02c1f7d9df88c221

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.2.0-py3-none-any.whl:

Publisher: release-python.yml on vectorize-io/pg0

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