db.rs |
|
47132 |
encryption.rs |
|
11278 |
error.rs |
|
6944 |
lib.rs |
|
1395 |
login.rs |
|
51396 |
logins.udl |
|
4937 |
schema.rs |
Logins Schema v4
================
The schema we use is a evolution of the firefox-ios logins database format.
There are three tables:
- `loginsL`: The local table.
- `loginsM`: The mirror table.
- `loginsSyncMeta`: The table used to to store various sync metadata.
## `loginsL`
This stores local login information, also known as the "overlay".
`loginsL` is essentially unchanged from firefox-ios, however note the
semantic change v4 makes to timestamp fields (which is explained in more
detail in the [COMMON_COLS] documentation).
It is important to note that `loginsL` is not guaranteed to be present for
all records. Synced records may only exist in `loginsM` (although this is
not guaranteed). In either case, queries should read from both `loginsL` and
`loginsM`.
### `loginsL` Columns
Contains all fields in [COMMON_COLS], as well as the following additional
columns:
- `local_modified`: A millisecond local timestamp indicating when the record
was changed locally, or NULL if the record has never been changed locally.
- `is_deleted`: A boolean indicating whether or not this record is a
tombstone.
- `sync_status`: A `SyncStatus` enum value, one of
- `0` (`SyncStatus::Synced`): Indicating that the record has been synced
- `1` (`SyncStatus::Changed`): Indicating that the record should be
has changed locally and is known to exist on the server.
- `2` (`SyncStatus::New`): Indicating that the record has never been
synced, or we have been reset since the last time it synced.
## `loginsM`
This stores server-side login information, also known as the "mirror".
Like `loginsL`, `loginM` has not changed from firefox-ios, beyond the
change to store timestamps as milliseconds explained in [COMMON_COLS].
Also like `loginsL`, `loginsM` is not guaranteed to have rows for all
records. It should not have rows for records which were not synced!
It is important to note that `loginsL` is not guaranteed to be present for
all records. Synced records may only exist in `loginsM`! Queries should
test against both!
### `loginsM` Columns
Contains all fields in [COMMON_COLS], as well as the following additional
columns:
- `server_modified`: the most recent server-modification timestamp
([sync15::ServerTimestamp]) we've seen for this record. Stored as
a millisecond value.
- `is_overridden`: A boolean indicating whether or not the mirror contents
are invalid, and that we should defer to the data stored in `loginsL`.
## `loginsSyncMeta`
This is a simple key-value table based on the `moz_meta` table in places.
This table was added (by this rust crate) in version 4, and so is not
present in firefox-ios.
Currently it is used to store two items:
1. The last sync timestamp is stored under [LAST_SYNC_META_KEY], a
`sync15::ServerTimestamp` stored in integer milliseconds.
2. The persisted sync state machine information is stored under
[GLOBAL_STATE_META_KEY]. This is a `sync15::GlobalState` stored as
JSON.
|
11350 |
store.rs |
|
12461 |
sync |
|
|
util.rs |
|
1370 |