From d1af44bed4e714799b7dedab7cb2909ec7dffb8b Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sun, 9 Jun 2024 21:13:23 -0400 Subject: added a new lua function, query_db --- plugins/test.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/test.lua b/plugins/test.lua index afd998c..fee865e 100644 --- a/plugins/test.lua +++ b/plugins/test.lua @@ -5,8 +5,7 @@ local function sleep(n) while os.clock() - t0 <= n do end end -local function printer() - +local function test_printer() local config = milla.toml_config.new() print(config:IrcServer()) config:IrcServer("irc.libera.chat") @@ -18,4 +17,15 @@ local function printer() end end -printer() +local function test_query() + local query = + "select log from liberanet_milla_us_market_news order by log desc;" + local result = milla.query_db(query) + + print(result) + + for _, v in ipairs(result) do print(v) end +end + +-- test_printer() +test_query() -- cgit v1.2.3