mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
added lua test cases
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@128 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
13
www/lua/test_sql.lua
Normal file
13
www/lua/test_sql.lua
Normal file
@ -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 ("<br>\n%s == %s<br>\n", tostring(s), tostring(luasql)))
|
||||
|
||||
cur:close()
|
||||
conn:close()
|
||||
env:close()
|
Reference in New Issue
Block a user