db#
local db = require 'db'
A collection of database utilities.
Functions#
- db.printquery(db, sql[, cols])#
Print the results of a SQL query to the console.
Important
Since the
sqlite
class returns results as tables the order of columns will be arbitrary. Thecols
parameter can be specified to preserve column order.- Parameters:
Example#-- run from the Lua Console static = require 'gw2.static' db = require 'db' -- print the number of waypoints in Lion's Arch db.printquery(static.db, "SELECT COUNT(*) FROM pois WHERE pois.map = 50 AND pois.type = 'waypoint'") -- +----------+ -- | COUNT(*) | -- +----------+ -- | 13 | -- +----------+