https://issues.qgis.org/https://issues.qgis.org/favicon.ico2017-10-04T15:10:23ZQGIS Issue TrackingQGIS Application - Feature request #17195: Open a database connection from metadatahttps://issues.qgis.org/issues/17195?journal_id=833802017-10-04T15:10:23ZTom Kralidis
<ul></ul><p>Hi Paul: sounds feasible. notes:</p>
<p>- suggest we use the SQLAlchemy convention (<a class="external" href="http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls">http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls</a>) (per RFC-1738: <a class="external" href="http://rfc.net/rfc1738.html">http://rfc.net/rfc1738.html</a>)<br />- suggest we add a new link type to <a class="external" href="https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv">https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv</a> (i.e. <br />DBMS:LINK) and then metadata documents this accordingly</p>
<p>- then when MetaSearch detects DBMS:LINK, it detects what kind of DB is in the url then opens a signal to the DB Provider window to add the layer</p>
<p>Thoughts</p> QGIS Application - Feature request #17195: Open a database connection from metadatahttps://issues.qgis.org/issues/17195?journal_id=833812017-10-04T15:12:14Zpaul van genuchtengenuchten@yahoo.com
<ul></ul><p>sounds good Tom, <br />thanks for that pointer to rfc-1738</p> QGIS Application - Feature request #17195: Open a database connection from metadatahttps://issues.qgis.org/issues/17195?journal_id=833912017-10-05T13:30:45ZJoana Simoes
<ul></ul><p>Which QGIS version would you like to target? the current one (2.18.13) or v3?</p> QGIS Application - Feature request #17195: Open a database connection from metadatahttps://issues.qgis.org/issues/17195?journal_id=834062017-10-06T08:43:28ZJoana Simoes
<ul></ul><p>Tom Kralidis wrote:</p>
<blockquote>
<p>Hi Paul: sounds feasible. notes:</p>
<p>- suggest we use the SQLAlchemy convention (<a class="external" href="http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls">http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls</a>) (per RFC-1738: <a class="external" href="http://rfc.net/rfc1738.html">http://rfc.net/rfc1738.html</a>)<br />- suggest we add a new link type to <a class="external" href="https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv">https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv</a> (i.e. <br />DBMS:LINK) and then metadata documents this accordingly</p>
<p>- then when MetaSearch detects DBMS:LINK, it detects what kind of DB is in the url then opens a signal to the DB Provider window to add the layer</p>
</blockquote>
<p>Thanks for the advice, Tom. So I guess we should add a new DB:link type here: <a class="external" href="https://github.com/qgis/QGIS/blob/master/python/plugins/MetaSearch/link_types.py">https://github.com/qgis/QGIS/blob/master/python/plugins/MetaSearch/link_types.py</a></p>
<p>Then I guess we should detect this link type, when searching for services:</p>
<p><a class="external" href="https://github.com/qgis/QGIS/blob/master/python/plugins/MetaSearch/dialogs/maindialog.py#L586">https://github.com/qgis/QGIS/blob/master/python/plugins/MetaSearch/dialogs/maindialog.py#L586</a></p>
<p>And send a signal to the relevant db provider. I am not sure if to open the db connection dialog, or to open the db directly passing the relevant parameters. What do you think?</p> QGIS Application - Feature request #17195: Open a database connection from metadatahttps://issues.qgis.org/issues/17195?journal_id=834252017-10-06T19:40:00ZTom Kralidis
<ul></ul><p>Hi Joana: comments:</p>
<p>- let's target master for this given it's a feature<br />- can you submit a PR to the Cat-Interop lookup?<br />- as for opening the connection dialog vs connecting right away, would there be cases where no authentication params are part of the DB URL? In this case the connection dialog would be needed for interactive authentication (option a). Then again opening the connection right away takes out that step, which is good (option b).</p>
<p>Option A is more cautious and option B is ideal if applicable/without error. Thoughts?</p>