Cursors
The main mechanism for incremental syncs is cursors. A cursor is a field in model that only grows over time. For example,updated_at field in a table is a good candidate for cursor, or
id if it is auto-incrementing.
Cursors are defined in model
updated_at. The model will only fetch rows where update_at
value is greater than the last cursor value, which is stored in the sync state and
referenced by :cursor in the query.
For the first runs, and full refreshes, the cursor value will be
null. It means that all rows will be fetched.
So the query should be able to handle null cursor value properly, note the :cursor is null part in the query.