Can you clarify what you need from DBManager? Widgets ? Features ? Or do you mean to be able to list DB connections and launch SQL queries ?
You should avoid importing code from the DbManager plugin as it is removed step by step. Use the database API : https://qgis.org/api/classQgsAbstractDatabaseProviderConnection.html metadata = QgsProviderRegistry.instance().providerMetadata('postgres') connection = metadata.findConnection("name_of_connection) connection.executeSql("SELECT ....") Le jeu. 22 juil. 2021 à 22:09, Florian El Ahdab <[email protected]> a écrit : > Hi. > > I would like to take advantage of the db manager from a python plugin. > That would allow me to avoid handling the database configuration myself and > would make the overall ui more consistent for the user. > > I can't find any relevant reference to do that. > > Has anyone achieved anything like that ? > > Regards. > Florian. > _______________________________________________ > QGIS-Developer mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer >
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
