sqlrclient.h
// Copyright (c) 1999-2001 David Muse
// See the file COPYING for more information.
#ifndef SQLRCLIENT_H
#define SQLRCLIENT_H
#include <sqlrelay/private/sqlrclientincludes.h>
class SQLRCLIENT_DLLSPEC sqlrconnection {
public:
sqlrconnection(const char *server, uint16_t port,
const char *socket,
const char *user, const char *password,
int32_t retrytime, int32_t tries);
~sqlrconnection();
void setConnectTimeout(int32_t timeoutsec,
int32_t timeoutusec);
void setAuthenticationTimeout(int32_t timeoutsec,
int32_t timeoutusec);
void setResponseTimeout(int32_t timeoutsec,
int32_t timeoutusec);
void enableKerberos(const char *service,
const char *mech,
const char *flags);
void enableTls(const char *version,
const char *cert,
const char *password,
const char *ciphers,
const char *validate,
const char *ca,
uint16_t depth);
void disableEncryption();
void endSession();
bool suspendSession();
uint16_t getConnectionPort();
const char *getConnectionSocket();
bool resumeSession(uint16_t port, const char *socket);
bool ping();
const char *identify();
const char *dbVersion();
const char *dbHostName();
const char *dbIpAddress();
const char *serverVersion();
const char *clientVersion();
const char *bindFormat();
bool selectDatabase(const char *database);
const char *getCurrentDatabase();
uint64_t getLastInsertId();
bool autoCommitOn();
bool autoCommitOff();
bool begin();
bool commit();
bool rollback();
const char *errorMessage();
int64_t errorNumber();
void debugOn();
void debugOff();
bool getDebug();
void debugPrintFunction(int (*printfunction)
(const char *,...));
void setDebugFile(const char *filename);
void setClientInfo(const char *clientinfo);
const char *getClientInfo() const;
#include <sqlrelay/private/sqlrconnection.h>
};
class SQLRCLIENT_DLLSPEC sqlrcursor {
public:
sqlrcursor(sqlrconnection *sqlrc);
~sqlrcursor();
void setResultSetBufferSize(uint64_t rows);
uint64_t getResultSetBufferSize();
void dontGetColumnInfo();
void getColumnInfo();
void mixedCaseColumnNames();
void upperCaseColumnNames();
void lowerCaseColumnNames();
void cacheToFile(const char *filename);
void setCacheTtl(uint32_t ttl);
const char *getCacheFileName();
void cacheOff();
bool getDatabaseList(const char *wild);
bool getTableList(const char *wild);
bool getColumnList(const char *table, const char *wild);
bool sendQuery(const char *query);
bool sendQuery(const char *query, uint32_t length);
bool sendFileQuery(const char *path, const char *filename);
void prepareQuery(const char *query);
void prepareQuery(const char *query, uint32_t length);
bool prepareFileQuery(const char *path,
const char *filename);
void substitution(const char *variable, const char *value);
void substitution(const char *variable, int64_t value);
void substitution(const char *variable, double value,
uint32_t precision,
uint32_t scale);
void substitutions(const char **variables,
const char **values);
void substitutions(const char **variables,
const int64_t *values);
void substitutions(const char **variables,
const double *values,
const uint32_t *precisions,
const uint32_t *scales);
void inputBind(const char *variable, const char *value);
void inputBind(const char *variable, const char *value,
uint32_t valuelength);
void inputBind(const char *variable, int64_t value);
void inputBind(const char *variable, double value,
uint32_t precision,
uint32_t scale);
void inputBind(const char *variable,
int16_t year, int16_t month, int16_t day,
int16_t hour, int16_t minute, int16_t second,
int32_t microsecond, const char *tz);
void inputBindBlob(const char *variable,
const char *value,
uint32_t size);
void inputBindClob(const char *variable,
const char *value,
uint32_t size);
void inputBinds(const char **variables, const char **values);
void inputBinds(const char **variables,
const int64_t *values);
void inputBinds(const char **variables,
const double *values,
const uint32_t *precisions,
const uint32_t *scales);
void defineOutputBindString(const char *variable,
uint32_t bufferlength);
void defineOutputBindInteger(const char *variable);
void defineOutputBindDouble(const char *variable);
void defineOutputBindDate(const char *variable);
void defineOutputBindBlob(const char *variable);
void defineOutputBindClob(const char *variable);
void defineOutputBindCursor(const char *variable);
void clearBinds();
uint16_t countBindVariables() const;
void validateBinds();
bool validBind(const char *variable);
bool executeQuery();
bool fetchFromBindCursor();
const char *getOutputBindString(const char *variable);
int64_t getOutputBindInteger(const char *variable);
double getOutputBindDouble(const char *variable);
bool getOutputBindDate(const char *variable,
int16_t *year,
int16_t *month,
int16_t *day,
int16_t *hour,
int16_t *minute,
int16_t *second,
int32_t *microsecond,
const char **tz);
const char *getOutputBindBlob(const char *variable);
const char *getOutputBindClob(const char *variable);
uint32_t getOutputBindLength(const char *variable);
sqlrcursor *getOutputBindCursor(const char *variable);
bool openCachedResultSet(const char *filename);
uint32_t colCount();
uint64_t rowCount();
uint64_t totalRows();
uint64_t affectedRows();
uint64_t firstRowIndex();
bool endOfResultSet();
const char *errorMessage();
int64_t errorNumber();
void getNullsAsEmptyStrings();
void getNullsAsNulls();
const char *getField(uint64_t row, uint32_t col);
const char *getField(uint64_t row, const char *col);
int64_t getFieldAsInteger(uint64_t row, uint32_t col);
int64_t getFieldAsInteger(uint64_t row, const char *col);
double getFieldAsDouble(uint64_t row, uint32_t col);
double getFieldAsDouble(uint64_t row, const char *col);
uint32_t getFieldLength(uint64_t row, uint32_t col);
uint32_t getFieldLength(uint64_t row, const char *col);
const char * const *getRow(uint64_t row);
uint32_t *getRowLengths(uint64_t row);
const char * const *getColumnNames();
const char *getColumnName(uint32_t col);
const char *getColumnType(uint32_t col);
const char *getColumnType(const char *col);
uint32_t getColumnLength(uint32_t col);
uint32_t getColumnLength(const char *col);
uint32_t getColumnPrecision(uint32_t col);
uint32_t getColumnPrecision(const char *col);
uint32_t getColumnScale(uint32_t col);
uint32_t getColumnScale(const char *col);
bool getColumnIsNullable(uint32_t col);
bool getColumnIsNullable(const char *col);
bool getColumnIsPrimaryKey(uint32_t col);
bool getColumnIsPrimaryKey(const char *col);
bool getColumnIsUnique(uint32_t col);
bool getColumnIsUnique(const char *col);
bool getColumnIsPartOfKey(uint32_t col);
bool getColumnIsPartOfKey(const char *col);
bool getColumnIsUnsigned(uint32_t col);
bool getColumnIsUnsigned(const char *col);
bool getColumnIsZeroFilled(uint32_t col);
bool getColumnIsZeroFilled(const char *col);
bool getColumnIsBinary(uint32_t col);
bool getColumnIsBinary(const char *col);
bool getColumnIsAutoIncrement(uint32_t col);
bool getColumnIsAutoIncrement(const char *col);
uint32_t getLongest(uint32_t col);
uint32_t getLongest(const char *col);
void suspendResultSet();
uint16_t getResultSetId();
bool resumeResultSet(uint16_t id);
bool resumeCachedResultSet(uint16_t id,
const char *filename);
void closeResultSet();
#include <sqlrelay/private/sqlrcursor.h>
};
#endif
sqlrconnection
Definition: sqlrclient.h:9
sqlrcursor
Definition: sqlrclient.h:341