Skip to main content

Function: getDatabase()

getDatabase(): GameDatabase

Defined in: packages/core/src/saves/db.ts:90

Get the database instance for the game currently configured in options.

Returns​

GameDatabase

GameDatabase instance for the current game

Remarks​

Always call this at the point of use. Resolving the database once, at module scope, would capture the default empty gameId: options are applied by Game.init(), which runs after every module has been imported.