KDbPreparedStatementInterface

Search for usage in LXR

KDbPreparedStatementInterface Class Referenceabstract

#include <KDbPreparedStatementInterface.h>

Inheritance diagram for KDbPreparedStatementInterface:

Protected Member Functions

virtual QSharedPointer< KDbSqlResultexecute (KDbPreparedStatement::Type type, const KDbField::List &selectFieldList, KDbFieldList *insertFieldList, const KDbPreparedStatementParameters &parameters)=0
 
virtual bool prepare (const KDbEscapedString &sql)=0
 

Additional Inherited Members

- 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 Attributes inherited from KDbResultable
Private *const d
 
KDbResult m_result
 

Detailed Description

Prepared statement interface for backend-dependent implementations.

Definition at line 31 of file KDbPreparedStatementInterface.h.

Member Function Documentation

◆ execute()

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

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.

Implemented in SqlitePreparedStatement.

◆ prepare()

virtual bool KDbPreparedStatementInterface::prepare ( const KDbEscapedString sql)
protectedpure virtual

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.

Implemented in SqlitePreparedStatement.


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

KDE's Doxygen guidelines are available online.