object DB.new(string driver, string host, string database, string user, string password, int port)
Create a new DB connection object.
px = DB.new('QPSQL', 'localhost', 'mydb', 'user01', 'verysecret', '5432')
driver
A string containing the QT SQL driver name. QPSQL: postgresql
driver.
host
The hostname to connect to.
database
The database to open.
user
The username to use for authentication.
password
The password to use for authentication.
port
The port to connect to.
Returns The newly created communication object.
string value(int index)
Get current value from the result of the last query.
index
The column index number to use for the value retrieval.
Returns A string containing the value in the result cell.
boolean next()
Iterate to next row in result set.
while db:next()
do
local item = db:value(0)
print(item)
end
Returns true if another row is availble, false if the end of the list has
been reached.