@@ -62,33 +62,15 @@ class QgsMssqlProvider : public QgsVectorDataProvider
62
62
63
63
/* Implementation of functions from QgsVectorDataProvider */
64
64
65
- /* *
66
- * Returns the permanent storage type for this layer as a friendly name.
67
- */
68
65
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
- */
76
66
virtual QStringList subLayers () const override ;
77
67
virtual QVariant minimumValue ( int index ) const override ;
78
68
virtual QVariant maximumValue ( int index ) const override ;
79
69
virtual void uniqueValues ( int index, QList<QVariant> &uniqueValues, int limit = -1 ) const override ;
80
70
virtual QgsFeatureIterator getFeatures ( const QgsFeatureRequest& request ) const override ;
81
71
82
- /* *
83
- * Get feature type.
84
- * @return int representing the feature type
85
- */
86
72
virtual QgsWkbTypes::Type wkbType () const override ;
87
73
88
- /* *
89
- * Number of features in the layer
90
- * @return long containing number of features
91
- */
92
74
virtual long featureCount () const override ;
93
75
94
76
// ! Update the extent, feature count, wkb type and srid for this layer
@@ -98,86 +80,41 @@ class QgsMssqlProvider : public QgsVectorDataProvider
98
80
99
81
QString subsetString () const override ;
100
82
101
- // ! Mutator for sql where clause used to limit dataset size
102
83
bool setSubsetString ( const QString& theSQL, bool updateFeatureCount = true ) override ;
103
84
104
85
virtual bool supportsSubsetString () const override { return true ; }
105
86
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
- */
111
87
virtual QgsVectorDataProvider::Capabilities capabilities () const override ;
112
88
113
89
114
90
/* Implementation of functions from QgsDataProvider */
115
91
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
- */
129
92
QString name () const override ;
130
93
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
- */
141
94
QString description () const override ;
142
95
96
+ QgsAttributeList pkAttributeIndexes () const override ;
97
+
143
98
virtual QgsRectangle extent () const override ;
144
99
145
100
bool isValid () const override ;
146
101
147
102
virtual bool isSaveAndLoadStyleToDBSupported () const override { return true ; }
148
103
149
- // ! Writes a list of features to the database
150
104
virtual bool addFeatures ( QgsFeatureList & flist ) override ;
151
105
152
- // ! Deletes a feature
153
106
virtual bool deleteFeatures ( const QgsFeatureIds & id ) override ;
154
107
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
- */
160
108
virtual bool addAttributes ( const QList<QgsField> &attributes ) override ;
161
109
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
- */
167
110
virtual bool deleteAttributes ( const QgsAttributeIds &attributes ) override ;
168
111
169
- // ! Changes attribute values of existing features
170
112
virtual bool changeAttributeValues ( const QgsChangedAttributesMap &attr_map ) override ;
171
113
172
- // ! Changes existing geometries
173
114
virtual bool changeGeometryValues ( const QgsGeometryMap &geometry_map ) override ;
174
115
175
- /* *
176
- * Create a spatial index for the current layer
177
- */
178
116
virtual bool createSpatialIndex () override ;
179
117
180
- // ! Create an attribute index on the datasource
181
118
virtual bool createAttributeIndex ( int field ) override ;
182
119
183
120
// ! Convert a QgsField to work with MSSQL
@@ -227,6 +164,7 @@ class QgsMssqlProvider : public QgsVectorDataProvider
227
164
228
165
long mNumberFeatures ;
229
166
QString mFidColName ;
167
+ int mFidColIdx ;
230
168
mutable long mSRId ;
231
169
QString mGeometryColName ;
232
170
QString mGeometryColType ;
0 commit comments