32 lines
878 B
C++
32 lines
878 B
C++
//
|
|
// Created by selim on 06.11.22.
|
|
//
|
|
|
|
#ifndef AUTOCAT_GNOME_IDBENTITY_H
|
|
#define AUTOCAT_GNOME_IDBENTITY_H
|
|
|
|
#include <string>
|
|
#include <optional>
|
|
#include <variant>
|
|
#include <vector>
|
|
#include <sqlite3.h>
|
|
|
|
using StringOptional = std::optional<std::string>;
|
|
using IntOptional = std::optional<int>;
|
|
using DoubleOptional = std::optional<double>;
|
|
|
|
struct IDBEntity {
|
|
public:
|
|
virtual std::string insertQuery() = 0;
|
|
|
|
protected:
|
|
static std::string readString(sqlite3_stmt* stmt, int column);
|
|
static int readInt(sqlite3_stmt* stmt, int column);
|
|
static double readDouble(sqlite3_stmt* stmt, int column);
|
|
static StringOptional readStringOptional(sqlite3_stmt* stmt, int column);
|
|
static IntOptional readIntOptional(sqlite3_stmt* stmt, int column);
|
|
static DoubleOptional readDoubleOptional(sqlite3_stmt* stmt, int column);
|
|
};
|
|
|
|
#endif //AUTOCAT_GNOME_IDBENTITY_H
|