-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathsql.cpp.jinja
More file actions
33 lines (26 loc) · 945 Bytes
/
sql.cpp.jinja
File metadata and controls
33 lines (26 loc) · 945 Bytes
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
32
/* THIS FILE IS AUTOGENERATED, DON'T EDIT! */
#include <{{ namespace }}/sql_queries.hpp>
namespace {{ namespace }}::sql {
{%- macro generate_file(service_file) %}
// Generated from {{ service_file.source }}
const USERVER_NAMESPACE::storages::Query {{ service_file.variable }} = {
R"-(
{{ service_file.contents }}
)-",
USERVER_NAMESPACE::storages::Query::NameLiteral("{{ service_file.name }}"),
{%- if query_log_mode == QueryLogMode.FULL %}
USERVER_NAMESPACE::storages::Query::LogMode::kFull,
{%- elif query_log_mode == QueryLogMode.NAME_ONLY %}
USERVER_NAMESPACE::storages::Query::LogMode::kNameOnly,
{%- else %}
{{ raise_error("unknown LogMode: ", query_log_mode) }}
{%- endif %}
};
{% endmacro -%}
{% for service_file in sql_service_files %}
{{ generate_file(service_file) }}
{% endfor -%}
{%- for service_file in yql_service_files %}
{{ generate_file(service_file) }}
{% endfor -%}
} // namespace {{ namespace }}::sql