relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
Loading...
Searching...
No Matches
literals.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "value.hpp"
4
5#include <string>
6#include <string_view>
7
10
14inline auto operator""_sql(unsigned long long value) {
15 return Value<int>(static_cast<int>(value));
16}
17
21inline auto operator""_sql(long double value) {
22 return Value<double>(static_cast<double>(value));
23}
24
29inline auto operator""_sql(const char* str, std::size_t len) {
30 return Value<std::string_view>(std::string_view(str, len));
31}
32
33} // namespace relx::query::literals
Represents a literal value in a SQL query.
Definition value.hpp:15
Literals namespace for SQL value literals.
Definition literals.hpp:9
auto value(T val)
Create a value expression.
Definition value.hpp:120