Registry / database / tentaclio-postgres

tentaclio-postgres

JSON →
library0.0.1pypypi✓ verified 86d ago

Tentaclio-postgres is a Python package that provides the necessary dependencies and extends the core Tentaclio library to enable seamless connections to PostgreSQL databases. It acts as a connector, allowing users to interact with PostgreSQL via Tentaclio's unified URL-based interface for data streams and database clients. The current version is 0.0.1. It is part of the broader Tentaclio ecosystem, which shows active development and updates.

pip install tentaclio-postgres
INSTALL
IMPORT
SIG · TENTACLIO-POSTGRES
T
tentaclio-postgres
databasepythonv0.0.1
Install
11.8s avg
Import
2991ms
Disk
230MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 3.100s · 227.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 11.8s · import 2.883s · 222MB
230MB installed
● package 230MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tentaclio
import tentaclio
The primary interaction is through the main 'tentaclio' library's `db` function, not directly from 'tentaclio_postgres'.

This quickstart demonstrates how to establish a connection to a PostgreSQL database using `tentaclio.db()`. It highlights the use of a PostgreSQL URL and shows how to execute a simple query. Credentials can be provided directly in the URL or automatically injected from environment variables, prefixed with `TENTACLIO__CONN__`.

import os import tentaclio # Configure a PostgreSQL connection string (replace with your actual URL) # For local testing, you might use 'postgresql://user:password@localhost:5432/mydatabase' # Credentials can also be injected via environment variables (e.g., TENTACLIO__CONN__MYDB_PG_URL) # For this example, we'll use a placeholder and demonstrate env var usage for a real setup. # os.environ['TENTACLIO__CONN__EXAMPLE_PG'] = 'postgresql://user:password@host:port/database' pg_url = os.environ.get('TENTACLIO__CONN__EXAMPLE_PG', 'postgresql://user:password@localhost:5432/testdb') try: with tentaclio.db(pg_url) as client: print(f"Successfully connected to PostgreSQL via Tentaclio using URL: {pg_url}") # Execute a simple query result = client.query("SELECT 1 as test_column") print(f"Query result: {result.fetchone()}") except Exception as e: print(f"Could not connect to PostgreSQL or execute query: {e}") print("Please ensure a PostgreSQL database is running and the connection string is valid.")
Debug
Known issues
gotchaDirect import of `tentaclio_postgres` components is generally not needed. Its primary function is to extend the `tentaclio` library, so interactions are usually through `import tentaclio` and then using `tentaclio.db()` or `tentaclio.open()` with a `postgresql://` URL scheme.
fix
Always use the main `tentaclio` library for database and stream operations, relying on `tentaclio-postgres` to provide the underlying PostgreSQL connectivity.
affects: All versions
gotchaWhen writing data to a PostgreSQL table directly from a stream, Tentaclio uses a specific URL syntax: `postgresql://host/database::table`. Forgetting the `::table` part will lead to errors if you intend to stream data directly into a table.
fix
Ensure the correct `::table` suffix is appended to the PostgreSQL URL when specifying a target table for write operations (e.g., `tentaclio.open('postgresql://host/db::my_table', mode='w')`).
affects: All versions
gotchaTentaclio supports automatic credential injection from environment variables. While convenient, expecting credentials only via the URL string or misconfiguring environment variables can lead to connection failures. Specifically, `TENTACLIO__PG_APPLICATION_NAME` can set the application name for PostgreSQL connections.
fix
Be aware of the environment variable precedence for credentials and connection parameters. Consult the main `tentaclio` documentation for full details on automatic credential injection via `TENTACLIO__CONN__` prefixed variables and database-specific settings like `TENTACLIO__PG_APPLICATION_NAME`.
affects: All versions
gotchaThe `tentaclio-postgres` package is currently at version 0.0.1. This indicates it is either a very early-stage project, a meta-package, or its versioning doesn't strictly follow semantic versioning for feature changes but rather its integration readiness. Users should be aware of the project's maturity when adopting.
fix
Monitor the PyPI page or GitHub repository for updates and consult the `tentaclio` documentation for details on recommended versions or stability guarantees for database connectors.
affects: 0.0.1
Upgrade
Version history
0.0.1latest on PyPI · released Nov 26, 2021
Audit
Dependencies
tentacliorequiredCore library providing the unified API for I/O and database connections.
psycopg2-binaryoptionalCommon PostgreSQL driver implicitly installed by tentaclio-postgres for synchronous connections.
sqlalchemyoptionalUsed by tentaclio for database abstraction and ORM capabilities.
Agent activity
27 hits · last 30 days
node
22
Meta
2
OpenAI (training)
1
Resources