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

Cannot update data of type Object #13

Open
willianba opened this issue Nov 1, 2024 · 5 comments
Open

Cannot update data of type Object #13

willianba opened this issue Nov 1, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@willianba
Copy link

Hey @kitsonk!

After I recently updated to Deno 2 and also updated my kview installation, I no longer see the "Update value" button in any entries in my KV.
I thought this was removed, but I see this is still in kview docs, so maybe I'm doing something wrong.

Idk what else I can share though. It's a simple Object. Here's a screenshot.

image.

Do you have any guidance or is it a bug?
Thanks!

@kitsonk
Copy link
Owner

kitsonk commented Nov 2, 2024

When the value contains something that cannot be serialized to JSON, it prevents you from editing it (ref the note in the docs: https://kview.deno.dev/docs/values/objects) because it would not be able to be stored back in the way it was created. I should have made it clearer in the release notes.

What would be better in the long term is an object/array/Map/Set editor that supports set properties and elements in more complex types.

Is the payment.date a Date() object?

@willianba
Copy link
Author

willianba commented Nov 3, 2024

Is the payment.date a Date() object?

yes. i'm thinking about adding a date library to the app, like date-fns. it will probably change this type.

also, i have an ongoing task to migrate my kv setup to kv-toolbox. i see it has a lot of useful methods that could help solve that.

if you have any suggestion on a better way to store dates, i'm down.

@kitsonk
Copy link
Owner

kitsonk commented Nov 3, 2024

No, it is a good way. Previous versions of kview would have let you edit is as JSON but then would have destructively changed the value for anything that couldn't be serialized to JSON. If the value doesn't contain anything that isn't serializable to JSON it will let you edit it as JSON.

I started work on an object editor that would allow supporting everything that Deno KV supports and be able to edit individual properties that contain these "complex" values, but it might take me a while. It will be a bit like Firebase Firestore editor.

@willianba
Copy link
Author

that's great to know! in the meanwhile, should i close this issue? 😬
i don't think there's anything i could do to fix that.

@kitsonk
Copy link
Owner

kitsonk commented Nov 4, 2024

Naw, when I get the object editor done, I will tie it to this issue.

@kitsonk kitsonk added the enhancement New feature or request label Nov 4, 2024
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

2 participants