homework-jianmu/examples/lua
robotspace 41e29f418d
Infactor Lua connection pool implementation. (#20720)
* Do not retrieve err msg when connection is established successfully to avoid exception.

* Restore check script for lua installation.

* Infactor connection pool implementation.
2023-04-01 12:19:38 +08:00
..
OpenResty Infactor Lua connection pool implementation. (#20720) 2023-04-01 12:19:38 +08:00
lua51 Do not retrieve err msg when connection is established successfully (#20486) 2023-03-15 23:36:04 +08:00
README.md Drop stream when test case is over. Add commands to disable built-in lualib. (#17134) 2022-09-29 10:02:53 +08:00
benchmark.lua [TD-13408]<test>: move examples back to TDegnine (#10196) 2022-02-10 16:19:06 +08:00
build.sh Do not retrieve err msg when connection is established successfully (#20486) 2023-03-15 23:36:04 +08:00
lua_connector.c Do not retrieve err msg when connection is established successfully (#20486) 2023-03-15 23:36:04 +08:00
test.lua Drop stream when test case is over. Add commands to disable built-in lualib. (#17134) 2022-09-29 10:02:53 +08:00

README.md

TDengine driver connector for Lua

It's a Lua implementation for TDengine, an open-sourced big data platform designed and optimized for the Internet of Things (IoT), Connected Cars, Industrial IoT, and IT Infrastructure and Application Monitoring. You may need to install Lua5.3 . As TDengine is built with lua-enable with default configure, the built-in lua lib conflicts with external lua lib. The following commands require TDengine built with lua-disable. To disable built-in lua:

mkdir debug && cd debug
cmake .. -DBUILD_LUA=false && cmake --build .

Lua Dependencies

  • Lua:
https://www.lua.org/

Run with Lua Sample

Build driver lib:

./build.sh

Run lua sample:

lua test.lua

Run performance test:

time lua benchmark.lua

OpenResty Dependencies

  • OpenResty:
http://openresty.org

Run with OpenResty Sample

This section demonstrates how to get binary file for connector. To be convenient for trial, an connector has been put into OpenResty work directory. Because of difference on C API between Lua5.3 and Lua5.1, the files needed by connector for OpenResty are stored in local source directory and configured in script build.sh.

Build driver lib:

cd lua51
./build.sh

Run OpenResty sample:

cd ..
cd OpenResty
sudo openresty -p .
curl http://127.0.0.1:7000/api/test