Factor out common code to retrieve SQL parameters (types and values) for
functions like execParams() etc.  While here, support passing Lua tables
as values, in which case the table entries will be passed as values.
This allows for easier creation of dynamic SQL:

p = { 'mbalmer', 'localhost' } -- parameter array
sql = { 'select * from userinfo where name = $1 and host = $2' } -- command

if location ~= 'all' then
	p[#p + 1] = location
	sql[#sql + 1] = string.format(' and location = $%d', #p)
end

db:execParams(sql, p)

Of course, passing parameters the usual way, i.e. not in a talble, still
works and I have no plans to change that.