Module spin_sdk.postgres

Module for interacting with a Postgres database

Functions

async def open(connection_string: str) ‑> Connection
Expand source code
async def open(connection_string: str) -> Connection:
    """
    Open a connection with a Postgres database.
    
    The connection_string is the Postgres URL connection string.

    A `componentize_py_types.Err(Error_ConnectionFailed(str))` when a connection fails.
    
    A `componentize_py_types.Err(Error_Other(str))` when some other error occurs.
    """
    return await Connection.open_async(connection_string)

Open a connection with a Postgres database.

The connection_string is the Postgres URL connection string.

A componentize_py_types.Err(Error_ConnectionFailed(str)) when a connection fails.

A componentize_py_types.Err(Error_Other(str)) when some other error occurs.