Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Schema

Methods about the schema of the selected game: its tables, local patches, and updates.

Definitions of single tables are read with GetTableDefinition.

schema.tables

Lists the tables of the schema, with the versions it has definitions for.

Params (ListSchemaTables)

NameTypeRequiredDescription
prefixstringno, default ""Only tables whose name starts with this are listed.

Result (SchemaTables)

NameTypeRequiredDescription
tablesmap of array of integeryesVersions with a definition, by table name, newest first.

schema.patch_column

Changes how the schema describes a column, with a local patch.

Local patches are kept apart from the schema, so they survive schema updates. The schema is reloaded after saving the patch, so it applies right away.

Params (PatchColumn)

NameTypeRequiredDescription
table_namestringyesName of the table, like units_tables.
columnstringyesName of the column.
patchmap of stringyesValues to set, by patch key. The keys are description, is_key, default_value, is_filename, filename_relative_path, is_reference, lookup, lookup_hardcoded, not_empty and unused.

Result (Done)

Empty object: {}.

schema.remove_patches

Removes the local patches of a table, or of one of its columns, and reloads the schema.

Params (RemovePatches)

NameTypeRequiredDescription
table_namestringyesName of the table, like units_tables.
columnstring or nullnoIf set, only the patches of this column are removed.

Result (Done)

Empty object: {}.

schema.update

Downloads the latest schemas, reloads the selected game’s one, and rebuilds the dependencies.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (UpdateSchemas)

Empty object: {}.

Result (SessionStatus)

NameTypeRequiredDescription
gamestringyesKey of the selected game, like warhammer_3.
schema_loadedbooleanyesIf a schema is loaded for the selected game. Tables can’t be read without one.
dependenciesDependenciesStatusyesWhat’s loaded of the dependencies of the selected game.
packsarray of PackSummaryyesThe open packs.

schema.update_from_assembly_kit

Updates the schema of the selected game with the tables of its Assembly Kit, and saves it.

Runs as a job: answers right away with a job ID, and sends its result when the job ends (see Jobs).

Params (UpdateSchemaFromAssemblyKit)

NameTypeRequiredDescription
ignore_game_filesboolean or nullnoIf tables in the game files are skipped. Defaults to the server’s setting.

Result (SessionStatus)

NameTypeRequiredDescription
gamestringyesKey of the selected game, like warhammer_3.
schema_loadedbooleanyesIf a schema is loaded for the selected game. Tables can’t be read without one.
dependenciesDependenciesStatusyesWhat’s loaded of the dependencies of the selected game.
packsarray of PackSummaryyesThe open packs.

schema.raw_definitions

Returns definitions of a table as the schema stores them, to edit them.

Their fields are the raw on-disk layout, which can differ from the columns rows have (see schema.definition for those).

Params (GetRawDefinitions)

NameTypeRequiredDescription
table_namestringyesName of the table, like units_tables.
versioninteger or nullnoIf set, only the definition of this version is returned.

Result (RawDefinitions)

NameTypeRequiredDescription
definitionsarray of anyyesThe definitions, newest first.

schema.set_definition

Adds a definition to the schema of the selected game, or replaces the one with its version, then saves and reloads the schema.

Params (SetDefinition)

NameTypeRequiredDescription
table_namestringyesName of the table, like units_tables.
definitionanyyesThe definition, in the format schema.raw_definitions returns.

Result (Done)

Empty object: {}.

schema.delete_definition

Removes a definition from the schema of the selected game, then saves and reloads the schema.

Params (DeleteDefinition)

NameTypeRequiredDescription
table_namestringyesName of the table, like units_tables.
versionintegeryesVersion of the definition.

Result (Done)

Empty object: {}.

schema.referencing_columns

Returns the columns of other tables referencing each column of a table.

Params (GetReferencingColumns)

NameTypeRequiredDescription
table_namestringyesName of the table, like factions_tables.
versioninteger or nullnoVersion of the table’s definition. Defaults to the version in the game files, or the newest one.

Result (ReferencingColumns)

NameTypeRequiredDescription
columnsmap of map of array of stringyesFor each referenced column, the referencing columns by table name.

schema.patches

Returns the patches applied to the columns of a table.

Params (GetTablePatches)

NameTypeRequiredDescription
table_namestringyesName of the table, like factions_tables.
versionintegeryesVersion of the table’s definition. If the table has no definition with this version, the patches of the table are returned.

Result (TablePatches)

NameTypeRequiredDescription
patchesmap of map of stringyesPatches by column name, as key-value pairs. See the valid keys in schema.patch_column.

schema.import_patches

Adds patches to the schema of the selected game itself, and saves it.

Unlike the ones of schema.patch_column, these patches are part of the schema, so a schema update replaces them.

Params (ImportPatches)

NameTypeRequiredDescription
patchesmap of map of map of stringyesPatches, by table name, column name and patch key. The keys are description, is_key, default_value, is_filename, filename_relative_path, is_reference, lookup, lookup_hardcoded, not_empty and unused.

Result (Done)

Empty object: {}.

schema.missing_definitions

Returns the tables of an open pack with rows that can’t be decoded with the schema.

Params (GetMissingDefinitions)

NameTypeRequiredDescription
packstringyesKey of the pack.

Result (MissingDefinitions)

NameTypeRequiredDescription
pathsarray of stringyesPaths of the tables, sorted.

Types

Type DependenciesStatus

What’s loaded of the dependencies of the selected game.

NameTypeRequiredDescription
vanilla_loadedbooleanyesIf the vanilla files of the game are loaded.
assembly_kit_loadedbooleanyesIf the tables of the game’s Assembly Kit are loaded.
parent_filesintegeryesAmount of files loaded from the parent packs of the open packs.
errorstring or nullnoWhy the dependencies couldn’t be fully loaded, like a missing or outdated dependencies cache, if they couldn’t.

Type PackSummary

Short description of an open pack.

NameTypeRequiredDescription
keystringyesKey identifying the pack in every method that works on it: a UUID, like 0b4c5a62-7d3e-4f1a-9c2b-8e6d5f4a3b21. It never changes while the pack is open.
namestringyesFile name of the pack, like my_mod.pack.
pathstring or nullyesPath of the pack on disk, if it’s saved there.
pack_typestringyesType of the pack: Boot, Release, Patch, Mod or Movie.
file_countintegeryesAmount of files in the pack.