<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi List - <br>
</p>
<p>I am working on a plugin that's is using for connections (QgsAbstractDatabaseProviderConnection)
to several types of databases, including Postgres, GeoPackage and
MS SQLServer. <br>
</p>
<p>I was hoping to use the method "<a class="el"
href="https://api.qgis.org/api/classQgsAbstractDatabaseProviderConnection.html#a2c6e55db0df105012f0936c84df0b14d">createSqlVectorLayer</a>"
for converting some fairly complex SQL queries into QGIS vector
layers. This works super nice for Postgres and GeoPackage. However
the current version (QGIS 3.26) doesn't support this method for MS
SQLServer. As illustrated in this piece of code:</p>
<p><font face="monospace">conns =
QgsProviderRegistry.instance().providerMetadata('mssql').connections(False)<br>
conn = conns['geodata @ localhost'] # SQL server connection<br>
capabilities = conn.capabilities() <br>
print(bool(capabilities &
QgsAbstractDatabaseProviderConnection.SqlLayers))</font></p>
<p>The last statement shows <font face="monospace">"False"</font>
for MS SqlServer connections, indicating the missing
functionality. (QGIS ver. 3.26 or older)</p>
<p><br>
</p>
<p>My first question is: Has there been done any work on this for MS
SQL Server connections in QGIS master (next version) ?</p>
<p>The second question: Is it possible for someone in the group of
Core developers to provide me with a ballpark figure for
implementing the missing functionality for the mssql driver ??</p>
<p>To be specific: get method "<a class="el"
href="https://api.qgis.org/api/classQgsAbstractDatabaseProviderConnection.html#a2c6e55db0df105012f0936c84df0b14d">createSqlVectorLayer</a>"
to work for MS SQL Server connections.<br>
</p>
<p>If somebody steps up to the challenge I will send the information
to my customers so they can consider making QGIS better instead of
paying me for an ugly workaround. <br>
</p>
<p><br>
</p>
<pre class="moz-signature" cols="72">Med venlig hilsen / Kind regards
Bo Victor Thomsen</pre>
</body>
</html>