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

Fully implement datafy #292

Open
huahaiy opened this issue Nov 5, 2024 · 11 comments
Open

Fully implement datafy #292

huahaiy opened this issue Nov 5, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@huahaiy
Copy link
Contributor

huahaiy commented Nov 5, 2024

  1. inconsistency

In the docstring of datalevin.core/entity it says:
If entity does not exist, nil is returned:

(entity db 100500) ; => nil

however, if I try to call e.g. (d/entity conn 999999999999999999) I just get back
{:db/id 999999999999999999}

  1. implement datafy on entity
@huahaiy huahaiy added enhancement New feature or request bug Something isn't working labels Nov 5, 2024
@huahaiy
Copy link
Contributor Author

huahaiy commented Nov 9, 2024

datafy appears to be implemented already on pulled entities. See datalevin.test.datafy

@huahaiy huahaiy closed this as completed in 47eede5 Nov 9, 2024
@huahaiy huahaiy removed bug Something isn't working enhancement New feature or request labels Nov 9, 2024
huahaiy added a commit that referenced this issue Nov 9, 2024
@huahaiy
Copy link
Contributor Author

huahaiy commented Nov 9, 2024

We will keep existing behavior and correct the doc string instead.

@simongray
Copy link

@huahaiy I don't think Datafy is implemented or at least I am unable to touch an entity and get data back (I still get one of Datalevin's internal types):

(type (clojure.datafy/datafy (d/touch (d/entity (d/db (d/get-conn db-path schema)) 1))))
=> datalevin.entity.Entity

@huahaiy
Copy link
Contributor Author

huahaiy commented Nov 22, 2024

What are these tests then? https://github.com/juji-io/datalevin/blob/master/test/datalevin/test/datafy.clj

PR welcome.

@simongray
Copy link

simongray commented Nov 27, 2024

Seems like nav is implemented, but not datafy.

@huahaiy
Copy link
Contributor Author

huahaiy commented Nov 27, 2024

PR welcome!

@huahaiy huahaiy reopened this Nov 27, 2024
@huahaiy huahaiy changed the title some fixes on entity Fully implement datafy Nov 27, 2024
@huahaiy huahaiy added the enhancement New feature or request label Nov 27, 2024
@den1k
Copy link
Contributor

den1k commented Dec 18, 2024

It is on entity but it seems the ns is not required anywhere

impl:

"Implement Clojure Datafiable protocol for entities"

missing require: https://github.com/search?q=repo%3Ajuji-io%2Fdatalevin%20datalevin.datafy&type=code

@huahaiy
Copy link
Contributor Author

huahaiy commented Dec 19, 2024

Would requiring this ns in datalevin.core help?

@den1k
Copy link
Contributor

den1k commented Dec 19, 2024 via email

@huahaiy
Copy link
Contributor Author

huahaiy commented Dec 20, 2024

Done.

@den1k
Copy link
Contributor

den1k commented Dec 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants