summaryrefslogtreecommitdiff
path: root/src/sql.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql.cpp')
-rw-r--r--src/sql.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sql.cpp b/src/sql.cpp
new file mode 100644
index 0000000..8512657
--- /dev/null
+++ b/src/sql.cpp
@@ -0,0 +1,16 @@
+#include "sql.hpp"
+#include <command.h>
+
+namespace WebStat::SQL {
+ // ccache doesn't play nicely with #embed
+ // https://github.com/ccache/ccache/issues/1540
+ // ccache:disable
+
+ const std::string ENTITY_INSERT {
+#embed "sql/entityInsert.sql"
+ };
+#define HASH_OPTS(VAR) \
+ const DB::CommandOptionsPtr VAR##_OPTS = std::make_shared<DB::CommandOptions>(std::hash<std::string> {}(VAR))
+ HASH_OPTS(ENTITY_INSERT);
+#undef HASH_OPTS
+}