Sqlite : Check for table in db

Hi . I can’t figure out how to check for an existing table in my database with sqlite/lua .

this is what i tried :

local checkTable = [[SELECT name FROM sqlite\_master WHERE type = "table"]]  
print( db:exec( checkTable ) )  
--delete table  
local tablekill = [[DROP TABLE test]]  
db:exec( tablekill )  
  
local checkTable = [[SELECT name FROM sqlite\_master WHERE type = "table"]]  
print( db:exec( checkTable ) )  

any ideas ? thank you in advance .

koji
[import]uid: 7165 topic_id: 2018 reply_id: 302018[/import]

This doesn’t work neither . Any suggestions ?

local checkTable = db:exec([[PRAGMA table\_info(test)]])  
print(checkTable)   

edit : this as a workaround works but there must me a better way : ?

local content = 0
for row in db:nrows(“SELECT * FROM test”) do
content = 1
end
print(content) --content variable 0 or 1
[import]uid: 7165 topic_id: 2018 reply_id: 5946[/import]