Skip to main content

PagesDatabase

Functions

fromPageData

PagesDatabase.fromPageData(pageData{{any}}) → PagesDatabase

Constructs a database from static page data instead of a live Pages instance, for consumers that already hold the full result set -- e.g. a test fabricating an engine pages result through PagesProxy. Each entry in pageData is one page's item array; the last page reads back IsFinished = true. Empty pageData mirrors an empty engine result: a single empty page that is already finished.

local pages = PagesProxy.new(PagesDatabase.fromPageData({
	{ "a", "b" },
	{ "c" },
}))
Show raw api
{
    "functions": [
        {
            "name": "fromPageData",
            "desc": "Constructs a database from static page data instead of a live [Pages] instance, for consumers\nthat already hold the full result set -- e.g. a test fabricating an engine pages result through\n[PagesProxy]. Each entry in `pageData` is one page's item array; the last page reads back\n`IsFinished = true`. Empty `pageData` mirrors an empty engine result: a single empty page that\nis already finished.\n\n```lua\nlocal pages = PagesProxy.new(PagesDatabase.fromPageData({\n\t{ \"a\", \"b\" },\n\t{ \"c\" },\n}))\n```",
            "params": [
                {
                    "name": "pageData",
                    "desc": "",
                    "lua_type": "{ { any } }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PagesDatabase"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 53,
                "path": "src/pagesutils/src/Shared/Proxy/PagesDatabase.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PagesDatabase",
    "desc": "",
    "source": {
        "line": 5,
        "path": "src/pagesutils/src/Shared/Proxy/PagesDatabase.lua"
    }
}