Module:User:Kai/sandbox

From The Deadlock Wiki
Revision as of 21:21, 27 August 2026 by Kai (talk | contribs) (Test mw.ext.bucket methods and _G.bucket (via update-page on MediaWiki MCP Server))
Jump to navigation Jump to search

Documentation for this module may be created at Module:User:Kai/sandbox/doc

local p = {}

function p.view(frame)
    local results = {}
    -- test _G.bucket vs mw.ext.bucket
    local b1 = _G.bucket('feedback')
    local s1, e1 = pcall(function() b1:select('page') end)
    table.insert(results, "_G.bucket select: " .. tostring(s1) .. " err: " .. tostring(e1))

    -- test where
    local b2 = mw.ext.bucket('feedback')
    local s2, e2 = pcall(function() b2:where('status', 'resolved') end)
    table.insert(results, "mw.ext.bucket where: " .. tostring(s2) .. " err: " .. tostring(e2))

    return "<pre>" .. table.concat(results, "\n") .. "</pre>"
end

return p