sql.json 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. {
  2. "about": {
  3. "trial": true,
  4. "author": {
  5. "name": "EMQ",
  6. "email": "contact@emqx.io",
  7. "company": "EMQ Technologies Co., Ltd",
  8. "website": "https://www.emqx.io"
  9. },
  10. "helpUrl": {
  11. "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/rules/sources/plugin/sql.md",
  12. "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/rules/sources/plugin/sql.md"
  13. },
  14. "description": {
  15. "en_US": "Read message from sql database",
  16. "zh_CN": "从数据库中读取消息"
  17. }
  18. },
  19. "dataSource": {
  20. "default": "table1",
  21. "hint": {
  22. "en_US": "The SQL database to connect to, e.g. table1",
  23. "zh_CN": "将要连接的关系数据库表,例如 table1"
  24. },
  25. "label": {
  26. "en_US": "Data Source (Table)",
  27. "zh_CN": "数据源(表名)"
  28. }
  29. },
  30. "libs": [],
  31. "properties": {
  32. "default": [
  33. {
  34. "name": "url",
  35. "default": "",
  36. "optional": false,
  37. "control": "text",
  38. "type": "string",
  39. "hint": {
  40. "en_US": "The url of the database",
  41. "zh_CN": "数据库服务器的 URL"
  42. },
  43. "label": {
  44. "en_US": "Server address",
  45. "zh_CN": "数据库地址"
  46. }
  47. },
  48. {
  49. "name": "interval",
  50. "default": 1000,
  51. "optional": true,
  52. "control": "text",
  53. "type": "int",
  54. "hint": {
  55. "en_US": "The interval (ms) to issue a query",
  56. "zh_CN": "发出消息的间隔(毫秒)"
  57. },
  58. "label": {
  59. "en_US": "Interval",
  60. "zh_CN": "间隔时间"
  61. }
  62. },
  63. {
  64. "name": "internalSqlQueryCfg",
  65. "default": [
  66. {
  67. "name": "table",
  68. "default": "tableName",
  69. "optional": false,
  70. "control": "text",
  71. "type": "string",
  72. "hint": {
  73. "en_US": "table name to query",
  74. "zh_CN": "指定查询的数据库表名"
  75. },
  76. "label": {
  77. "en_US": "Table Name",
  78. "zh_CN": "表名"
  79. }
  80. },
  81. {
  82. "name": "indexField",
  83. "default": "",
  84. "optional": true,
  85. "control": "text",
  86. "type": "string",
  87. "hint": {
  88. "en_US": "index field",
  89. "zh_CN": "索引字段名"
  90. },
  91. "label": {
  92. "en_US": "Index Field",
  93. "zh_CN": "索引字段名"
  94. }
  95. },
  96. {
  97. "name": "indexValue",
  98. "default": "",
  99. "optional": true,
  100. "control": "text",
  101. "type": "string",
  102. "hint": {
  103. "en_US": "index init value",
  104. "zh_CN": "索引字段初始值"
  105. },
  106. "label": {
  107. "en_US": "Index init value",
  108. "zh_CN": "索引字段初始值"
  109. }
  110. },
  111. {
  112. "name": "limit",
  113. "default": 10,
  114. "optional": true,
  115. "control": "text",
  116. "type": "int",
  117. "hint": {
  118. "en_US": "query result limit",
  119. "zh_CN": "查询结果条数限制"
  120. },
  121. "label": {
  122. "en_US": "Limit",
  123. "zh_CN": "查询条数限制"
  124. }
  125. },
  126. {
  127. "name": "indexFieldType",
  128. "default": "",
  129. "optional": true,
  130. "control": "select",
  131. "type": "string",
  132. "values": ["DATETIME", "INT", "FLOAT", "STRING"],
  133. "hint": {
  134. "en_US": "is the index datetime type",
  135. "zh_CN": "是否为时间格式"
  136. },
  137. "label": {
  138. "en_US": "Index Field Type",
  139. "zh_CN": "索引字段格式"
  140. }
  141. },
  142. {
  143. "name": "dateTimeFormat",
  144. "default": "",
  145. "optional": true,
  146. "control": "text",
  147. "type": "string",
  148. "hint": {
  149. "en_US": "dateTimeFormat",
  150. "zh_CN": "dateTimeFormat"
  151. },
  152. "label": {
  153. "en_US": "DateTime Format",
  154. "zh_CN": "时间格式"
  155. }
  156. }
  157. ],
  158. "optional": true,
  159. "control": "list",
  160. "type": "list_object",
  161. "hint": {
  162. "en_US": "basic configuration for the query",
  163. "zh_CN": "查询基础配置"
  164. },
  165. "label": {
  166. "en_US": "Query Parameters",
  167. "zh_CN": "查询参数"
  168. }
  169. },
  170. {
  171. "name": "templateSqlQueryCfg",
  172. "default": [
  173. {
  174. "name": "TemplateSql",
  175. "default": "",
  176. "optional": false,
  177. "control": "text",
  178. "type": "string",
  179. "hint": {
  180. "en_US": "query template",
  181. "zh_CN": "查询语句模版"
  182. },
  183. "label": {
  184. "en_US": "Query template",
  185. "zh_CN": "查询语句模版"
  186. }
  187. },
  188. {
  189. "name": "indexField",
  190. "default": "",
  191. "optional": true,
  192. "control": "text",
  193. "type": "string",
  194. "hint": {
  195. "en_US": "index field",
  196. "zh_CN": "索引字段名"
  197. },
  198. "label": {
  199. "en_US": "Index Field",
  200. "zh_CN": "索引字段名"
  201. }
  202. },
  203. {
  204. "name": "indexValue",
  205. "default": "",
  206. "optional": true,
  207. "control": "text",
  208. "type": "string",
  209. "hint": {
  210. "en_US": "index init value",
  211. "zh_CN": "索引字段初始值"
  212. },
  213. "label": {
  214. "en_US": "Index init value",
  215. "zh_CN": "索引字段初始值"
  216. }
  217. },
  218. {
  219. "name": "indexFieldType",
  220. "default": "",
  221. "optional": true,
  222. "control": "select",
  223. "type": "string",
  224. "values": ["DATETIME", "INT", "FLOAT", "STRING"],
  225. "hint": {
  226. "en_US": "is the index datetime type",
  227. "zh_CN": "是否为时间格式"
  228. },
  229. "label": {
  230. "en_US": "Index Field Type",
  231. "zh_CN": "索引字段格式"
  232. }
  233. },
  234. {
  235. "name": "dateTimeFormat",
  236. "default": "",
  237. "optional": true,
  238. "control": "text",
  239. "type": "string",
  240. "hint": {
  241. "en_US": "dateTimeFormat",
  242. "zh_CN": "dateTimeFormat"
  243. },
  244. "label": {
  245. "en_US": "DateTime Format",
  246. "zh_CN": "时间格式"
  247. }
  248. }
  249. ],
  250. "optional": true,
  251. "control": "list",
  252. "type": "list_object",
  253. "hint": {
  254. "en_US": "Query Template",
  255. "zh_CN": "查询模版"
  256. },
  257. "label": {
  258. "en_US": "Query Template",
  259. "zh_CN": "查询模版"
  260. }
  261. },
  262. {
  263. "name": "lookup",
  264. "default": [
  265. {
  266. "name": "cache",
  267. "default": true,
  268. "optional": false,
  269. "control": "radio",
  270. "type": "bool",
  271. "hint": {
  272. "en_US": "Whether to enable cache for lookup",
  273. "zh_CN": "是否开启查询缓存"
  274. },
  275. "label": {
  276. "en_US": "Enable lookup cache",
  277. "zh_CN": "开启查询缓存"
  278. }
  279. },
  280. {
  281. "name": "cacheTtl",
  282. "default": "600",
  283. "optional": true,
  284. "control": "text",
  285. "type": "string",
  286. "hint": {
  287. "en_US": "Cache Time To Live",
  288. "zh_CN": "缓存时间"
  289. },
  290. "label": {
  291. "en_US": "Cache TTL",
  292. "zh_CN": "缓存时间"
  293. }
  294. },
  295. {
  296. "name": "cacheMissingKey",
  297. "default": true,
  298. "optional": false,
  299. "control": "radio",
  300. "type": "bool",
  301. "hint": {
  302. "en_US": "Whether to cache missing lookup of null value",
  303. "zh_CN": "是否缓存未命中的空值"
  304. },
  305. "label": {
  306. "en_US": "Cache missing key",
  307. "zh_CN": "缓存未命中的 Key"
  308. }
  309. }
  310. ],
  311. "optional": true,
  312. "control": "list",
  313. "type": "list_object",
  314. "hint": {
  315. "en_US": "Lookup table configuration, only effective when using as a lookup table",
  316. "zh_CN": "查询表配置,仅在作为查询表使用时生效"
  317. },
  318. "label": {
  319. "en_US": "Lookup table configuration",
  320. "zh_CN": "查询表配置"
  321. }
  322. }
  323. ]
  324. },
  325. "outputs": [
  326. {
  327. "label": {
  328. "en_US": "Output",
  329. "zh_CN": "输出"
  330. },
  331. "value": "signal"
  332. }
  333. ],
  334. "node": {
  335. "category": "source",
  336. "icon": "iconPath",
  337. "label": {
  338. "en_US": "SQL",
  339. "zh_CN": "SQL"
  340. }
  341. }
  342. }