MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_supabase_pool

Function get_supabase_pool

app/api/agentops/exporter/processor.py:93–110  ·  view source on GitHub ↗

Get a read-only connection pool to Supabase.

()

Source from the content-addressed store, hash-verified

91
92
93def get_supabase_pool() -> Any:
94 """Get a read-only connection pool to Supabase."""
95 global _supabase_pool
96
97 host = os.getenv('SUPABASE_HOST')
98 port = os.getenv('SUPABASE_PORT')
99 database = os.getenv('SUPABASE_DATABASE')
100 user = os.getenv('SUPABASE_USER')
101 password = os.getenv('SUPABASE_PASSWORD')
102
103 if _supabase_pool is None:
104 _supabase_pool = psycopg_pool.AsyncConnectionPool(
105 f"postgresql://{user}:{password}@{host}:{port}/{database}",
106 min_size=SUPABASE_MIN_POOL_SIZE,
107 max_size=SUPABASE_MAX_POOL_SIZE,
108 # configure=lambda c: c.execute("SET default_transaction_read_only = on")
109 )
110 return _supabase_pool
111
112
113async def close_supabase_pool() -> None:

Callers 3

fetchallMethod · 0.85
fetchoneMethod · 0.85
count_session_rowsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…