Skip to main content

datasource entities, collections, namespace helpers, agent-yaml config model + driver abstraction for postgres/redshift/snowflake/bigquery backends

Project description

3tears-datasources

Datasource entities, three-tier collections, namespace helpers, the agent-yaml-facing DatasourceConfig, and the Driver abstraction (plus concrete asyncpg + Redshift drivers) for the 3tears platform.

This is the single source of truth for "what is a datasource" across every 3tears consumer.

Public surface

Imported via from threetears.datasources import …:

  • entities -- DataSourceEntity, DataSourceTableEntity, DataSourceColumnEntity, DataSourceRelationEntity, TableTemplateEntity + the DataSourceType, DataSourceAccessMode, DataSourceStatus enums.
  • collections -- DataSourceCollection, DataSourceTableCollection, DataSourceColumnCollection, DataSourceRelationCollection, TableTemplateCollection (three-tier SchemaBackedCollection / BaseCollection subclasses with L1/L2/L3 caching + _publish_invalidation on save).
  • namespace -- DATASOURCE_NAMESPACE_TYPE, datasource_namespace_id(uuid) -> uuid, datasource_namespace_name(name) -> str.
  • config -- DatasourceConfig (the agent-yaml-facing model the SDK validates against) plus the per-driver ConnectionConfig discriminated union.

Drivers

The Driver ABC + create_driver(config, *, hub_l3_pool=None) factory are the entry point. Concrete drivers are accessed via the factory, NOT imported directly:

from threetears.datasources.drivers import create_driver
driver = create_driver(config.connection_config)
try:
    rows = await driver.fetch("SELECT * FROM customers WHERE id = $1", customer_id)
finally:
    await driver.close()

Driver implementations live behind extras keys:

  • pip install '3tears-datasources[redshift]' for RedshiftDriver
  • pip install '3tears-datasources[snowflake]' for SnowflakeDriver (stub today; full impl tracked separately)
  • pip install '3tears-datasources[bigquery]' for BigQueryDriver (stub today; full impl tracked separately)

Postgres / Yugabyte / agent_internal coverage uses asyncpg which is a hard dep (no extras key required).

See IMPLEMENTING_DRIVERS.md for the contract every new driver must satisfy.

Versioning policy

3tears-datasources versions in lockstep with the rest of the 3tears monorepo: every package shares one version, which tracks the framework git tag (v0.9.1 at time of writing). All packages move together.

The pyproject.toml depends on 3tears core via a compatible-release range (3tears>=0.9.1,<1.0); because the monorepo bumps together, any matching 0.9.x core satisfies it.

See CHANGELOG.md for the full version history.

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

3tears_datasources-0.19.0.tar.gz (166.1 kB view details)

Uploaded Source

Built Distribution

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

3tears_datasources-0.19.0-py3-none-any.whl (94.9 kB view details)

Uploaded Python 3

File details

Details for the file 3tears_datasources-0.19.0.tar.gz.

File metadata

  • Download URL: 3tears_datasources-0.19.0.tar.gz
  • Upload date:
  • Size: 166.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for 3tears_datasources-0.19.0.tar.gz
Algorithm Hash digest
SHA256 3769b043b4018b0d3945bbe16ed0db986fca4527e6c38e191f2d7b594a23dc1e
MD5 47d791bd0c5698c805c4b23eade4eb7f
BLAKE2b-256 ff4a6cd412299b3dfd22837426d5ae14abed4cac3117641bec3c0a7b7b89f1b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for 3tears_datasources-0.19.0.tar.gz:

Publisher: release.yml on pacepace/3tears

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

File details

Details for the file 3tears_datasources-0.19.0-py3-none-any.whl.

File metadata

File hashes

Hashes for 3tears_datasources-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca0d16f3c97c4048d951dda585d0a36864ed1f2fa195d9d73cc9a9de964431aa
MD5 d63388c80d81c58eac2c85a43ae2bc51
BLAKE2b-256 7a5e1cf3196ddd1d0e188ef76b2a79633dfd8e9e9736f5db9c21e63e6f9100a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for 3tears_datasources-0.19.0-py3-none-any.whl:

Publisher: release.yml on pacepace/3tears

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