chungquantin/edma

Sled support

joepio opened this issue · 14 comments

Hi there! I'm building a graph database using Sled, an embedded kv store wrote in rust. I'd love to use this tui tool to inspect my db state.

Would you consider adding sled support? It's pretty popular.

https://github.com/spacejam/sled

Definitely! Sled is in the roadmap

@joepio Sled support is added into EDMA latest PR. Please check and let me know if your use case is satisfied. Any feedback is welcome! #10

wow that was fast! Amazing :)

When I run without any CLI args, I get an error: thread 'main' panicked at 'Unable to read file: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/joep/.cargo/registry/src/github.com-1ecc6299db9ec823/edma-0.1.0-beta.5/src/config.rs:103:56

When I add a config file (see below), I can run it with edma --config-path edma.json.

{
  "databases": [
    {
      "name": "sled",
      "path": "/Users/joep/Library/Application Support/atomic-data/store"
    }
  ],
  "templates": [
    {
      "name": "Custom layout",
      "layouts": [
        {
          "name": "prop_val_sub_index",
          "from": 0,
          "to": 5,
          "variant": "String"
        },
        {
          "name": "reference_index_v1",
          "from": 5,
          "to": 10,
          "variant": "Bytes"
        }
      ]
    }
  ]
}

In EDMA, however, no data is being shown. I've renamed the layouts to the trees of sled (not sure if that's required?)

Screenshot 2023-01-26 at 10 08 14

@joepio Is your data stored in a tree or globally? If it is in a tree, can you try typing a command 'TREE=' then your tree name in the command editor field?

It's stored in trees, but TREE=my_tree doesn't seem to be working for me

Screenshot 2023-01-26 at 10 49 55

If I try a non-existing path in my databases.path field in the config, there's no error shown. I guess we can't rule out that I'm having a config issue with the path, too.

@joepio After entering the command, makes sure to ENTER from keyboard. Are you the path to database is right?

If I try a non-existing path in my databases.path field in the config, there's no error shown. I guess we can't rule out that I'm having a config issue with the path, too.

I see, I will the error boundary in a later release.

Yeah I pressed enter. Maybe EDMA should throw if the path doesn't resolve to a SLED db, but I'm pretty sure my path is correct. I've tried a couple of combinations, too (relative, absolute, etc)

@joepio Ok guess there is a minor bug in loading from file path. Let me double check on my end and I'll let you know asap.

Ok thanks!

@joepio Just try the app again and it works perfectly. Can you use sled API to list trees and iterate to see if there is data there? I see you use Windows, mine is MacOS. Wonder if there are any compatibility issue with path absolute on different OS.

Screen Shot 2023-01-26 at 12 10 38

Yay, new version works! Thanks :)

Screenshot 2023-01-27 at 10 02 53

I'm also on mac btw, what made you think I was on windows? Paths etc. use forward slashes and mac dirs.

Anyways, glad it works! I'd like to have a way to set my trees in my config though

@joepio Awesome! I am trying to find a way to represent the data in each row in a better way. Any suggestion? About tree in config, please take a look at this issue: #12. It is a good recommendation, I definitely will implement that soon.