summaryrefslogtreecommitdiff
path: root/src/database/column.hpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-10-04 21:28:18 +0200
committerlouiz’ <louiz@louiz.org>2017-12-02 20:08:47 +0100
commit0168b96b79db2627fdba77a8712956408aa081d1 (patch)
tree5591527ed8a04be8ea04c49521d9e9c868677bd1 /src/database/column.hpp
parent5b27cee97272d4ae6ff30f03dc57221fa3e3183f (diff)
downloadbiboumi-0168b96b79db2627fdba77a8712956408aa081d1.tar.gz
biboumi-0168b96b79db2627fdba77a8712956408aa081d1.tar.bz2
biboumi-0168b96b79db2627fdba77a8712956408aa081d1.tar.xz
biboumi-0168b96b79db2627fdba77a8712956408aa081d1.zip
Add postgresql support
Diffstat (limited to 'src/database/column.hpp')
-rw-r--r--src/database/column.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/database/column.hpp b/src/database/column.hpp
index 111f9ca..1f16bcf 100644
--- a/src/database/column.hpp
+++ b/src/database/column.hpp
@@ -13,5 +13,10 @@ struct Column
T value{};
};
-struct Id: Column<std::size_t> { static constexpr auto name = "id_";
- static constexpr auto options = "PRIMARY KEY AUTOINCREMENT"; };
+struct Id: Column<std::size_t> {
+ static constexpr std::size_t unset_value = static_cast<std::size_t>(-1);
+ static constexpr auto name = "id_";
+ static constexpr auto options = "PRIMARY KEY";
+
+ Id(): Column<std::size_t>(-1) {}
+};