Module:User:Litzsch/Sandbox

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

function p.query(tables, fields, arguments) local results = cargo.query(tables, fields, arguments)

-- Return nil if no results are found. if #results == 0 then return end

-- Remove results with empty strings from the results. local data = {} for i,result in ipairs(results) do   data[i] = {} for k,v in pairs(result) do     if v ~= '' then data[i][k] = v     end end end

return data end

return p