[QGIS-Developer] Work on QgsAbstractDatabaseProviderConnection for MS SQL Server

Alessandro Pasotti apasotti at gmail.com
Fri Sep 2 03:11:26 PDT 2022


Hi Bo,

I could have a look but I need a few days...

On Fri, Sep 2, 2022 at 12:08 PM Bo Victor Thomsen via QGIS-Developer
<qgis-developer at lists.osgeo.org> wrote:
>
> Hi List -
>
> I am working on a plugin that's is using for connections (QgsAbstractDatabaseProviderConnection) to several types of databases, including Postgres, GeoPackage and MS SQLServer.
>
> I was hoping to use the method "createSqlVectorLayer"  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:
>
> conns = QgsProviderRegistry.instance().providerMetadata('mssql').connections(False)
> conn = conns['geodata @ localhost'] # SQL server connection
> capabilities = conn.capabilities()
> print(bool(capabilities & QgsAbstractDatabaseProviderConnection.SqlLayers))
>
> The last statement shows "False" for MS SqlServer connections, indicating the missing functionality. (QGIS ver. 3.26 or older)
>
>
> My first question is: Has there been done any work on this for MS SQL Server connections in QGIS master (next version) ?
>
> 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 ??
>
> To be specific: get method "createSqlVectorLayer" to work for MS SQL Server connections.
>
> 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.
>
>
> Med venlig hilsen / Kind regards
>
> Bo Victor Thomsen
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it


More information about the QGIS-Developer mailing list