-- Ne fonctionne plus require "luasql.sqlite3"

luasql = require "luasql.sqlite3"

env = luasql.sqlite3()
conn = env:connect("/opt/domoticz/domoticz.db")

cursor = assert(conn:execute("select temperature,date from temperature where devicerowid = 101 order by date desc limit 10"))
row = {}
while cursor:fetch(row) do
    print(table.concat(row, '|'))
end

cursor:close()
conn:close()

env:close()

