Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-tx-log and listen with-ops?/with-tx-ops? should surface as much non-evicted data as possible #1769

Open
refset opened this issue Jun 13, 2022 · 0 comments
Labels
1.x enhancement New feature or request

Comments

@refset
Copy link
Contributor

refset commented Jun 13, 2022

e.g. :xtdb.api/delete should be conformed with the original :xt/id if it is still available, otherwise there are very limited options for reversing the lookup of an #xtdb/id (without resorting to internal APIs), possibly just this:

  (with-open [n (xt/start-node {})]
    (xt/submit-tx n [[::xt/delete :foo]])
    (xt/submit-tx n [[::xt/put {:xt/id :foo}]])
    (xt/submit-tx n [[::xt/delete :foo]])
    (xt/sync n)
    (defn xtdb-id->xt-id [node eid]
      (with-open [i (xt/open-entity-history (xt/db node)
                                            eid
                                            :asc
                                            {:with-docs? true
                                             :with-corrections? true})]
        (:xt/id (some :xtdb.api/doc (iterator-seq i)))))
    (xtdb-id->xt-id n (xtdb.codec/new-id :foo))) ;;=> :foo

(concat (when (contains? #{::xt/delete ::xt/evict ::xt/fn} op)
[(c/new-id id)])

To be discussed.

@refset refset added the enhancement New feature or request label Jun 13, 2022
@refset refset added this to Backlog in XTDB Development via automation Jun 13, 2022
@jarohen jarohen added the 1.x label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants