Re: [QGIS-Developer] Data provider default values and default value clause

2020-01-27 Thread Nyall Dawson
On Mon, 27 Jan 2020 at 18:02, Alessandro Pasotti wrote: > > Hi Nyall, > > thank you for confirming my worst nightmares :) > > Unfortunately, since the data providers are certainly a foundation component > of QGIS, these behavior inconsistencies lead to issues in client code (GUI/UX > mainly but

Re: [QGIS-Developer] Data provider default values and default value clause

2020-01-27 Thread Alessandro Pasotti
Hi Nyall, thank you for confirming my worst nightmares :) Unfortunately, since the data providers are certainly a foundation component of QGIS, these behavior inconsistencies lead to issues in client code (GUI/UX mainly but probably also in QgsVectorLayerUtils create features functions) and I

Re: [QGIS-Developer] Data provider default values and default value clause

2020-01-26 Thread Nyall Dawson
On Fri, 24 Jan 2020 at 19:28, Alessandro Pasotti wrote: > > 1. From the docs it seems that the defaultValueClause() should ONLY return > clauses (like sequences, functions, CURRENT_TIMESTAMP etc.) and should NOT > return literal defaults. Correct. However -- not all providers are completely

[QGIS-Developer] Data provider default values and default value clause

2020-01-24 Thread Alessandro Pasotti
Hi, Sorry for the long post, but I need some advice on the current API: I'm working on a bugfix (https://github.com/qgis/QGIS/issues/33383) and (as sometimes happens) I just opened another can of worms, I'm currently testing the following providers: - postgres - spatialite - ogr (spatialite