summaryrefslogtreecommitdiff
path: root/lib/dbTypes.h
blob: ba0cd708a712f7cb23aabe1d62112ebfbe0334db (plain)
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
#ifndef MYGRATE_DBTYPES_H
#define MYGRATE_DBTYPES_H

#include "bitset.h"
#include <cstdint>
#include <span>
#include <string_view>
#include <variant>

struct timespec;

namespace MyGrate {
	struct Date {
		uint16_t year;
		uint8_t month;
		uint8_t day;
	};
	struct Time {
		uint8_t hour;
		uint8_t minute;
		uint8_t second;
	};
	struct DateTime : public Date, public Time {
	};
	using Blob = std::span<const std::byte>;

	using DbValue = std::variant<std::nullptr_t, double, float, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
			int64_t, uint64_t, timespec, Date, Time, DateTime, std::string_view, BitSet, Blob>;
}

#endif