HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_SqlStatement Class Reference

#include <UT_SQL.h>

Classes

struct  null_tag_t
 

Public Types

enum  DataType {
  kUnknown = -1, kInteger, kFloat, kBlob,
  kText, kNull
}
 

Public Member Functions

 UT_SqlStatement (const UT_SqlDatabase &db, const UT_StringRef &sql)
 
 UT_SqlStatement (const UT_IntrusivePtr< UT_SqlStatementHandle > &stmt)
 
 ~UT_SqlStatement ()
 
 UT_SqlStatement (const UT_SqlStatement &)=delete
 
UT_SqlStatementoperator= (const UT_SqlStatement &)=delete
 
 UT_SqlStatement (UT_SqlStatement &&stmt)=delete
 
UT_SqlStatementoperator= (UT_SqlStatement &&stmt)=delete
 
void reset (bool clear_bindings=false)
 
NO_DISCARD int columnAsInt (int idx) const
 
NO_DISCARD bool columnAsBool (int idx) const
 
NO_DISCARD int64 columnAsInt64 (int idx) const
 
NO_DISCARD UT_StringHolder columnAsStr (int idx) const
 
NO_DISCARD double columnAsDouble (int idx) const
 
NO_DISCARD UT_IntArray columnAsIntArray (int idx) const
 
NO_DISCARD UT_Int64Array columnAsInt64Array (int idx) const
 
NO_DISCARD const voidcolumnAsBlob (int idx, int &size) const
 
NO_DISCARD null_tag_t columnAsNull (int idx) const
 
NO_DISCARD UT_StringHolder columnName (int idx) const
 
NO_DISCARD int columnCount () const
 
NO_DISCARD DataType columnType (int idx) const
 
NO_DISCARD int columnBytes (int idx) const
 
const char * sql () const
 
bool bind (int idx, null_tag_t)
 
bool bind (int idx, const UT_StringRef &value)
 
bool bind (int idx, const char *value)
 
bool bind (int idx, int value)
 
bool bind (int idx, int64 value)
 
bool bind (int idx, bool value)
 
bool bind (int idx, double value)
 
bool bind (int idx, const UT_IntArray &value)
 
bool bind (int idx, const UT_Int64Array &value)
 
bool bind (int idx, const void *value, int size)
 
template<typename... Args>
bool bindAll (Args &&...args)
 
bool bindNull (int idx)
 
NO_DISCARD bool isValid () const
 
bool run ()
 
bool step ()
 
template<typename T >
T get (int idx) const
 
const UT_ErrorCodegetError () const
 
template<>
double get (int idx) const
 
template<>
UT_StringHolder get (int idx) const
 
template<>
int get (int idx) const
 
template<>
int64 get (int idx) const
 
template<>
bool get (int idx) const
 
template<>
const voidget (int idx) const
 

Protected Member Functions

bool verifyHasStepped () const
 
bool verifyIndex (int idx) const
 
bool verifyColumn (int idx) const
 

Friends

class UT_SqlDatabase
 

Detailed Description

Definition at line 113 of file UT_SQL.h.

Member Enumeration Documentation

Enumerator
kUnknown 
kInteger 
kFloat 
kBlob 
kText 
kNull 

Definition at line 127 of file UT_SQL.h.

Constructor & Destructor Documentation

UT_SqlStatement::UT_SqlStatement ( const UT_SqlDatabase db,
const UT_StringRef sql 
)
UT_SqlStatement::UT_SqlStatement ( const UT_IntrusivePtr< UT_SqlStatementHandle > &  stmt)
UT_SqlStatement::~UT_SqlStatement ( )
UT_SqlStatement::UT_SqlStatement ( const UT_SqlStatement )
delete
UT_SqlStatement::UT_SqlStatement ( UT_SqlStatement &&  stmt)
delete

Member Function Documentation

