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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pggo-1.2.0.tar.gz.
File metadata
- Download URL: pggo-1.2.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58fc9676fe4f78b506e5425bd970a99f99842064de377fb539954bf135303899
|
|
| MD5 |
a12163682f3d4d27dfe989ac275a6a10
|
|
| BLAKE2b-256 |
6807a62f59d3389eb107fabb82a17e0ef7bf9363a0c6ffa962ed9917eb256a48
|
Provenance
The following attestation bundles were made for pggo-1.2.0.tar.gz:
Publisher:
auto-tag.yaml on lucaslimafernandes/pggo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pggo-1.2.0.tar.gz -
Subject digest:
58fc9676fe4f78b506e5425bd970a99f99842064de377fb539954bf135303899 - Sigstore transparency entry: 395653604
- Sigstore integration time:
-
Permalink:
lucaslimafernandes/pggo@c466fb8c74d1740b95a97ebca40a9413955658fb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucaslimafernandes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-tag.yaml@c466fb8c74d1740b95a97ebca40a9413955658fb -
Trigger Event:
push
-
Statement type:
File details
Details for the file pggo-1.2.0-py3-none-any.whl.
File metadata
- Download URL: pggo-1.2.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85221f20fbf7dc5097147286c8e20bf285e4c8247aad209e8402a6142f0aa6f9
|
|
| MD5 |
aa2ee73c25028ee694d3a3acf6471b8d
|
|
| BLAKE2b-256 |
5ed7014c0da83d609774285b33dfe3790a8500e5ebf7eb4672cf0ecfc6fbbd96
|
Provenance
The following attestation bundles were made for pggo-1.2.0-py3-none-any.whl:
Publisher:
auto-tag.yaml on lucaslimafernandes/pggo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pggo-1.2.0-py3-none-any.whl -
Subject digest:
85221f20fbf7dc5097147286c8e20bf285e4c8247aad209e8402a6142f0aa6f9 - Sigstore transparency entry: 395653619
- Sigstore integration time:
-
Permalink:
lucaslimafernandes/pggo@c466fb8c74d1740b95a97ebca40a9413955658fb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucaslimafernandes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-tag.yaml@c466fb8c74d1740b95a97ebca40a9413955658fb -
Trigger Event:
push
-
Statement type: