/usr/include/Wt/Dbo/backend/Sqlite3 is in libwtdbo-dev 3.1.10-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WT_DBO_BACKEND_SQLITE3_H_
#define WT_DBO_BACKEND_SQLITE3_H_
#include <Wt/Dbo/SqlConnection>
#include <Wt/Dbo/SqlStatement>
#include <Wt/Dbo/backend/WDboSqlite3DllDefs.h>
extern "C" {
struct sqlite3;
}
namespace Wt {
namespace Dbo {
namespace backend {
/*! \class Sqlite3 Wt/Dbo/backend/Sqlite3 Wt/Dbo/backend/Sqlite3
* \brief An SQLite3 connection
*
* This class provides the backend implementation for SQLite3 databases.
*
* \ingroup dbo
*/
class WTDBOSQLITE3_API Sqlite3 : public SqlConnection
{
public:
/*! \brief Configuration of date time storage.
*
* SQlite3 does not provide real type support for date time. Instead,
* it offers 3 choices for storing a date time, each of these compatible
* with the use of the built-in arithmetic functions.
*/
enum DateTimeStorage {
/*!
* As 'text' in ISO8601 format.
*/
ISO8601AsText,
/*!
* As 'real', the number of julian days. Note that this does not support
* second accuracy for a date time, but is the preferred format for a
* plain date.
*/
JulianDaysAsReal,
/*!
* As 'integer', number of seconds since UNIX Epoch.
*/
UnixTimeAsInteger
};
/*! \brief Opens a new SQLite3 backend connection.
*
* The \p db may be any of the values supported by sqlite3_open().
*/
Sqlite3(const std::string& db);
/*! \brief Copies an SQLite3 connection.
*/
Sqlite3(const Sqlite3& other);
/*! \brief Destructor.
*
* Closes the connection.
*/
~Sqlite3();
virtual Sqlite3 *clone() const;
/*! \brief Returns the underlying connection.
*/
sqlite3 *connection() { return db_; }
/*! \brief Returns the underlying connection string.
*/
std::string connectionString() { return conn_; }
/*! \brief Configures how to store date or date time.
*
* The default format is ISO8601AsText.
*/
void setDateTimeStorage(SqlDateTimeType type, DateTimeStorage format);
/*! \brief Returns the date time storage.
*/
DateTimeStorage dateTimeStorage(SqlDateTimeType type) const;
virtual void startTransaction();
virtual void commitTransaction();
virtual void rollbackTransaction();
virtual SqlStatement *prepareStatement(const std::string& sql);
/** @name Methods that return dialect information
*/
//@{
virtual std::string autoincrementSql() const;
virtual std::string autoincrementType() const;
virtual std::string autoincrementInsertSuffix() const;
virtual const char *dateTimeType(SqlDateTimeType type) const;
virtual const char *blobType() const;
//@}
private:
DateTimeStorage dateTimeStorage_[2];
std::string conn_;
sqlite3 *db_;
void init();
};
}
}
}
#endif // WT_DBO_BACKEND_SQLITE3_H_
|