SqlitePreparedStatement

Search for usage in LXR

#include <SqlitePreparedStatement.h>

Inheritance diagram for SqlitePreparedStatement:

Public Member Functions

 SqlitePreparedStatement (SqliteConnectionInternal *conn)
 
- Public Member Functions inherited from KDbResultable
 KDbResultable (const KDbResultable &other)
 
void clearResult ()
 
KDbMessageHandlermessageHandler () const
 
KDbResultableoperator= (const KDbResultable &other)
 
KDbResult result () const
 
virtual QString serverResultName () const
 
void setMessageHandler (KDbMessageHandler *handler)
 
void showMessage ()
 

Protected Member Functions

bool bindValue (KDbField *field, const QVariant &value, int arg)
 
QSharedPointer< KDbSqlResultexecute (KDbPreparedStatement::Type type, const KDbField::List &selectFieldList, KDbFieldList *insertFieldList, const KDbPreparedStatementParameters &parameters) override
 
bool prepare (const KDbEscapedString &sql) override
 
SqliteSqlResult * sqlResult ()
 

Protected Attributes

QSharedPointer< KDbSqlResultm_sqlResult
 
- Protected Attributes inherited from KDbResultable
Private *const d
 
KDbResult m_result
 

Detailed Description

Implementation of prepared statements for the SQLite driver.

Definition at line 29 of file SqlitePreparedStatement.h.

Member Function Documentation

◆ bindValue()

bool SqlitePreparedStatement::bindValue ( KDbField field,
const QVariant value,
int  arg 
)
protected
Todo:
optimize: make a static copy so SQLITE_STATIC can be used
Todo:
what about unsigned > INT_MAX ?
Todo:
what about unsigned > LLONG_MAX ?

Definition at line 43 of file SqlitePreparedStatement.cpp.

◆ execute()

QSharedPointer< KDbSqlResult > SqlitePreparedStatement::execute ( KDbPreparedStatement::Type  type,
const KDbField::List selectFieldList,
KDbFieldList insertFieldList,
const KDbPreparedStatementParameters parameters 
)
overrideprotectedvirtual

For implementation, executes the prepared statement Type of statement is specified by the type parameter.

selectFieldList specifies fields for SELECT statement. insertFieldList is set to list of fields in INSERT statement. Parameters parameters are passed to the statement, usually using binding.

Todo:
fetch result

Implements KDbPreparedStatementInterface.

Definition at line 191 of file SqlitePreparedStatement.cpp.

◆ prepare()

bool SqlitePreparedStatement::prepare ( const KDbEscapedString sql)
overrideprotectedvirtual

For implementation. Initializes the prepared statement in a backend-dependent way using recently generated sql statement. It should be guaranteed that sql is valid and not empty. For example sqlite3_prepare() is used for SQLite. This is called only when d->dirty == true is encountered on execute(), i.e. when attributes of the object (like WHERE field names) change.

Implements KDbPreparedStatementInterface.

Definition at line 36 of file SqlitePreparedStatement.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 04:08:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.