There was a team that did something like this, I saw a talk about it once. But I think they did in JS with Datomic in browser that somebody wrote. I might update this comment later with the relevant links.
But its really cool idea and I think very useful for some applications.
Full solutions like InstantDB or ConvexDB offer the syncing part, but they don't seem to be doing full incremental queries in the backend, but rather some combination of smart invalidation and then full recalculation of the subscriptions which then get pushed to the clients.