@@ -62,33 +62,15 @@ class QgsMssqlProvider : public QgsVectorDataProvider
6262
6363 /* Implementation of functions from QgsVectorDataProvider */
6464
65- /* *
66- * Returns the permanent storage type for this layer as a friendly name.
67- */
6865 virtual QString storageType () const override ;
69-
70- /* *
71- * Sub-layers handled by this provider, in order from bottom to top
72- *
73- * Sub-layers are used when the provider's source can combine layers
74- * it knows about in some way before it hands them off to the provider.
75- */
7666 virtual QStringList subLayers () const override ;
7767 virtual QVariant minimumValue ( int index ) const override ;
7868 virtual QVariant maximumValue ( int index ) const override ;
7969 virtual void uniqueValues ( int index, QList<QVariant> &uniqueValues, int limit = -1 ) const override ;
8070 virtual QgsFeatureIterator getFeatures ( const QgsFeatureRequest& request ) const override ;
8171
82- /* *
83- * Get feature type.
84- * @return int representing the feature type
85- */
8672 virtual QgsWkbTypes::Type wkbType () const override ;
8773
88- /* *
89- * Number of features in the layer
90- * @return long containing number of features
91- */
9274 virtual long featureCount () const override ;
9375
9476 // ! Update the extent, feature count, wkb type and srid for this layer
@@ -98,86 +80,41 @@ class QgsMssqlProvider : public QgsVectorDataProvider
9880
9981 QString subsetString () const override ;
10082
101- // ! Mutator for sql where clause used to limit dataset size
10283 bool setSubsetString ( const QString& theSQL, bool updateFeatureCount = true ) override ;
10384
10485 virtual bool supportsSubsetString () const override { return true ; }
10586
106- /* * Returns a bitmask containing the supported capabilities
107- Note, some capabilities may change depending on whether
108- a spatial filter is active on this provider, so it may
109- be prudent to check this value per intended operation.
110- */
11187 virtual QgsVectorDataProvider::Capabilities capabilities () const override ;
11288
11389
11490 /* Implementation of functions from QgsDataProvider */
11591
116- /* * Return a provider name
117-
118- Essentially just returns the provider key. Should be used to build file
119- dialogs so that providers can be shown with their supported types. Thus
120- if more than one provider supports a given format, the user is able to
121- select a specific provider to open that file.
122-
123- @note
124-
125- Instead of being pure virtual, might be better to generalize this
126- behavior and presume that none of the sub-classes are going to do
127- anything strange with regards to their name or description?
128- */
12992 QString name () const override ;
13093
131- /* * Return description
132-
133- Return a terse string describing what the provider is.
134-
135- @note
136-
137- Instead of being pure virtual, might be better to generalize this
138- behavior and presume that none of the sub-classes are going to do
139- anything strange with regards to their name or description?
140- */
14194 QString description () const override ;
14295
96+ QgsAttributeList pkAttributeIndexes () const override ;
97+
14398 virtual QgsRectangle extent () const override ;
14499
145100 bool isValid () const override ;
146101
147102 virtual bool isSaveAndLoadStyleToDBSupported () const override { return true ; }
148103
149- // ! Writes a list of features to the database
150104 virtual bool addFeatures ( QgsFeatureList & flist ) override ;
151105
152- // ! Deletes a feature
153106 virtual bool deleteFeatures ( const QgsFeatureIds & id ) override ;
154107
155- /* *
156- * Adds new attributes
157- * @param attributes list of new attributes
158- * @return true in case of success and false in case of failure
159- */
160108 virtual bool addAttributes ( const QList<QgsField> &attributes ) override ;
161109
162- /* *
163- * Deletes existing attributes
164- * @param attributes a set containing names of attributes
165- * @return true in case of success and false in case of failure
166- */
167110 virtual bool deleteAttributes ( const QgsAttributeIds &attributes ) override ;
168111
169- // ! Changes attribute values of existing features
170112 virtual bool changeAttributeValues ( const QgsChangedAttributesMap &attr_map ) override ;
171113
172- // ! Changes existing geometries
173114 virtual bool changeGeometryValues ( const QgsGeometryMap &geometry_map ) override ;
174115
175- /* *
176- * Create a spatial index for the current layer
177- */
178116 virtual bool createSpatialIndex () override ;
179117
180- // ! Create an attribute index on the datasource
181118 virtual bool createAttributeIndex ( int field ) override ;
182119
183120 // ! Convert a QgsField to work with MSSQL
@@ -227,6 +164,7 @@ class QgsMssqlProvider : public QgsVectorDataProvider
227164
228165 long mNumberFeatures ;
229166 QString mFidColName ;
167+ int mFidColIdx ;
230168 mutable long mSRId ;
231169 QString mGeometryColName ;
232170 QString mGeometryColType ;
0 commit comments