chore: update ecql to 0.6.0
This commit is contained in:
parent
f0cde3fc5b
commit
e4c683d6f8
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{erl_opts, [debug_info]}.
|
{erl_opts, [debug_info]}.
|
||||||
{deps, [
|
{deps, [
|
||||||
{ecql, {git, "https://github.com/emqx/ecql.git", {tag, "v0.5.2"}}},
|
{ecql, {git, "https://github.com/emqx/ecql.git", {tag, "v0.6.0"}}},
|
||||||
{emqx_connector, {path, "../../apps/emqx_connector"}},
|
{emqx_connector, {path, "../../apps/emqx_connector"}},
|
||||||
{emqx_resource, {path, "../../apps/emqx_resource"}},
|
{emqx_resource, {path, "../../apps/emqx_resource"}},
|
||||||
{emqx_bridge, {path, "../../apps/emqx_bridge"}}
|
{emqx_bridge, {path, "../../apps/emqx_bridge"}}
|
||||||
|
|
|
@ -159,7 +159,7 @@ on_add_channel(_InstId, #{channels := Channs} = OldState, ChannId, ChannConf0) -
|
||||||
#{parameters := #{cql := CQL}} = ChannConf0,
|
#{parameters := #{cql := CQL}} = ChannConf0,
|
||||||
{PrepareCQL, ParamsTokens} = emqx_placeholder:preproc_sql(CQL, '?'),
|
{PrepareCQL, ParamsTokens} = emqx_placeholder:preproc_sql(CQL, '?'),
|
||||||
ParsedCql = #{
|
ParsedCql = #{
|
||||||
prepare_key => short_prepare_key(ChannId),
|
prepare_key => make_prepare_key(ChannId),
|
||||||
prepare_cql => PrepareCQL,
|
prepare_cql => PrepareCQL,
|
||||||
params_tokens => ParamsTokens
|
params_tokens => ParamsTokens
|
||||||
},
|
},
|
||||||
|
@ -462,10 +462,5 @@ maybe_assign_type(V) when is_float(V) -> {double, V};
|
||||||
maybe_assign_type(V) ->
|
maybe_assign_type(V) ->
|
||||||
V.
|
V.
|
||||||
|
|
||||||
short_prepare_key(Str) when is_binary(Str) ->
|
make_prepare_key(ChannId) ->
|
||||||
true = size(Str) > 0,
|
ChannId.
|
||||||
Sha = crypto:hash(sha, Str),
|
|
||||||
%% TODO: change to binary:encode_hex(X, lowercase) when OTP version is always > 25
|
|
||||||
Hex = string:lowercase(binary:encode_hex(Sha)),
|
|
||||||
<<UniqueEnough:16/binary, _/binary>> = Hex,
|
|
||||||
binary_to_atom(<<"cassa_prepare_key:", UniqueEnough/binary>>).
|
|
||||||
|
|
Loading…
Reference in New Issue