Changeset View
Changeset View
Standalone View
Standalone View
src/KDb.h
Show All 29 Lines | |||||
30 | class QDomDocument; | 30 | class QDomDocument; | ||
31 | 31 | | |||
32 | class KDbConnection; | 32 | class KDbConnection; | ||
33 | class KDbConnectionData; | 33 | class KDbConnectionData; | ||
34 | class KDbDriver; | 34 | class KDbDriver; | ||
35 | class KDbEscapedString; | 35 | class KDbEscapedString; | ||
36 | class KDbLookupFieldSchema; | 36 | class KDbLookupFieldSchema; | ||
37 | class KDbMessageHandler; | 37 | class KDbMessageHandler; | ||
38 | class KDbQuerySchema; | | |||
39 | class KDbResultable; | 38 | class KDbResultable; | ||
40 | class KDbResultInfo; | 39 | class KDbResultInfo; | ||
41 | class KDbTableOrQuerySchema; | 40 | class KDbTableOrQuerySchema; | ||
42 | class KDbVersionInfo; | 41 | class KDbVersionInfo; | ||
43 | class tristate; | 42 | class tristate; | ||
44 | 43 | | |||
45 | namespace KDb | 44 | namespace KDb | ||
46 | { | 45 | { | ||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Line(s) | |||||
221 | * On success true is returned and *id is set to the value of the identifier. | 220 | * On success true is returned and *id is set to the value of the identifier. | ||
222 | * On failure or if @a conn is @c nullptr, @c false is returned. | 221 | * On failure or if @a conn is @c nullptr, @c false is returned. | ||
223 | * If there is no object with specified name and type, @c cancelled value is returned. | 222 | * If there is no object with specified name and type, @c cancelled value is returned. | ||
224 | */ | 223 | */ | ||
225 | KDB_EXPORT tristate idForObjectName(KDbConnection* conn, int *id, const QString& objName, | 224 | KDB_EXPORT tristate idForObjectName(KDbConnection* conn, int *id, const QString& objName, | ||
226 | int objType); | 225 | int objType); | ||
227 | 226 | | |||
228 | /** | 227 | /** | ||
229 | * @brief Returns number of records returned by given SQL statement | | |||
230 | * | | |||
231 | * @return number of records that can be retrieved after executing @a sql statement within | | |||
232 | * a connection @a conn. The statement should be of type SELECT. For SQL data sources it does not | | |||
233 | * fetch any records, only "COUNT(*)" SQL aggregation is used at the backed. | | |||
234 | * -1 is returned if any error occurred or if @a conn is @c nullptr. | | |||
235 | */ | | |||
236 | //! @todo perhaps use quint64 here? | | |||
237 | KDB_EXPORT int recordCount(KDbConnection* conn, const KDbEscapedString& sql); | | |||
238 | | ||||
239 | /** | | |||
240 | * @brief Returns number of records that contains given table | | |||
241 | * | | |||
242 | * @return number of records that can be retrieved from @a tableSchema. | | |||
243 | * To obtain the result the table must be created or retrieved using a KDbConnection object, | | |||
244 | * i.e. tableSchema.connection() must not return @c nullptr. For SQL data sources only "COUNT(*)" | | |||
245 | * SQL aggregation is used at the backed. | | |||
246 | * -1 is returned if error occurred or if tableSchema.connection() is @c nullptr. | | |||
247 | */ | | |||
248 | //! @todo perhaps use quint64 here? | | |||
249 | KDB_EXPORT int recordCount(const KDbTableSchema& tableSchema); | | |||
250 | | ||||
251 | /** | | |||
252 | * @overload | | |||
253 | * | | |||
254 | * Operates on a query schema. @a params are optional values of parameters that will be inserted | | |||
255 | * into [] placeholders before execution of query that counts the records. | | |||
256 | * To obtain the result the query must be created or retrieved using a KDbConnection object, | | |||
257 | * i.e. querySchema->connection() must not return @c nullptr. For SQL data sources only "COUNT(*)" | | |||
258 | * SQL aggregation is used at the backed. | | |||
259 | * -1 is returned if error occurred or if querySchema->connection() is @c nullptr. | | |||
260 | */ | | |||
261 | //! @todo perhaps use quint64 here? | | |||
262 | KDB_EXPORT int recordCount(KDbQuerySchema* querySchema, | | |||
263 | const QList<QVariant>& params = QList<QVariant>()); | | |||
264 | | ||||
265 | /** | | |||
266 | * @overload | | |||
267 | * | | |||
268 | * Operates on a table or query schema. @a params is a list of optional parameters that | | |||
269 | * will be inserted into [] placeholders before execution of query that counts the records. | | |||
270 | * | | |||
271 | * If @a tableOrQuery is @c nullptr or provides neither table nor query, -1 is returned. | | |||
272 | */ | | |||
273 | //! @todo perhaps use quint64 here? | | |||
274 | KDB_EXPORT int recordCount(KDbTableOrQuerySchema* tableOrQuery, | | |||
275 | const QList<QVariant>& params = QList<QVariant>()); | | |||
276 | | ||||
277 | /** | | |||
278 | * @brief Returns number of columns within record set returned from specified table or query | | |||
279 | * | | |||
280 | * In case of query expanded fields list is counted. | | |||
281 | * Returns -1 if @a tableOrQuery is @c nullptr or has neither table or query assigned. | | |||
282 | */ | | |||
283 | KDB_EXPORT int fieldCount(KDbTableOrQuerySchema* tableOrQuery); | | |||
284 | | ||||
285 | /** | | |||
286 | * @brief Shows connection test dialog | 228 | * @brief Shows connection test dialog | ||
287 | * | 229 | * | ||
288 | * Shows connection test dialog with a progress bar indicating connection testing | 230 | * Shows connection test dialog with a progress bar indicating connection testing | ||
289 | * (within a separate thread). @a data is used to perform a (temporary) test connection. | 231 | * (within a separate thread). @a data is used to perform a (temporary) test connection. | ||
290 | * @a msgHandler can be used for error handling. @a parent is used as dialog's parent widget. | 232 | * @a msgHandler can be used for error handling. @a parent is used as dialog's parent widget. | ||
291 | * | 233 | * | ||
292 | * The dialog is modal so the call is blocking. | 234 | * The dialog is modal so the call is blocking. | ||
293 | * | 235 | * | ||
▲ Show 20 Lines • Show All 542 Lines • Show Last 20 Lines |