I think I'm going crazy, but I can't get Prefect t...
# prefect-getting-started
k
I think I'm going crazy, but I can't get Prefect to connect and working with a cloud Postgres db. Created a SQLAlchemy block with all the db info such as host, user, etc ... selected postgresql+asyncpg as the driver, copy pasted the block snippet in the py file. Copied a simple flow code from the docs that does a SELECT statement. Doesn't work and the errors says postgresql+asyncpg cannot be run syncronously, use an 'async with' syntax ... in other tools like dbt, sqlmesh, filling in the db connection info is done and dusted, it works immediately. I've been stumbling over this for the last three days and to me this should be the easiest part of what the tool can do.
Finally got the async working ... or so I thought, got a new error: NOTE: pgbouncer with pool_mode set to "transaction" or "statement" does not support prepared statements properly. You have two options: * if you are using pgbouncer for connection pooling to a single server, switch to the connection pool functionality provided by asyncpg, it is a much better option for this purpose; * if you have no option of avoiding the use of pgbouncer, then you can set statement_cache_size to 0 when creating the asyncpg connection object.
What the heck?! CLI gave me errors that the connection to my db failed, yet this is what I found when I logged in to my db interface
Can someone please explain what prefect did, why it did this?
I can't trust a tool who does things without me knowing why it does it