~singpolyma/biboumi

ref: 369ccb037619871403b14c959bbb359332133810 biboumi/src/database/column.hpp -rw-r--r-- 376 bytes
369ccb03 — louiz’ Add default values for the database columns 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include <cstdint>

template <typename T>
struct Column
{
    Column(T default_value):
        value{default_value} {}
    Column():
        value{} {}
    using real_type = T;
    T value{};
};

struct Id: Column<std::size_t> { static constexpr auto name = "id_";
                                 static constexpr auto options = "PRIMARY KEY AUTOINCREMENT"; };