Skip to main content

macss-modular-api-postgres

Official MACSS Postgres integration package for Python.

Quick start

from modular_api_postgres import DbClient, DbCommand, DbCommandKind, DbConnectionSettings

settings = DbConnectionSettings.from_environment()

client = DbClient(
    settings=settings,
    session_provider=my_session_provider,
    command_executor=my_command_executor,
    transaction_runner=my_transaction_runner,
)

result = client.scalar(
    DbCommand(
        kind=DbCommandKind.SCALAR,
        text="select count(*) from users",
        label="users.count",
    )
)

if result.is_success:
    print(result.value.value)
else:
    print(result.failure.message)

See example/example.py for a complete in-memory wiring sample.

What this package provides

  • normalized Postgres connection defaults and redacted summaries
  • engine-agnostic DbClient, DbRepository, and transaction contracts
  • explicit lease ownership semantics for package-owned and application-owned sessions
  • health contributor and GraphQL support bundle for higher-level integrations
  • the application supplies the driver binding (adapter) for its chosen engine and driver

This package is contracts-only by design and will never ship a driver binding; you choose your engine and driver and provide the adapter. See ADR-0004.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

macss_modular_api_postgres-0.7.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

macss_modular_api_postgres-0.7.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file macss_modular_api_postgres-0.7.0.tar.gz.

File metadata

File hashes

Hashes for macss_modular_api_postgres-0.7.0.tar.gz
Algorithm Hash digest
SHA256 299855ee61b06135c202570f4766eadb5c0340d6d008f76712dda0ab11394354
MD5 863ba7edefea10cb01b67f00750bc68f
BLAKE2b-256 f35cde016a5b0944f2aeaa25e47af01985e8594e9bdea5c1580c4f7ed2033353

See more details on using hashes here.

File details

Details for the file macss_modular_api_postgres-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for macss_modular_api_postgres-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 273df391d4774436539046e6a63a79137e786b454591da19945bb61be9afbd5e
MD5 b2ed875e12fbd3b6aae147dc431093ff
BLAKE2b-256 a17549bd26d8c948098dae3976ede6fe5fccef2fbaa7ba92f00f4f0786ecef9a

See more details on using hashes here.

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