VTK  9.3.0
vtkQtSQLQuery.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
12 #ifndef vtkQtSQLQuery_h
13 #define vtkQtSQLQuery_h
14 
15 #include "vtkGUISupportQtSQLModule.h" // For export macro
16 #include "vtkSQLQuery.h"
17 
18 VTK_ABI_NAMESPACE_BEGIN
19 class vtkVariant;
20 class vtkQtSQLQueryInternals;
21 
22 class VTKGUISUPPORTQTSQL_EXPORT vtkQtSQLQuery : public vtkSQLQuery
23 {
24 public:
25  static vtkQtSQLQuery* New();
26  vtkTypeMacro(vtkQtSQLQuery, vtkSQLQuery);
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
34  bool Execute() override;
35 
39  int GetNumberOfFields() override;
40 
44  const char* GetFieldName(int col) override;
45 
49  int GetFieldType(int col) override;
50 
54  bool NextRow() override;
55 
60 
64  bool HasError() override;
65 
69  const char* GetLastErrorText() override;
70 
71 protected:
73  ~vtkQtSQLQuery() override;
74 
75  vtkQtSQLQueryInternals* Internals;
76  friend class vtkQtSQLDatabase;
77 
78 private:
79  // Using the convenience function internally
80  vtkSetStringMacro(LastErrorText);
81 
82  char* LastErrorText;
83 
84  vtkQtSQLQuery(const vtkQtSQLQuery&) = delete;
85  void operator=(const vtkQtSQLQuery&) = delete;
86 };
87 
88 VTK_ABI_NAMESPACE_END
89 #endif // vtkQtSQLQuery_h
a simple class to control print indentation
Definition: vtkIndent.h:29
maintains a connection to an sql database
friend class vtkQtSQLQuery
query class associated with vtkQtSQLDatabase
Definition: vtkQtSQLQuery.h:23
const char * GetLastErrorText() override
Get the last error text from the query.
vtkVariant DataValue(vtkIdType c) override
Return data in current row, field c.
~vtkQtSQLQuery() override
const char * GetFieldName(int col) override
Return the name of the specified query field.
static vtkQtSQLQuery * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetNumberOfFields() override
The number of fields in the query result.
int GetFieldType(int col) override
Return the type of the specified query field, as defined in vtkType.h.
vtkQtSQLQueryInternals * Internals
Definition: vtkQtSQLQuery.h:75
bool Execute() override
Execute the query.
bool HasError() override
Returns true if an error is set, otherwise false.
bool NextRow() override
Advance row, return false if past end.
executes an sql query and retrieves results
Definition: vtkSQLQuery.h:60
A type representing the union of many types.
Definition: vtkVariant.h:53
int vtkIdType
Definition: vtkType.h:315