<div dir="ltr">I think this could find an interesting framework in the proposal of a new database interface. One of the proposals pertains to the process interface.<div>Maybe it could become a more generic interface to data sources. More and more data infrastructures are intrinsically no-SQL and it could be interesting to mix them at the source level and not afterwards when it becomes heavy and very application specific.</div><div>Disclaimer: I had a love affair with MapInfo MapBasic and I miss its command interface. It would be wonderful to have a SQL-like interface for it – and the Spatialite interface that comes with GDAL would be a good opportunity for it.</div><div>BTW: maybe a virtual GDAL interface would help in getting what you need for OsGeo services.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 22, 2022 at 12:11 PM Jacky Volpes via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <font face="Ubuntu">Hi,<br>
      <br>
      I don't know any way to do this, except for using a workaround.<br>
      But it will depend on your use-case.<br>
      Maybe using query layers, such as <br>
      <br>
      QgsVectorLayer("table='(select * from <schema>.<table>
      <your conditions>)' service='<service>'
      key='<unique id column>'", "<table name>", "postgres")<br>
      <br>
    </font>can help ?<br>
    <br>
    Regards,<br>
    Jacky<br>
    <br>
    <br>
    <br>
    <div>Le 09/08/2022 à 11:15, Johannes Kröger
      (WhereGroup) via QGIS-Developer a écrit :<br>
    </div>
    <blockquote type="cite">Howdy!
      <br>
      <br>
      I'd like to force a provider filter when a user adds a PostGIS
      layer and have it applied *before* any data is loaded. Setting it
      after the layer (and some of its big data) is loaded initially is
      not an option.
      <br>
      <br>
      Is there a way to sneak in between "user clicked something in the
      GUI to load a table/query and QGIS will construct a QgsVectorLayer
      now" and "QGIS now talks to the PostGIS database to get the data
      for the new layer", maybe with a signal?
      <br>
      <br>
      Something like a "layerAboutToBeLoaded" (like the opposite
      layerWillBeRemoved on
      <a href="https://qgis.org/pyqgis/master/core/QgsProject.html" target="_blank">https://qgis.org/pyqgis/master/core/QgsProject.html</a>) basically.
      :o)
      <br>
      <br>
      Cheers, Hannes
      <br>
      <br>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
QGIS-Developer mailing list
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
    </blockquote>
    <br>
    <pre cols="72">-- 
Jacky Volpes

Ingénieur SIG - Oslandia</pre>
  </div>

_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>