VTK  9.1.0
vtkPostgreSQLQuery.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPostgreSQLQuery.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
39#ifndef vtkPostgreSQLQuery_h
40#define vtkPostgreSQLQuery_h
41
42#include "vtkIOPostgreSQLModule.h" // For export macro
43#include "vtkSQLQuery.h"
44
46class vtkVariant;
47class vtkVariantArray;
48class vtkPostgreSQLQueryPrivate;
49
50class VTKIOPOSTGRESQL_EXPORT vtkPostgreSQLQuery : public vtkSQLQuery
51{
52public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
56
62 bool Execute() override;
63
67 int GetNumberOfFields() override;
68
72 const char* GetFieldName(int i) override;
73
77 int GetFieldType(int i) override;
78
82 bool NextRow() override;
83
87 bool HasError() override;
88
90
93 bool BeginTransaction() override;
94 bool RollbackTransaction() override;
95 bool CommitTransaction() override;
97
102
106 const char* GetLastErrorText() override;
107
111 vtkStdString EscapeString(vtkStdString s, bool addSurroundingQuotes = true) override;
112
118
119protected:
122
123 vtkSetStringMacro(LastErrorText);
124
125 bool IsColumnBinary(int whichColumn);
126 const char* GetColumnRawData(int whichColumn);
127
131
132 vtkPostgreSQLQueryPrivate* QueryInternals;
133
135
137
138private:
139 vtkPostgreSQLQuery(const vtkPostgreSQLQuery&) = delete;
140 void operator=(const vtkPostgreSQLQuery&) = delete;
141};
142
143#endif // vtkPostgreSQLQuery_h
a simple class to control print indentation
Definition: vtkIndent.h:113
maintain a connection to a PostgreSQL database
vtkSQLQuery implementation for PostgreSQL databases
vtkStdString EscapeString(vtkStdString s, bool addSurroundingQuotes=true) override
Escape a string for inclusion into an SQL query.
int GetNumberOfFields() override
The number of fields in the query result.
bool HasError() override
Return true if there is an error on the current query.
bool IsColumnBinary(int whichColumn)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetColumnRawData(int whichColumn)
bool Execute() override
Execute the query.
vtkPostgreSQLQueryPrivate * QueryInternals
int GetFieldType(int i) override
Return the type of the field, using the constants defined in vtkType.h.
bool RollbackTransaction() override
Begin, abort (roll back), or commit a transaction.
int GetNumberOfRows()
Unlike some databases, Postgres can tell you right away how many rows are in the results of your quer...
bool NextRow() override
Advance row, return false if past end.
vtkVariant DataValue(vtkIdType c) override
Return data in current row, field c.
~vtkPostgreSQLQuery() override
bool BeginTransaction() override
Begin, abort (roll back), or commit a transaction.
bool CommitTransaction() override
Begin, abort (roll back), or commit a transaction.
const char * GetFieldName(int i) override
Return the name of the specified query field.
const char * GetLastErrorText() override
Get the last error text from the query.
static vtkPostgreSQLQuery * New()
executes an sql query and retrieves results
Definition: vtkSQLQuery.h:69
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
An array holding vtkVariants.
A atomic type representing the union of many types.
Definition: vtkVariant.h:145
int vtkIdType
Definition: vtkType.h:332