pqxxdriver.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 Adam Pigg <adam@piggz.co.uk>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KEXIDB_DRIVER_PQXX_H
21#define KEXIDB_DRIVER_PQXX_H
22
23#include <tqstringlist.h>
24
25#include <kexidb/driver.h>
26
27namespace KexiDB
28{
29
30class Connection;
31class DriverManager;
32
34class pqxxSqlDriver : public Driver
35{
36 TQ_OBJECT
37
38 KEXIDB_DRIVER
39
40 public:
41 pqxxSqlDriver( TQObject *parent, const char *name, const TQStringList &args = TQStringList() );
43
44 virtual bool isSystemObjectName( const TQString& n )const;
45 virtual bool isSystemDatabaseName( const TQString& n )const;
46
48 virtual TQString escapeString( const TQString& str) const;
49 virtual TQCString escapeString( const TQCString& str) const;
50 virtual TQString sqlTypeName(int id_t, int p=0) const;
51
53 virtual TQString escapeBLOB(const TQByteArray& array) const;
54
58 virtual TQString valueToSQL( uint ftype, const TQVariant& v ) const;
59
60 protected:
61 virtual TQString drv_escapeIdentifier( const TQString& str) const;
62 virtual TQCString drv_escapeIdentifier( const TQCString& str) const;
63 virtual Connection *drv_createConnection( ConnectionData &conn_data );
64 virtual bool drv_isSystemFieldName( const TQString& n )const;
65
66 private:
67 static const char *keywords[];
68};
69
70};
71
72#endif
Database specific connection data, e.g. host, port.
Provides database connection, allowing queries and data modification.
Definition connection.h:62
Generic database abstraction.
Definition driver.h:67
PostgreSQL database driver.
Definition pqxxdriver.h:35
virtual TQString escapeBLOB(const TQByteArray &array) const
Escape BLOB value array.
virtual TQString valueToSQL(uint ftype, const TQVariant &v) const
virtual bool drv_isSystemFieldName(const TQString &n) const
virtual bool isSystemObjectName(const TQString &n) const
virtual TQString sqlTypeName(int id_t, int p=0) const
virtual TQString escapeString(const TQString &str) const
Escape a string for use as a value.
virtual Connection * drv_createConnection(ConnectionData &conn_data)
virtual bool isSystemDatabaseName(const TQString &n) const
virtual TQString drv_escapeIdentifier(const TQString &str) const
High-level database connectivity library with database backend drivers.