Skip to main content

A PostgreSQL driver written in Golang for Python

Project description

pggo

Author: Lucas Lima Fernandes

PostgreSQL driver implemented in Go (pgx) exposed to Python via shared C lib, packaged as wheel.

Instalation

pip install pggo

Teste

from pggo import connect
c = connect("postgres://user:pass@host:5432/db?sslmode=disable")
cur = c.cursor()
cur.execute("select 1 as x")
print(cur.fetchall())  # [{'x': 1}]
c.close()

You can execute tests in examples/

Passing Parameters to Queries

pggo supports PostgreSQL positional parameters using the $1, $2, $n syntax. You must pass a list or tuple as the second argument to execute.

from pggo import connect

DSN = "postgres://postgres:password@localhost:5432/postgres?sslmode=disable"

with connect(DSN) as conn:
    with conn.cursor() as cur:
        cur.execute("INSERT INTO cliente (nome) VALUES ($1)", ["Lucas"])
        print("Rows affected:", cur.rowcount)

with connect(DSN) as conn:
    with conn.cursor() as cur:
        cur.execute("SELECT * FROM cliente WHERE nome = $1", ["Lucas"])
        print(cur.fetchall())  # [{'id': 2, 'nome': 'Lucas'}]

Contributing

Your contributions are welcome! If you encounter any bugs or have feature requests, please open an issue. To contribute code, follow these steps:

Fork the repository.

Clone your forked repository to your local machine.

Create a new branch for your feature or bugfix (git checkout -b feature-name).

Make your changes and commit them (git commit -m "Description of changes").

Push your branch (git push origin feature-name).

Open a pull request with a clear description of your changes.

For more details, check the Contributing Guide.

License This project is licensed under the MIT License. See the LICENSE file for more information.

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

pggo-1.1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

pggo-1.1.1-py3-none-any.whl (6.2 MB view details)

Uploaded Python 3

File details

Details for the file pggo-1.1.1.tar.gz.

File metadata

  • Download URL: pggo-1.1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pggo-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2a0213958a7ec5261cff9662c683b77c3cadd0347a5dfbf66725a245e2b57616
MD5 99a7db62e3b72f122580cec12a8a7a55
BLAKE2b-256 ae14189da227041b55c951dde2480763461101ef639168087f52bf94ccf3d519

See more details on using hashes here.

Provenance

The following attestation bundles were made for pggo-1.1.1.tar.gz:

Publisher: auto-tag.yaml on lucaslimafernandes/pggo

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

File details

Details for the file pggo-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pggo-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pggo-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 994d6deb2865402bf84991d4b759fc96fa3bee00d870c6fc87bb0a7c4c523a1c
MD5 d9535c362a3943db2146d4e54461dda5
BLAKE2b-256 d43fa9e6adc29aeebd0112c1cf29358bbb2dfb4b13164180328741784ed52908

See more details on using hashes here.

Provenance

The following attestation bundles were made for pggo-1.1.1-py3-none-any.whl:

Publisher: auto-tag.yaml on lucaslimafernandes/pggo

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