Module spin_sdk.postgres
Module for interacting with a Postgres database
Expand source code
"""Module for interacting with a Postgres database"""
from spin_sdk.wit.imports.postgres import Connection
def open(connection_string: str) -> Connection:
"""
Open a connection with a Postgres database.
The connection_string is the Postgres URL connection string.
A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.rdbms_types.Error_ConnectionFailed(str))` when a connection fails.
A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.rdbms_types.Error_Other(str))` when some other error occurs.
"""
return Connection.open(connection_string)
Functions
def open(connection_string: str) ‑> Connection
-
Open a connection with a Postgres database.
The connection_string is the Postgres URL connection string.
A
Err(Error_ConnectionFailed(str))
when a connection fails.A
Err(Error_Other(str))
when some other error occurs.Expand source code
def open(connection_string: str) -> Connection: """ Open a connection with a Postgres database. The connection_string is the Postgres URL connection string. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.rdbms_types.Error_ConnectionFailed(str))` when a connection fails. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.rdbms_types.Error_Other(str))` when some other error occurs. """ return Connection.open(connection_string)