Hi,
I wonder if there is a possibility in Anvil that allows to connect a database such as Postgresql using SQL statements rather than using Data Tables.
Thanks,
Talib
Welcome to Anvil.
Yes, you can indeed connect to any outside database that there is a library for in Python.
I personally use pymysql to talk to Galera clusters, and I use psycog2 to talk to CockroachDB (which uses PostgreSQL clients). I also talk to Redis and have done some MongoDB in the past, all from Anvil.
The thing about Anvil is that you can load almost any library that you could pip install
There are examples spread throughout the forums, but when you have specific questions ask on here and someone will be able to help you.
Further to @david.wylie’s pointers, the Anvil docs have some code examples for connecting to common external DBs such as MySQL or Postgres:
https://anvil.works/docs/data-tables/external-database
If you want to execute SQL queries against Anvil’s Data Tables, that’s available on the Dedicated Plan (read more in the docs here).
Thank you very much David.
This is important for me.
Thanks Meredydd