2
0

test_sql.lua 411 B

12345678910111213
  1. local s = require"luasql.postgres"
  2. local env = assert (luasql.postgres ())
  3. local conn = assert (env:connect ("luasql-test", "tomas"))
  4. local cur = assert (conn:execute ("select count(*) from fetch_test"))
  5. cgilua.htmlheader()
  6. cgilua.put ("Total lines at table fetch_test is "..cur:fetch())
  7. cgilua.put (string.format ("<br>\n%s == %s<br>\n", tostring(s), tostring(luasql)))
  8. cur:close()
  9. conn:close()
  10. env:close()