Poco::Data::SQLite

class Extractor

Library: Data/SQLite
Package: SQLite
Header: Poco/Data/SQLite/Extractor.h

Description

Extracts and converts data values form the result row returned by SQLite. If NULL is received, the incoming val value is not changed and false is returned

Inheritance

Direct Base Classes: Poco::Data::AbstractExtractor

All Base Classes: Poco::Data::AbstractExtractor

Member Summary

Member Functions: extract, isNull, reset

Inherited Functions: extract, isNull, reset, reverseTranscode, transcode, transcodeRequired

Types

NullIndVec

typedef std::vector < std::pair < bool, bool > > NullIndVec;

Type for null indicators container.

Constructors

Extractor

Extractor(
    sqlite3_stmt * pStmt
);

Creates the Extractor.

Destructor

~Extractor virtual

~Extractor();

Destroys the Extractor.

Member Functions

extract virtual inline

bool extract(
    std::size_t pos,
    Poco::Int8 & val
);

Extracts an Int8.

extract virtual

bool extract(
    std::size_t pos,
    Poco::UInt8 & val
);

Extracts an UInt8.

extract virtual

bool extract(
    std::size_t pos,
    Poco::Int16 & val
);

Extracts an Int16.

extract virtual

bool extract(
    std::size_t pos,
    Poco::UInt16 & val
);

Extracts an UInt16.

extract virtual

bool extract(
    std::size_t pos,
    Poco::Int32 & val
);

Extracts an Int32.

extract virtual

bool extract(
    std::size_t pos,
    Poco::UInt32 & val
);

Extracts an UInt32.

extract virtual

bool extract(
    std::size_t pos,
    Poco::Int64 & val
);

Extracts an Int64.

extract virtual

bool extract(
    std::size_t pos,
    Poco::UInt64 & val
);

Extracts an UInt64.

extract virtual

bool extract(
    std::size_t pos,
    bool & val
);

Extracts a boolean.

extract virtual

bool extract(
    std::size_t pos,
    float & val
);

Extracts a float.

extract virtual

bool extract(
    std::size_t pos,
    double & val
);

Extracts a double.

extract virtual

bool extract(
    std::size_t pos,
    char & val
);

Extracts a single character.

extract virtual

bool extract(
    std::size_t pos,
    std::string & val
);

Extracts a string.

extract

bool extract(
    std::size_t pos,
    Poco::Data::BLOB & val
);

Extracts a BLOB.

extract

bool extract(
    std::size_t pos,
    Poco::Data::CLOB & val
);

Extracts a CLOB.

extract

bool extract(
    std::size_t pos,
    Poco::Data::Date & val
);

Extracts a Date.

extract

bool extract(
    std::size_t pos,
    Poco::Data::Time & val
);

Extracts a Time.

extract

bool extract(
    std::size_t pos,
    Poco::DateTime & val
);

Extracts a DateTime.

extract

bool extract(
    std::size_t pos,
    Poco::UUID & val
);

Extracts a Time.

extract

bool extract(
    std::size_t pos,
    Poco::Any & val
);

Extracts an Any.

extract

bool extract(
    std::size_t pos,
    Poco::DynamicAny & val
);

Extracts a DynamicAny.

isNull virtual

bool isNull(
    std::size_t pos,
    std::size_t row = POCO_DATA_INVALID_ROW
);

Returns true if the current row value at pos column is null. Because of the loss of information about null-ness of the underlying database values due to the nature of SQLite engine, (once null value is converted to default value, SQLite API treats it as non-null), a null indicator container member variable is used to cache the indicators of the underlying nulls thus rendering this function idempotent. The container is a vector of [bool, bool] pairs. The vector index corresponds to the column position, the first bool value in the pair is true if the null indicator has been set and the second bool value in the pair is true if the column is actually null. The row argument, needed for connectors with bulk capabilities, is ignored in this implementation.

reset virtual inline

void reset();

Clears the cached nulls indicator vector.