Module:Cargo

local query1 = function (frame) local args = require 'Module:Arguments'.getArgs(frame) local result = mw.ext.cargo.query(args.tables, args.fields or '_pageName', {		join = args['join on'],		where = args.where,		groupBy = args['group by'],		having = args.having,		orderBy = args['order by'],		limit = 1,		offset = args.offset,	})[1] result = result and frame:preprocess(select(2, next(result))) if result then return result else mw.addWarning(args.warn or string.format('No result for query with parameters: ', mw.text.nowiki(			string.format('tables=%s,fields=%s,join=%s,where=%s,groupBy=%s,having=%s,orderBy=%s,limit=1,offset=%s',args.tables or , args.fields or ,args['join on'] or ,args.where or ,args['group by'] or ,args.having or ,args['order by'] or ,args.offset or )			))) return args.default or '' end end

return {query1 = query1}