Connecting to databases using sqlalchemy

Hello guys,

Thanks for this awesome project.

I’m wondering if it’s possible to connect to databases using sqlalchemy or any other way.

Thank you.

You may get a better answer from one of the PyScript team but if you mean connecting to a remote database server then it’s unlikely it can be done in the traditional way, due to the fundamental limitations of the browser and Pyodide (which underpins PyScript).
You could potentially access a local database, but for anything remote, it would not be able to make the usual sorts of network connections that are normally required to communicate in whatever database protocol your database uses

If some kind of web accessible front end is set up to act as an interface to a backend database, then something might be possible but I’m guessing that then wouldn’t be able to operate via sqlalchemy or other traditional tools.

You can get an idea of a few of the general limitations with Pyodide (and thus PyScript) by looking at the FAQ here: Frequently Asked Questions — Version 0.20.0
And also checking out their roadmap (which indicates things that aren’t yet working but that they hope they may resolve with work)

1 Like

And to clarify my comment about local database, that would be something running locally within the browser under emscripten (so not just locally in the normal sense of being on your local computer)

1 Like

Here’s something along those lines:

1 Like

Thank you! Clarified things here!

1 Like