aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_sql.erl
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2019-12-16 06:52:06 +0300
committerAlexey Shchepin <alexey@process-one.net>2019-12-16 06:52:06 +0300
commit24ac62eabdb3f884dcdeda0b7f79592aff342f5d (patch)
tree2c424f460d3e519779648fccfe43b01026a5257a /src/ejabberd_sql.erl
parentImprove compatibility with CockroachDB (#3074) (diff)
Improve compatibility with CockroachDB (#3074)
Diffstat (limited to 'src/ejabberd_sql.erl')
-rw-r--r--src/ejabberd_sql.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ejabberd_sql.erl b/src/ejabberd_sql.erl
index 22151b697..5bf371654 100644
--- a/src/ejabberd_sql.erl
+++ b/src/ejabberd_sql.erl
@@ -45,6 +45,7 @@
escape_like_arg/1,
escape_like_arg_circumflex/1,
to_string_literal/2,
+ to_string_literal_t/1,
to_bool/1,
sqlite_db/1,
sqlite_file/1,
@@ -263,6 +264,10 @@ to_string_literal(sqlite, S) ->
to_string_literal(pgsql, S) ->
<<"E'", (escape(S))/binary, "'">>.
+to_string_literal_t(S) ->
+ State = get(?STATE_KEY),
+ to_string_literal(State#state.db_type, S).
+
encode_term(Term) ->
escape(list_to_binary(
erl_prettypr:format(erl_syntax:abstract(Term),