- db = sql.new()
- db = sql.open(filename)
SYNOPSIS
DESCRIPTION
Both functions create a new database handle.
The first form sql.new() creates an uninitialized object. Before use, a database must be opened using sql:open().
The second form sql.open() will open the specified database file.
A open database handle can be used to run SQL statements by calling any of the sqlquery methods on it. Concurrent queries on the database can be held open by allocating further handles on the same database with sql:newquery().
Additionally, the database handle provides a lightweight settings API to keep application settings that are traditionally stored in ini-files. See sql:setValue() and sql:getValue().
RETURN VALUE
On success, returns a new database handle. On failure, three values are returned: nil,
a string describing the error and the errno number from the database engine.