'Gets the most recent sync point for a server from the sync table.
:param id: remote ID to get the sync_point for
:param incoming: if True, get the last incoming sync, otherwise get
the last outgoing sync
:returns: the sync point, or -1 if the id doesn\'t exist.'

def get_sync(self, id, incoming=True):

    with self.get() as conn:
        row = conn.execute(('SELECT    sync_point    FROM    %s_sync    WHERE    remote_id=?' % ('incoming' if incoming else 'outgoing')), (id,)).fetchone()
        if (not row):
            return (-1)
        return row['sync_point']
