1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00
esp8266/www/lua/test_sql.lua
cameronrich ab7cbe8310 added lua test cases
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@128 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
2007-09-17 21:48:39 +00:00

14 lines
411 B
Lua

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 ("<br>\n%s == %s<br>\n", tostring(s), tostring(luasql)))
cur:close()
conn:close()
env:close()