PageRenderTime 101ms CodeModel.GetById 60ms app.highlight 0ms RepoModel.GetById 40ms app.codeStats 0ms

Plain Text | 22 lines | 15 code | 7 blank | 0 comment | 0 complexity | 2de185435883ba940254b35fd3810b7c MD5 | raw file
 1To query or modify the database you must use a DatabaseCommand.
 2The DatabaseCommand objects are processed sequentially and asynchronously
 3by the DatabaseWorker.
 5This means you need to dispatch the cmd, and connect to a finished signal.
 6There are no blocking DB calls in the application code, except in the 
 7exec() method of a DatabaseCommand object.
 9If you inherit DatabaseCommandLoggable, the command is serialized into the
10oplog, so that peers can replay it against their cache of your database.
12For example, if you dispatch an addTracks DBCmd, after scanning a new album,
13this will be serialized, and peers will replay it so that their cached version
14of your collection is kept up to date.
16DBCmds have GUIDs, and are ordered by the 'id' in the oplog table.
18The last DBCmd GUID applied to your cache of a source's collection is stored
19in the source table (the lastop field). 
21The DBSyncConnection will ask for all ops newer than that GUID, and replay.