We have a dedicated Odoo.sh server.
It is configured to allow direct SQL access:
odoosh-sql-access init
We have been able to successfully connect but can't run any SQL, even a simple SELECT:
import psycopg2
connection = psycopg2.connect(database="db",
user="user",
password="password",
host="host",
port="5432",
sslmode="require")
cursor = connection.cursor() # ✅ this works ✅
cursor.execute("SELECT * FROM res_partner;") # ❌ this FAILS ❌
connection.close()