diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-09-30 00:51:54 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-09-30 00:51:54 +0100 |
commit | edfaf671d016f675a3a3b87d58d615a92e84148b (patch) | |
tree | ca0175cac539709a33b6c81bda3611ed1b87fc4d /test/test-ingest.cpp | |
parent | 3e99d080b2a3a9b6eae85ae9e3224534744ad7b9 (diff) | |
download | webstat-edfaf671d016f675a3a3b87d58d615a92e84148b.tar.bz2 webstat-edfaf671d016f675a3a3b87d58d615a92e84148b.tar.xz webstat-edfaf671d016f675a3a3b87d58d615a92e84148b.zip |
Switch to PostgreSQL's oid type for entity ids
oid is an "unsigned 4 byte integer", which matches our crc32 approach
perfectly, and is half the storage cost of bigint.
Diffstat (limited to 'test/test-ingest.cpp')
-rw-r--r-- | test/test-ingest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp index f86dd25..73a37c6 100644 --- a/test/test-ingest.cpp +++ b/test/test-ingest.cpp @@ -278,11 +278,11 @@ BOOST_AUTO_TEST_CASE(DiscardUnparsable) { BOOST_REQUIRE_NO_THROW(ingestLogLine("does not parse")); auto dbconn = dbpool->get(); - auto select = dbconn->select("SELECT id, value FROM entities WHERE type = 'unparsable_line'"); - constexpr std::array<std::tuple<uint64_t, std::string_view>, 1> EXPECTED {{ + auto select = dbconn->select("SELECT id::bigint, value FROM entities WHERE type = 'unparsable_line'"); + constexpr std::array<std::tuple<Crc32Value, std::string_view>, 1> EXPECTED {{ {1664299262, "does not parse"}, }}; - auto rows = select->as<uint64_t, std::string_view>(); + auto rows = select->as<Crc32Value, std::string_view>(); BOOST_CHECK_EQUAL_COLLECTIONS(rows.begin(), rows.end(), EXPECTED.begin(), EXPECTED.end()); } |