From 4fd287655a72b9aea14cdac715ad5b90ed082ed2 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sun, 19 Jun 2022 19:47:51 +0530 Subject: add circuitpython code --- circuitpython/lib/axtls/www/lua/test_sql.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 circuitpython/lib/axtls/www/lua/test_sql.lua (limited to 'circuitpython/lib/axtls/www/lua/test_sql.lua') diff --git a/circuitpython/lib/axtls/www/lua/test_sql.lua b/circuitpython/lib/axtls/www/lua/test_sql.lua new file mode 100644 index 0000000..085ce97 --- /dev/null +++ b/circuitpython/lib/axtls/www/lua/test_sql.lua @@ -0,0 +1,13 @@ +local s = require"luasql.postgres" + +local env = assert (luasql.postgres ()) +local conn = assert (env:connect ("luasql-test", "tomas")) +local cur = assert (conn:execute ("select count(*) from fetch_test")) + +cgilua.htmlheader() +cgilua.put ("Total lines at table fetch_test is "..cur:fetch()) +cgilua.put (string.format ("
\n%s == %s
\n", tostring(s), tostring(luasql))) + +cur:close() +conn:close() +env:close() -- cgit v1.2.3