Which declared engine is active.
OptionallocalSQLite settings (local mode). Omit to accept every default.
OptionalcloudPostgreSQL settings (cloud mode). Required when db is 'cloud'.
OptionalcollectorWrite collector configuration. Defaults to enabled with a 3s flush interval.
Root config object passed to
db.connect().Declare both engines up front and select the active one with
db. Every declared block is validated atconnect(), so a bad cloudconnectionStringis caught at boot even while you're still runningdb: 'local'. Flip the active engine at runtime withdb.reconnect('cloud' | 'local')— that reconnects only, it does not move data; useengineSwap()/db.swapEngine()when you need the rows to travel too.Remarks
localmay be omitted (every SQLite setting has a default).cloudis required wheneverdbis'cloud', because a PostgresconnectionStringhas no default.