Skip to main content

DataStoreWriter

This item only works when running on the server. Server

Captures a snapshot of data to write and then merges it with the original.

Functions

new

DataStoreWriter.new(debugNamestring) → DataStoreWriter

Constructs a new DataStoreWriter. In general, you will not use this API directly.

SetSaveDataSnapshot

DataStoreWriter:SetSaveDataSnapshot(saveDataSnapshottable | any) → ()

Sets the ray data to write

AddSubWriter

DataStoreWriter:AddSubWriter(
namestring,
) → ()

Adds a recursive child writer to use at the key name

GetWriter

DataStoreWriter:GetWriter(namestring) → DataStoreWriter

Gets a sub writer

ComputeDiffSnapshot

DataStoreWriter:ComputeDiffSnapshot(incomingany) → ()

Merges the incoming data.

Won't really perform a delete operation because we can't be sure if we were suppose to have reified this stuff or not.

SetUserIdList

DataStoreWriter:SetUserIdList(userIdList{number}) → ()

Set of user ids to write with the data (only applies to top-level writer)

GetUserIdList

DataStoreWriter:GetUserIdList() → userIdList{number}

User ids to associate with data

WriteMerge

DataStoreWriter:WriteMerge(originalany) → any--

The original value

Merges the new data into the original value

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new DataStoreWriter. In general, you will not use this API directly.",
            "params": [
                {
                    "name": "debugName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 27,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "SetSaveDataSnapshot",
            "desc": "Sets the ray data to write",
            "params": [
                {
                    "name": "saveDataSnapshot",
                    "desc": "",
                    "lua_type": "table | any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 44,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "AddSubWriter",
            "desc": "Adds a recursive child writer to use at the key `name`",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "writer",
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 84,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "GetWriter",
            "desc": "Gets a sub writer",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DataStoreWriter"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 98,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "ComputeDiffSnapshot",
            "desc": "Merges the incoming data.\n\nWon't really perform a delete operation because we can't be sure if we were suppose to have reified this stuff or not.",
            "params": [
                {
                    "name": "incoming",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 111,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "SetUserIdList",
            "desc": "Set of user ids to write with the data (only applies to top-level writer)",
            "params": [
                {
                    "name": "userIdList",
                    "desc": "",
                    "lua_type": "{ number }"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 191,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "GetUserIdList",
            "desc": "User ids to associate with data",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "userIdList { number }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 202,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        },
        {
            "name": "WriteMerge",
            "desc": "Merges the new data into the original value",
            "params": [
                {
                    "name": "original",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "The original value",
                    "lua_type": "any"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 274,
                "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "DataStoreWriter",
    "desc": "Captures a snapshot of data to write and then merges it with the original.",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 6,
        "path": "src/datastore/src/Server/Modules/DataStoreWriter.lua"
    }
}