New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tdengine): fix SQL template errors #11266
Conversation
1. supports multi-table insert 2. supports constructing subtable names by mixed prefixes and placeholders
|
||
`insert into table_${topic} values (${ts}, '${id}', '${topic}')` | ||
|
||
Note: This is a breaking change, at the former, the string-type values are automatically quoted, bu now, you should manually quote them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: ... bu now...
fun({Table, Size}) -> | ||
?assertMatch( | ||
[[Size]], | ||
connect_and_query(Config, "SELECT COUNT(1) FROM " ++ Table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you changed from SELECT COUNT(1)
to SELECT 1
on line 489. Maybe use it here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this'll probably require amending the docs for this bridge, as it currently claims it supports prepared statements and now it won't support them anymore.
Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
Fixes EMQX-10545
Summary
馃 Generated by Copilot at fef5087
Refactored and simplified the SQL placeholder processing logic in
emqx_bridge_tdengine_connector.erl
. Renamed a function for clarity.PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update