bool UT_SqlStatement::bind ( int  idx,
null_tag_t   
)
bool UT_SqlStatement::bind ( int  idx,
const UT_StringRef value 
)
bool UT_SqlStatement::bind ( int  idx,
const char *  value 
)
bool UT_SqlStatement::bind ( int  idx,
int  value 
)
bool UT_SqlStatement::bind ( int  idx,
int64  value 
)
bool UT_SqlStatement::bind ( int  idx,
bool  value 
)
bool UT_SqlStatement::bind ( int  idx,
double  value 
)
bool UT_SqlStatement::bind ( int  idx,
const UT_IntArray value 
)
bool UT_SqlStatement::bind ( int  idx,
const UT_Int64Array value 
)
bool UT_SqlStatement::bind ( int  idx,
const void value,
int  size 
)
template<typename... Args>
bool UT_SqlStatement::bindAll ( Args &&...  args)
inline

Definition at line 177 of file UT_SQL.h.

bool UT_SqlStatement::bindNull ( int  idx)
inline

Definition at line 180 of file UT_SQL.h.

NO_DISCARD const void* UT_SqlStatement::columnAsBlob ( int  idx,
int size 
) const
NO_DISCARD bool UT_SqlStatement::columnAsBool ( int  idx) const
NO_DISCARD double UT_SqlStatement::columnAsDouble ( int  idx) const
NO_DISCARD int UT_SqlStatement::columnAsInt ( int  idx) const
NO_DISCARD int64 UT_SqlStatement::columnAsInt64 ( int  idx) const
NO_DISCARD UT_Int64Array UT_SqlStatement::columnAsInt64Array ( int  idx) const
NO_DISCARD UT_IntArray UT_SqlStatement::columnAsIntArray ( int  idx) const
NO_DISCARD null_tag_t UT_SqlStatement::columnAsNull ( int  idx) const
NO_DISCARD UT_StringHolder UT_SqlStatement::columnAsStr ( int  idx) const
NO_DISCARD int UT_SqlStatement::columnBytes ( int  idx) const
NO_DISCARD int UT_SqlStatement::columnCount ( ) const
NO_DISCARD UT_StringHolder UT_SqlStatement::columnName ( int  idx) const
NO_DISCARD DataType UT_SqlStatement::columnType ( int  idx) const
template<typename T >
T UT_SqlStatement::get ( int  idx) const
inline

Definition at line 191 of file UT_SQL.h.

template<>
double UT_SqlStatement::get ( int  idx) const
inline

Definition at line 234 of file UT_SQL.h.

template<>
UT_StringHolder UT_SqlStatement::get ( int  idx) const
inline

Definition at line 248 of file UT_SQL.h.

template<>
int UT_SqlStatement::get ( int  idx) const
inline

Definition at line 255 of file UT_SQL.h.

template<>
int64 UT_SqlStatement::get ( int  idx) const
inline

Definition at line 262 of file UT_SQL.h.

template<>
bool UT_SqlStatement::get ( int  idx) const
inline

Definition at line 269 of file UT_SQL.h.

template<>
const void* UT_SqlStatement::get ( int  idx) const
inline

Definition at line 276 of file UT_SQL.h.

const UT_ErrorCode& UT_SqlStatement::getError ( ) const
inline

Definition at line 201 of file UT_SQL.h.

NO_DISCARD bool UT_SqlStatement::isValid ( ) const
UT_SqlStatement& UT_SqlStatement::operator= ( const UT_SqlStatement )
delete
UT_SqlStatement& UT_SqlStatement::operator= ( UT_SqlStatement &&  stmt)
delete
void UT_SqlStatement::reset ( bool  clear_bindings = false)
bool UT_SqlStatement::run ( )
const char* UT_SqlStatement::sql ( ) const
bool UT_SqlStatement::step ( )
bool UT_SqlStatement::verifyColumn ( int  idx) const
protected
bool UT_SqlStatement::verifyHasStepped ( ) const
protected
bool UT_SqlStatement::verifyIndex ( int  idx) const
protected

Friends And Related Function Documentation

friend class UT_SqlDatabase
friend

Definition at line 212 of file UT_SQL.h.


The documentation for this class was generated from the following file: