Module:UtilsCargo

local p = {} local cargo = mw.ext.cargo local frame = mw.getCurrentFrame

function p.declare(cargoTable, fields) return frame:callParserFunction{ name = '#cargo_declare:_table=' .. cargoTable, args = fields } end

function p.attach(cargoTable) return frame:callParserFunction{ name = '#cargo_attach:' .. cargoTable } end

function p.store(cargoTable, fields) frame:callParserFunction{ name = '#cargo_store:_table=' .. cargoTable, args = fields } end

function p.allOf(conditions) local whereClause for k, v in pairs(conditions) do		if not whereClause then whereClause = string.format("%s='%s'", k, v)		else whereClause = string.format("%s AND %s='%s'", whereClause, k, v)		end end return whereClause end

return setmetatable(p, {__index=cargo})