Find answers from the community

Home
Members
Brandyhuevo
B
Brandyhuevo
Offline, last seen 3 months ago
Joined September 25, 2024
Creating a SQLDatabase query engine takes too long:

This single line
Plain Text
sql_database = SQLDatabase(engine)

Takes minutes to connect to the database and create the engine. Inspecting the python library I found that this function call
Plain Text
self._metadata.reflect(
            views=view_support,
            bind=self._engine,
            only=list(self._usable_tables),
            schema=self._schema,
        )

Is the thing that takes so much time, and erasing it does in fact reduce time to less than 5 seconds.

What does this do??? Is it neccesary???

Also i wanted to know if there is an async way of creating this engine, i did'nt find anything in docs
1 comment
L